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.0.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.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: schemax-1.0.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 000a102b1ef4db6cd4504f72daf6a1b303df67f60015385978930bbe2d3adc68
MD5 321ca463180fb2fdaf0fec96651f6a1b
BLAKE2b-256 07ce1d0ce235f20f10d832c8482ac3dcb92a6966383ceb5e429d8f94e1b379c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: schemax-1.0.0-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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c66e8532128a4f2a55191502f34ca9b3435543a6faf911fa4e6b68acaa6d35a1
MD5 a4a2676632c17a4ff8bfa78315cb3e90
BLAKE2b-256 9724211fb7aaccc6d425045272def0826ec18a90fc776f4fc92cb82a84726c18

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