Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kulgan/justobjects
It's all just objects
https://github.com/kulgan/justobjects
data json-schema justobjects objects parsing python python3 validation
Last synced: 4 days ago
JSON representation
It's all just objects
- Host: GitHub
- URL: https://github.com/kulgan/justobjects
- Owner: kulgan
- License: apache-2.0
- Created: 2021-09-21T00:44:53.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-05T07:33:37.000Z (almost 3 years ago)
- Last Synced: 2024-09-16T12:57:52.027Z (about 2 months ago)
- Topics: data, json-schema, justobjects, objects, parsing, python, python3, validation
- Language: Python
- Homepage: https://justobjects.readthedocs.io
- Size: 211 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
justobjects
===========
|Pypi version| |Python versions| |ci| |Documentation Status|Simple 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 with 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
----------------
* pydantic_Install
-------
install from pip.. code-block:: bash
$ pip install justobjects
install from source
.. code-block:: bash
$ pip install git+https://github.com/kulgan/justobjects@#egg=justobjects
Usage Example
-------------
.. code-block:: pythonimport json
import justobjects as jo@jo.data(typed=True)
class Model:
a: int
b: float
c: str# display schema
print(json.dumps(jo.show_schema(Model), indent=2))try:
# fails validation
jo.validate(Model(a=3.1415, b=2.72, c="123"))
except jo.ValidationException as err:
print(err.errors)Contributing
------------
The fastest way to get feedback on contributions/bugs is create a issues_Running Tests
-------------
The project makes use of tox to run tests and other common tasks.. code-block:: bash
$ tox -e py36
.. _pydantic: https://pydantic-docs.helpmanual.io
.. _jsonschema: https://json-schema.org
.. _issues: https://github.com/kulgan/justobjects/issues.. |PyPI version| image:: https://img.shields.io/pypi/v/justobjects.svg
:target: https://pypi.python.org/pypi/justobjects
:alt: PyPi version.. |ci| image:: https://github.com/kulgan/justobjects/workflows/justobjects/badge.svg
:target: https://github.com/kulgan/justobjects/actions
:alt: CI status.. |Python versions| image:: https://img.shields.io/pypi/pyversions/justobjects.svg
:target: https://pypi.org/project/justobjects
:alt: PyPi versions.. |Documentation status| image:: https://readthedocs.org/projects/justobjects/badge/?version=latest
:target: https://justobjects.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status