Skip to main content

Translate your middle model declarations to OpenAPI, JSONSchema or any other schema you need

Project description

Translate your middle model declarations to OpenAPI, JSONSchema or any other schema you need!

Quick peak

>>> from typing import Dict, List
>>> import middle

>>> class Game(middle.Model):
...     name: str = middle.field()
...     score: float = middle.field(minimum=0, maximum=10)
...     resolution_tested: str = middle.field(pattern="^\d+x\d+$")
...     genre: List[str] = middle.field(unique_items=True)
...     rating: Dict[str, float] = middle.field(max_properties=5)

>>> data = {
...     "name": "Cities: Skylines",
...     "score": 9.0,
...     "resolution_tested": "1920x1200",
...     "genre": ["Simulators", "City Building"],
...     "rating": {
...         "IGN": 8.5,
...         "Gamespot": 8.0,
...         "Steam": 4.5
...     }
... }

>>> # TO BE CONTINUED

Documentation

https://middle-schema.readthedocs.io/en/latest/

License

middle-schema is a free software distributed under the MIT license.

Changelog

v0.1.0 on 2018-07-??

  • First release on PyPI.

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

middle-schema-0.1.0.tar.gz (38.4 kB view hashes)

Uploaded Source

Built Distribution

middle_schema-0.1.0-py2.py3-none-any.whl (6.5 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