Skip to main content

Parse JSON Schemas into relational model and transpile into other textual representations.

Project description

json-rm

This tool parses a JSON Schema into "Entities" and "Attributes", which correspond to tables and columns in a relational database. It can be used to output different representations of the data model described by the input schema.

Installation

pip install json-rm

Command line usage

jst <command> <schema_path>

Examples

Use the 'simple' formatter on a schema:

$ jst simple resources/schemas/1.2.246.537.6.1506.7000.2022.1.10.json

Use the 'postgres' formatter on a schema:

$ jst postgres resources/schemas/1.2.246.537.6.1506.7000.2022.1.10.json

Use the 'spark' formatter on a schema:

$ jst spark resources/schemas/1.2.246.537.6.1506.7000.2022.1.10.json

Using from your Python code

import json_rm
from json_rm.formatters import SimpleFormatter

schema = json_rm.JSONSchema.from_file("schema.json")
formatter = SimpleFormatter()

print(schema.render(formatter))

Parsing options

normalization

  • Denormalized (default) mode results in a flat structure with less tables.
  • Normalized mode results in a deep structure with more tables.

When normalization is set to False (default), the parser operates in "denormalized" mode, creating a new Entity only for the root object and repeating (array) objects. In the "normalized mode, a separate Entity is created for each nested structure (JSON objects and arrays).

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

json-rm-0.0.2.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

json_rm-0.0.2-py3-none-any.whl (8.9 kB view hashes)

Uploaded 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