Skip to main content

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-hypernode.com/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsontableschema-sql-0.2.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

jsontableschema_sql-0.2.2-py2.py3-none-any.whl (8.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file jsontableschema-sql-0.2.2.tar.gz.

File metadata

File hashes

Hashes for jsontableschema-sql-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0e2e0fcd1f19b21d09bd807b4812512b9e953736c8ed0d0843c45fa6ab097e1c
MD5 7d483b79f1598ec306f48cab878ae285
BLAKE2b-256 821f7ea284eddd7af4f773e347b201c29f0213798e039a5fbf3df453d99c371b

See more details on using hashes here.

Provenance

File details

Details for the file jsontableschema_sql-0.2.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jsontableschema_sql-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 361b9ba99ee1808d39c6a7dbea82054bbefcb341c981afd89cff6765aeb140bf
MD5 8a8f89d27661a5e0db2bc3fb4db4de93
BLAKE2b-256 ac21b7f5a0d9324e86c03f78a247770c47a7e5951b2aca9038d2f8f66431c994

See more details on using hashes here.

Provenance

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