Skip to main content

district42 to JSON-Schema translator and vise versa

Project description

SchemaMaximal

district42 schemas โ‡† JSON Schema

Installation

pip3 install schemax

Usage

>>> import schemax
>>> from district42 import schema
>>> ExampleSchema = schema.str.len(1, 10)
>>> schemax.to_json_schema(ExampleSchema)
{'type': 'string', 'minLength': 1, 'maxLength': 10}

Also, you could use schemax to translate from JSON-Schema to d42 and generate tests interfaces (in future releases) via command line:

$ python3 -m schemax translate schema.json
Translation from JSON-Schema to d42-schema for schema.json:
schema.dict({
    'number': schema.int.min(1),
    optional('street_name'): schema.str,
    ...: ...
})

schema.json:

{
  "type": "object",
  "properties": {
    "number": { "type": "integer", "minimum": 1 },
    "street_name": { "type": "string" }
  },
  "required": ["number"],
  "additionalProperties": true
}

Supported d42 -> JSON Schema types and features

(โœ… - done; ๐Ÿ”ง - planned support; โŒ - unsupportable)

Supported JSON Schema -> d42 types and features

(โœ… - done; ๐Ÿ”ง - planned support; โŒ - unsupportable)

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

schemax-0.4.3.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

schemax-0.4.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file schemax-0.4.3.tar.gz.

File metadata

  • Download URL: schemax-0.4.3.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for schemax-0.4.3.tar.gz
Algorithm Hash digest
SHA256 a6ec3f75565e7832d28ad099540fd0c2fb909f1bca4f6bdcad7132c682e73850
MD5 a6829dd18f17dc3da0b30e28f919dcac
BLAKE2b-256 84600aace204193972a559fabe2bbeeee68404a3b2544d70f29fd570598ce0ce

See more details on using hashes here.

File details

Details for the file schemax-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: schemax-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for schemax-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 81468605032b3b9553a70e1610cd32731362020dfbc46c61214b31a0c89e8d48
MD5 37066f99322ed1a94fa8155c84310e1b
BLAKE2b-256 ac65862126e67b75097ce5d1e8c9e50c6e11e4be68df4358573adc506a140821

See more details on using hashes here.

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