{
"info": {
"author": "Stijn Debrouwere",
"author_email": "stijn@stdout.be",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Utilities"
],
"description": "``sqlnosql`` gets you from nosql to, well... sql. It takes a `JSON\nschema `__ and it turns it into any of:\n\n- a SQL schema\n- a sqlalchemy Table object\n- migration files for Alembic/SQLAlchemy\n\nIt can also take JSON data and insert it into your database -- either\nfrom the commandline or from Python.\n\nType in ``sqlnosql --help`` on the command line for more information.\n\n``sqlnosql`` will translate JSON types into SQL types and it will\nflatten down nested data structures so that e.g.\n``{\"supplies\": {\"medical\": \"string\"}}`` becomes a ``supplies_medical``\ncolumn with type TEXT.\n\n``sqlnosql`` is useful in ETL processes where you might have a bunch of\ndata in flat files or a nosql database that you want to get into a\nproper SQL database for analysis purposes.\n\nIf your database supports it, sqlnosql will keep arrays intact. In\nparticular, Postgres has an ARRAY type. However, keep in mind that\nnative arrays can only contain a single, simple type, like strings or\nnumbers. Complex types will automatically be reduced to simple types by\nsqlnosql. By default it does this by simply serializing them to JSON.\n\nSimilarly, if your JSON schema specifies objects that don't have any\nspecifically defined properties, these too will be serialized into\nstrings.\n\nKeep in mind that your JSON schema must be exhaustive. Fields not in\nyour schema will not become columns and will be ignored.\n\nBecause you probably ain't gonna need it, there's no support for data\nnormalization, that is, no support for splitting out your data into\nseparate tables that are connected through foreign keys.\n\nMigrations with Alembic\n-----------------------\n\nAlembic might seem overwhelming at first, especially for those who are\nnot from a Python background but would simply like to use the migration\nfeature of ``sqlnosql``. Don't worry, it's really rather easy to get\nstarted.\n\nFigure out where you'd like to keep your migration code, probably a\nsubdirectory of your general code repo, and do\n``alembic init ``. Now open ``alembic.ini`` and look for\n``sqlalchemy.url`` -- that's where you should enter the authentication\nfor and location to your database.\n\n(Alternatively, it is also possible to keep this information in\nenvironment variables, which we will explain later.)\n\nNow open ``/env.py``, look for the line that says\n``target_metadata = None`` and change it to something like\n\n.. code:: python\n\n import json\n import sqlnosql\n from sqlalchemy import MetaData\n\n schema = json.load(open('path/to/schema.json'))\n target_metadata = MetaData()\n table = sqlnosql.schema.create_table(schema, target_metadata, pk='my_primary_key_column')\n\nAnd that's all there is to it in terms of setup.\n\nNow, to create a new revision (a.k.a. migration), run\n``alembic revision --autogenerate``. Alembic will generate a Python file\ncontaining ``upgrade`` and ``download`` functions. It will tell you the\npath to this file, and before applying the migration you will want to\ncheck that file to make sure the database operations it suggests are\ncorrect, and if not, make the necessary adjustments.\n\nFinally, to run the migration, do ``alembic upgrade head``.\n\nFor more details on Alembic, take a look at `the Alembic\ntutorial `__.",
"description_content_type": null,
"docs_url": null,
"download_url": "http://www.github.com/newslynx/nosqlsql/tarball/master",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "UNKNOWN",
"keywords": "etl sql nosql postgres migrations transform load extract",
"license": "ISC",
"maintainer": null,
"maintainer_email": null,
"name": "sqlnosql",
"package_url": "https://pypi.org/project/sqlnosql/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/sqlnosql/",
"project_urls": {
"Download": "http://www.github.com/newslynx/nosqlsql/tarball/master",
"Homepage": "UNKNOWN"
},
"release_url": "https://pypi.org/project/sqlnosql/0.2.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Push semi-structured data (e.g. JSON documents) into a database with a minimum of fuss. Includes validation and schema migration.",
"version": "0.2.0"
},
"last_serial": 1172058,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "b94530c6f9281ab2b7a8d8c2f2e23227",
"sha256": "9964ad5ec9e9309f1e5a7e0478181282bd0142d7cea2cb607f3bf46f4dc10d4f"
},
"downloads": -1,
"filename": "sqlnosql-0.1.tar.gz",
"has_sig": false,
"md5_digest": "b94530c6f9281ab2b7a8d8c2f2e23227",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5935,
"upload_time": "2014-06-27T23:29:06",
"url": "https://files.pythonhosted.org/packages/99/c4/2bf003ffd12dace275966dc8f110ce29fecadca04f2654d9e5442cbe9e42/sqlnosql-0.1.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "5dee7d654f7e87d7e936e5ef6963c6c7",
"sha256": "c78c5e6c50a2cd1e18a3f28df6b22e785e8d3d77b895e6c13208fac8b3d822cb"
},
"downloads": -1,
"filename": "sqlnosql-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5dee7d654f7e87d7e936e5ef6963c6c7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6590,
"upload_time": "2014-07-28T17:05:08",
"url": "https://files.pythonhosted.org/packages/ea/75/5bab6b488c00ae740d99bd8573d72b480ef769ef3aa869fc144fcccfe96a/sqlnosql-0.2.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "5dee7d654f7e87d7e936e5ef6963c6c7",
"sha256": "c78c5e6c50a2cd1e18a3f28df6b22e785e8d3d77b895e6c13208fac8b3d822cb"
},
"downloads": -1,
"filename": "sqlnosql-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5dee7d654f7e87d7e936e5ef6963c6c7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6590,
"upload_time": "2014-07-28T17:05:08",
"url": "https://files.pythonhosted.org/packages/ea/75/5bab6b488c00ae740d99bd8573d72b480ef769ef3aa869fc144fcccfe96a/sqlnosql-0.2.0.tar.gz"
}
]
}