volga: flexible object deserialization
What is it?
volga provides fast, extensible, and expressive APIs to deserialize any python data structure from any supported data format (such as JSON and eventually YAML and more). Volga allows full customization of the deserialization behavior of your data structures resulting in schema-tized, validated, type-checked objects.
import volga
# Define your model
class User(volga.Schema):
name: volga.fields.Str
age: volga.fields.Int
verified: volga.fields.Bool
json_data = '{"name":"bob","age":20,"verified":true}'
bob = volga.json.deserialize(json_data, User)
assert isinstance(bob, User)
print(bob) # prints object User(name='bob', age=20, verified=True)
Main Features
Documentation
Full documentation will soon be available on https://volga.readthedocs.io/en/latest/
Where to get it
The source code is currently hosted on GitHub at: https://github.com/yefrig/volga
Binary installers for the latest released version are available at the Python package index.
pip install volga
Main Contributors
-
Yefri Gaitan @yefrig
-
Ecenaz (Jen) Ozmen @eozmen410
Code Organization
.
βββ LICENSE
βββ Makefile
βββ README.md
βββ azure-pipelines.yml
βββ docs # readthedocs config and reqs
βΒ Β βββ Makefile
βΒ Β βββ conf.py
βΒ Β βββ index.md
βΒ Β βββ make.bat
βΒ Β βββ requirements.txt
βββ poetry.lock
βββ pyproject.toml # project configs
βββ pyrightconfig.json # pyright configs
βββ tests
βΒ Β βββ fields_test.py
βΒ Β βββ json_test.py
βΒ Β βββ schema_test.py
βΒ Β βββ test_test.py
βββ typings # pyright stubs
βΒ Β βββ pytest
βΒ Β βββ __init__.pyi
βΒ Β βββ __main__.pyi
βββ volga
βββ exceptions.py # module for volga error classes
βββ fields.py # posible field types for data structures
βββ format.py # API/protocols for data formats
βββ json.py # a JSON data format implementation
βββ schema.py # the schema protocol for data structures
βββ types.py # API/protocols for deserializable data structures