Skip to main content

Bind structured data directly to typed objects.

Project description

Note: This package is in the dangerous land of 0.x.y versions and may be subject to breaking changes with minor version increments.

This package is superseded by databind.core.

nr.databind.core

The nr.databind.core package provides a framework for binding structured data to typed objects as well as the (de-) serialization of that data from/to other formats.

See also: nr.databind.json.

Example

from nr.databind.core import Field, Struct

class Person(Struct):
    name = Field(str, prominent=True)
    age = Field(int)
    address = Field(int, default=None)

print(Person('John Wick', 48, 'Wicked St.'))  # Person(name='John Wick')

Copyright © 2020 Niklas Rosenstein

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nr.databind.core-0.0.22.tar.gz (24.2 kB view hashes)

Uploaded Source

Built Distribution

nr.databind.core-0.0.22-py2.py3-none-any.whl (31.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page