Skip to content

Commit

Permalink
Doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Apr 10, 2022
1 parent a6c3116 commit 792a5f4
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 82 deletions.
69 changes: 69 additions & 0 deletions docs/cattrs.preconf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cattrs.preconf package
======================

Submodules
----------

cattrs.preconf.bson module
--------------------------

.. automodule:: cattrs.preconf.bson
:members:
:undoc-members:
:show-inheritance:

cattrs.preconf.json module
--------------------------

.. automodule:: cattrs.preconf.json
:members:
:undoc-members:
:show-inheritance:

cattrs.preconf.msgpack module
-----------------------------

.. automodule:: cattrs.preconf.msgpack
:members:
:undoc-members:
:show-inheritance:

cattrs.preconf.orjson module
----------------------------

.. automodule:: cattrs.preconf.orjson
:members:
:undoc-members:
:show-inheritance:

cattrs.preconf.pyyaml module
----------------------------

.. automodule:: cattrs.preconf.pyyaml
:members:
:undoc-members:
:show-inheritance:

cattrs.preconf.tomlkit module
-----------------------------

.. automodule:: cattrs.preconf.tomlkit
:members:
:undoc-members:
:show-inheritance:

cattrs.preconf.ujson module
---------------------------

.. automodule:: cattrs.preconf.ujson
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: cattrs.preconf
:members:
:undoc-members:
:show-inheritance:
61 changes: 61 additions & 0 deletions docs/cattrs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cattrs package
==============

Subpackages
-----------

.. toctree::
:maxdepth: 4

cattrs.preconf

Submodules
----------

cattrs.converters module
------------------------

.. automodule:: cattrs.converters
:members:
:undoc-members:
:show-inheritance:

cattrs.disambiguators module
----------------------------

.. automodule:: cattrs.disambiguators
:members:
:undoc-members:
:show-inheritance:

cattrs.dispatch module
----------------------

.. automodule:: cattrs.dispatch
:members:
:undoc-members:
:show-inheritance:

cattrs.errors module
--------------------

.. automodule:: cattrs.errors
:members:
:undoc-members:
:show-inheritance:

cattrs.gen module
-----------------

.. automodule:: cattrs.gen
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: cattrs
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
cattrs
======

.. toctree::
:maxdepth: 4

cattrs

cattr
=====

Expand Down
16 changes: 8 additions & 8 deletions docs/preconf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For example, to get a converter configured for BSON:
.. doctest::

>>> from cattrs.preconf.bson import make_converter
>>> converter = make_converter() # Takes the same parameters as the ``GenConverter``
>>> converter = make_converter() # Takes the same parameters as the ``Converter``

Converters obtained this way can be customized further, just like any other converter.

Expand Down Expand Up @@ -43,15 +43,15 @@ Particular libraries may have additional constraints documented below.
Standard library ``json``
-------------------------

Found at :py:mod:`cattr.preconf.json`.
Found at :py:mod:`cattrs.preconf.json`.

Bytes are serialized as base 85 strings. Counters are serialized as dictionaries. Sets are serialized as lists, and deserialized back into sets. ``datetime`` s are serialized as ISO 8601 strings.


``ujson``
---------

Found at :py:mod:`cattr.preconf.ujson`.
Found at :py:mod:`cattrs.preconf.ujson`.

Bytes are serialized as base 85 strings. Sets are serialized as lists, and deserialized back into sets. ``datetime`` s are serialized as ISO 8601 strings.

Expand All @@ -61,7 +61,7 @@ Bytes are serialized as base 85 strings. Sets are serialized as lists, and deser
``orjson``
----------

Found at :py:mod:`cattr.preconf.orjson`.
Found at :py:mod:`cattrs.preconf.orjson`.

Bytes are serialized as base 85 strings. Sets are serialized as lists, and deserialized back into sets. ``datetime`` s are serialized as ISO 8601 strings.

Expand All @@ -72,7 +72,7 @@ Bytes are serialized as base 85 strings. Sets are serialized as lists, and deser
``msgpack``
-----------

Found at :py:mod:`cattr.preconf.msgpack`.
Found at :py:mod:`cattrs.preconf.msgpack`.

Sets are serialized as lists, and deserialized back into sets. ``datetime`` s are serialized as UNIX timestamp float values.

Expand All @@ -84,7 +84,7 @@ When parsing msgpack data from bytes, the library needs to be passed ``strict_ma
``bson``
--------

Found at :py:mod:`cattr.preconf.bson`. Tested against the ``bson`` module bundled with the ``pymongo`` library, not the standalone PyPI ``bson`` package.
Found at :py:mod:`cattrs.preconf.bson`. Tested against the ``bson`` module bundled with the ``pymongo`` library, not the standalone PyPI ``bson`` package.

Sets are serialized as lists, and deserialized back into sets.

Expand All @@ -100,15 +100,15 @@ When encoding and decoding, the library needs to be passed ``codec_options=bson.
``pyyaml``
----------

Found at :py:mod:`cattr.preconf.pyyaml`.
Found at :py:mod:`cattrs.preconf.pyyaml`.

Frozensets are serialized as lists, and deserialized back into frozensets.


``tomlkit``
-----------

Found at :py:mod:`cattr.preconf.tomlkit`.
Found at :py:mod:`cattrs.preconf.tomlkit`.

Bytes are serialized as base 85 strings. Sets are serialized as lists, and deserialized back into sets.
Tuples are serialized as lists, and deserialized back into tuples.
Expand Down
Loading

0 comments on commit 792a5f4

Please sign in to comment.