Skip to main content

JSON Utils for generating DDL from JSON Schema

Project description

JSON Utils Package (DDLj)

This is a python package having multiple utilities for handling JSON Files.

Module1 - DDLj : Converts JSON Schema Files into ANSI SQL DDLs Supports foll databases: A.PostgreSQL B.MYSQL C.DB2 D.MariaDB E.Oracle

Usage:

pip install DDLJ

python

from DDLj import genddl

genddl(*param1,param2,*param3,*param4)

Where

param1= JSON Schema File

param2=Database (Default Oracle)

Param3= Glossary file

Param4= DDL output script

Note : * indicates mandatory parameters

It also includes a Flask module for front-end if used as a standalone tool. Refer to App directory.


Example:

Input JSON schema as: { "schema": "Http://Json-Schema.Org/Draft-07/Schema#", "type": "object", "title": "TableNameTest", "additionalProperties": false, "properties": { "ColumnNameOne": { "type": "string", "maxLength": 10 }, "ColumnNameTwo": { "type": "string", "format": "date-time" }, "ColumnNameThree": { "type": "string", "maxLength": 200 }, "ColumnNameFour": { "type": "string", "maxLength": 300 }, "ColumnNameFive": { "type": "string", "format": "date" }, "ColumnNameSix": { "type": "number" }, "ColumnNameSeven": { "type": "number" }, "ColumnNameEight": { "type": "string", "maxLength": 1000 }, "ColumnNameNine": { "type": "string", "maxLength": 2000 }, "ColumnNameTen": { "type": "number" } } }

Code Usage:

from DDLj import genddl genddl('TestJsonSchema.json','Oracle','GlossaryTestFile.csv','GenDDLGlossary.sql')

Output: Create Table TableNameTest (COL_NAM_One Varchar2(10), COL_NAM_Two Timestamp(6), COL_NAM_Three Varchar2(200), COL_NAM_Four Varchar2(300), COL_NAM_Five Date, COL_NAM_Six Number(38,10), COL_NAM_Seven Number(38,10), COL_NAM_Eight Varchar2(1000), COL_NAM_Nine Varchar2(2000), COL_NAM_Ten Number(38,10));

Please see the Test Folder for JSON schema, glossary file and output.


Note: Other modules to come soon.

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

DDLJ-0.0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

DDLJ-0.0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file DDLJ-0.0.3.tar.gz.

File metadata

  • Download URL: DDLJ-0.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for DDLJ-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7cc8215da970c180910bddb6163f0c9a13ed735b4bf9fe8b28653bddaad1de1f
MD5 a51a8188e28e561a2ea02c226e2889a4
BLAKE2b-256 38de4e8a3c42341b4a2c0710dbcdc49339da885e5c753a703bc5bf6af24340c6

See more details on using hashes here.

File details

Details for the file DDLJ-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: DDLJ-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for DDLJ-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a17374e85c43876158e1601be8c8a928b181f2201e7e66fa4c2d6c25d57f92dd
MD5 6207e41a675569c5cae5af77cabfb9ef
BLAKE2b-256 ceee965cae0ad682f82dea39f9a8a32f2cb258485b09c491741736e6dde43b44

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