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 d42 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-1.0.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for schemax-1.0.1.tar.gz
Algorithm Hash digest
SHA256 137d523289697f199941707b20bdce5f579445b1d1b976f05d409d1d3795064c
MD5 e79622bec309f66f7893554ad6e31554
BLAKE2b-256 cd45aa29397d503b25d8f71c209a4d6cba3983bff9973aa9a55a2a36c9509b52

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for schemax-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a21f30303edeac3e4541cee9051d6adae0a86bd83dfdd7dc8c33f5f6ec4f951f
MD5 c5077056e762ef3527e49a7c3813c483
BLAKE2b-256 d0d83f65e76cf13a2fc3f7b00fb79d6e3f8c6550c39ecffd4d3cebbcba656e1d

See more details on using hashes here.

Supported by

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