volga

A python framework for deserialization


Keywords
python, serialize, deserialize, deserialization, typing, volga
License
MIT
Install
pip install volga==0.1.1

Documentation

volga: flexible object deserialization

Build Status Azure DevOps coverage license release python-version Docs

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

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