From fa1e36a0711189e88c1195095f6806da12a831cc Mon Sep 17 00:00:00 2001 From: Tim Savage Date: Mon, 5 Feb 2018 21:20:39 +1100 Subject: [PATCH] Docs and a import re-ordering for dict codec --- docs/ref/codecs/dict_codec.rst | 26 ++++++++++++++++++++++++++ odin/codecs/dict_codec.py | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 docs/ref/codecs/dict_codec.rst diff --git a/docs/ref/codecs/dict_codec.rst b/docs/ref/codecs/dict_codec.rst new file mode 100644 index 00000000..50a06c8c --- /dev/null +++ b/docs/ref/codecs/dict_codec.rst @@ -0,0 +1,26 @@ +########## +Dict Codec +########## + +Codec for serialising and de-serialising Dictionary and List objects. + +.. automodule:: odin.codecs.dict_codec + +Methods +======= + + .. autofunction:: load + + .. autofunction:: dump + + +Example usage +============= + +Loading a resource from a file:: + + from odin.codecs import dict_codec + + my_dict = {} + + resource = dict_codec.load(my_dict, MyResource) diff --git a/odin/codecs/dict_codec.py b/odin/codecs/dict_codec.py index 8dedbd6e..56bbefc4 100644 --- a/odin/codecs/dict_codec.py +++ b/odin/codecs/dict_codec.py @@ -1,8 +1,8 @@ import six -from odin.utils import getmeta from odin import bases from odin import resources, ResourceAdapter +from odin.utils import getmeta TYPE_SERIALIZERS = {}