Skip to main content

Simple object (de)serialization and validation library

Project description

Simply python data objects management and validation based on standard jsonschema concepts. Project requires python3.6+ and allows users define how data objects should look and relate with other data objects. Supports python3.6+ typing annotations and customs attributes for more complex relationships.

Objectives

  1. Define and demarcate data objects just python annotations

  2. Define constraints in simple jsonschema compliant manner

  3. Validate data objects using standard jsonschema validators

  4. Express complete jsonschema as simple data objects (its just objects)

Similar Projects

Install

install from pip

$ pip install justobjects

install from source

$ pip install git+https://github.com/kulgan/justobjects@<version>#egg=justobjects

Usage Example

import justobjects as jo


@jo.data(auto_attribs=True)
class Model:
    a: int
    b: float
    c: str


# display schema
print(jo.show(Model))


try:
    # fails validation
    jo.is_valid(Model(a=3.1415, b=2.72, c="123"))
except jo.schemas.ValidationException as err:
    print(err.errors)

Contributing

The fastest way to get feedback on contributions/bugs is create a issues

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

justobjects-0.1.0a3.dev11.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

justobjects-0.1.0a3.dev11-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file justobjects-0.1.0a3.dev11.tar.gz.

File metadata

  • Download URL: justobjects-0.1.0a3.dev11.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for justobjects-0.1.0a3.dev11.tar.gz
Algorithm Hash digest
SHA256 0ee088c97101c417434763e1383c761eda2c6b5320f0957a1ea09360b6102c89
MD5 370571f39628180a0a76e8120addcedd
BLAKE2b-256 17848a64eee866786c577b2737e7722fa580ce31a8959d192c59ebacce55d5ae

See more details on using hashes here.

File details

Details for the file justobjects-0.1.0a3.dev11-py3-none-any.whl.

File metadata

  • Download URL: justobjects-0.1.0a3.dev11-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for justobjects-0.1.0a3.dev11-py3-none-any.whl
Algorithm Hash digest
SHA256 6b95b07cedb91beeb22b930677460bbc913ad2f543b5f21c03df0935a7da1cf7
MD5 f84d75a390a7b5173ce2cb21faed11b1
BLAKE2b-256 ef30c41754e189ddfa827ed8af06dff608a93fa21ed3d7369cccde6dfa17992d

See more details on using hashes here.

Supported by

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