Skip to main content

Creates metaclasses for parameter definition and checking with taking respect to the jsonschema defined by https://json-schema.org/

Project description

jsonmetamodel

jsonmetamodel is used to provide a definition of struct like classes with direct type conversion, which are returning a Mapping type like dict.

Installing

Installing the latest release using pip is recommended.

$ pip install jsonmetamodel

Basic Usage

>>> from jsonmetamodel import JsonModel, JsonInteger, JsonString
>>> class Person(JsonModel):
...     name = JsonString()
...     age = JsonInteger()
...
>>> person = Person({"age": "65", "name": "Max Power"})
>>> person
MappingTreeItem({"age": 65, "name": "Max Power"})
>>> person["age"]
65
>>> person.age
65
>>> person.age = 66
>>> person.age
66
>>> dict(person)
{"age": 65, "name": "Max Power"}

Contribution

Any contribution by reporting a bug or desired changes are welcomed. The preferred way is to create an issue on the gitlab's project page, to keep track of everything regarding this project.

Contribution of Source Code

Code style

This project follows the recommendations of PEP8. The project is using black as the code formatter.

Workflow

  1. Fork the project on Gitlab.
  2. Commit changes to your own branch.
  3. Submit a pull request from your fork's branch to our branch 'dev'.

Authors

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details

Acknowledge

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

jsonmetamodel-0.1a0.tar.gz (27.4 kB view hashes)

Uploaded Source

Built Distribution

jsonmetamodel-0.1a0-py3-none-any.whl (22.4 kB view hashes)

Uploaded 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