Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/better/jsonschema2db
Generate tables dynamically from a JSON Schema and insert data
https://github.com/better/jsonschema2db
json-schema postgresql python
Last synced: about 5 hours ago
JSON representation
Generate tables dynamically from a JSON Schema and insert data
- Host: GitHub
- URL: https://github.com/better/jsonschema2db
- Owner: better
- License: mit
- Created: 2017-08-15T22:37:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T10:22:08.000Z (almost 2 years ago)
- Last Synced: 2025-01-18T13:13:38.456Z (7 days ago)
- Topics: json-schema, postgresql, python
- Language: Python
- Homepage: https://better.engineering/jsonschema2db/
- Size: 82 KB
- Stars: 304
- Watchers: 132
- Forks: 62
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - better/jsonschema2db - Generate tables dynamically from a JSON Schema and insert data (Python)
README
[![Travis status](https://img.shields.io/travis/better/jsonschema2db/master.svg?style=flat)](https://travis-ci.org/better/jsonschema2db)
JSON Schema ➣ Database
---We use [JSON Schema](http://json-schema.org/) pretty extensively at [Better](https://better.com) to store complex data. Unfortunately the data is hard to query from SQL. To facilitate querying, this library converts objects stored in a JSON schema into flat Postgres tables with proper types.
For instance, Better uses it to generate 50+ tables automatically, with millions of rows, from a very complex JSON schema that is 7000+ lines long.
Postgres and Redshift are supported, although the latter is somewhat experimental still.
Installation
---The easiest way to install is `pip install jsonschema2db`
Documentation
---See [full documentation](https://better.engineering/jsonschema2db/) for more info about how to use jsonschema2db!
Other
---* The code is tested with a full integration test running a Postgres server inside Docker. To run tests, run `docker build -t jsonschema2db . && docker run jsonschema2db`
* Pull requests are very welcome.
* This repo uses the [MIT license](https://github.com/better/jsonschema2db/blob/master/LICENSE).