Generate SQL tables, load and extract data, based on JSON Table Schema descriptors.
Project description
# jsontableschema-sql-py
[![Travis](https://img.shields.io/travis/frictionlessdata/jsontableschema-sql-py/master.svg)](https://travis-ci.org/frictionlessdata/jsontableschema-sql-py)
[![Coveralls](http://img.shields.io/coveralls/frictionlessdata/jsontableschema-sql-py/master.svg)](https://coveralls.io/r/frictionlessdata/jsontableschema-sql-py?branch=master)
[![PyPi](https://img.shields.io/pypi/v/jsontableschema-sql.svg)](https://pypi.python.org/pypi/jsontableschema-sql)
[![Gitter](https://img.shields.io/gitter/room/frictionlessdata/chat.svg)](https://gitter.im/frictionlessdata/chat)
Generate and load SQL tables based on JSON Table Schema descriptors.
## Tabular Storage
Package implements [Tabular Storage](https://github.com/okfn/datapackage-storage-py#tabular-storage) interface.
SQLAlchemy is used as sql wrapper. We can get storage this way:
```python
from sqlalchemy import create_engine
from jsontableschema_sql import Storage
engine = create_engine('sqlite:///:memory:', prefix='prefix')
storage = Storage(engine)
```
Then we could interact with storage:
```python
storage.tables
storage.check('table_name') # check existence
storage.create('table_name', schema)
storage.delete('table_name')
storage.describe('table_name') # return schema
storage.read('table_name') # return data
storage.write('table_name', data)
```
## Mappings
```
schema.json -> SQL table schema
data.csv -> SQL talbe data
```
## Drivers
SQLAlchemy is used - [docs](http://www.sqlalchemy.org/).
## Documentation
API documentation is presented as docstings:
- [Storage](https://github.com/frictionlessdata/jsontableschema-sql-py/blob/master/jsontableschema_sql/storage.py)
## Contributing
Please read the contribution guideline:
[How to Contribute](CONTRIBUTING.md)
Thanks!
[![Travis](https://img.shields.io/travis/frictionlessdata/jsontableschema-sql-py/master.svg)](https://travis-ci.org/frictionlessdata/jsontableschema-sql-py)
[![Coveralls](http://img.shields.io/coveralls/frictionlessdata/jsontableschema-sql-py/master.svg)](https://coveralls.io/r/frictionlessdata/jsontableschema-sql-py?branch=master)
[![PyPi](https://img.shields.io/pypi/v/jsontableschema-sql.svg)](https://pypi.python.org/pypi/jsontableschema-sql)
[![Gitter](https://img.shields.io/gitter/room/frictionlessdata/chat.svg)](https://gitter.im/frictionlessdata/chat)
Generate and load SQL tables based on JSON Table Schema descriptors.
## Tabular Storage
Package implements [Tabular Storage](https://github.com/okfn/datapackage-storage-py#tabular-storage) interface.
SQLAlchemy is used as sql wrapper. We can get storage this way:
```python
from sqlalchemy import create_engine
from jsontableschema_sql import Storage
engine = create_engine('sqlite:///:memory:', prefix='prefix')
storage = Storage(engine)
```
Then we could interact with storage:
```python
storage.tables
storage.check('table_name') # check existence
storage.create('table_name', schema)
storage.delete('table_name')
storage.describe('table_name') # return schema
storage.read('table_name') # return data
storage.write('table_name', data)
```
## Mappings
```
schema.json -> SQL table schema
data.csv -> SQL talbe data
```
## Drivers
SQLAlchemy is used - [docs](http://www.sqlalchemy.org/).
## Documentation
API documentation is presented as docstings:
- [Storage](https://github.com/frictionlessdata/jsontableschema-sql-py/blob/master/jsontableschema_sql/storage.py)
## Contributing
Please read the contribution guideline:
[How to Contribute](CONTRIBUTING.md)
Thanks!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jsontableschema-sql-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f97a11b46d882066e6b485f3d9ea432b92531b4789e7e1d7078fd1e9fe1a8623 |
|
MD5 | 1feb28c9a0f07763003c3abc991c736f |
|
BLAKE2b-256 | 036c249958842ccb46d75050f26e7846d7ed0986135bf4ee02c03ca7491961b3 |
Close
Hashes for jsontableschema_sql-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d548fe547da0180e6c76764e1736db3a891cbfbc434e347d5fec58578fec77 |
|
MD5 | bb9ced9936c0c7026f29f0bf82773dca |
|
BLAKE2b-256 | 9314b61eb412f7ee5d9681a295a53f98935363239596b4e3a7db6088ee325b41 |