{ "info": { "author": "Friedrich Lindenberg, Gregor Aisch, Stefan Wehrmeyer", "author_email": "friedrich@pudo.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "datafreeze\n==========\n\n.. figure:: https://api.travis-ci.org/datafreeze/aleph.png\n :target: https://travis-ci.org/pudo/datafreeze/\n :alt: Build Status\n\n``datafreeze`` creates static extracts of SQL databases for use in interactive\nweb applications. SQL databases are a great way to manage relational data, but\nexposing them on the web to drive data apps can be cumbersome. Often, the\ncapacities of a proper database are not actually required, a few static JSON\nfiles and a bit of JavaScript can have the same effect. Still, exporting JSON\nby hand (or with a custom script) can also become a messy process.\n\nWith ``datafreeze``, exports are scripted in a Makefile-like description,\nmaking them simple to repeat and replicate.\n\n\nInstallation\n------------\n\nThe easiest way to install ``datafreeze`` is to retrieve it from the Python\npackage index using ``pip``:\n\n.. code-block:: bash\n\n pip install datafreeze\n\n\nBasic Usage\n-----------\n\nCalling DataFreeze is simple, the application is called with a\nfreeze file as its argument:\n\n.. code-block:: bash\n\n datafreeze Freezefile.yaml\n\nFreeze files can be either written in JSON or in YAML. The database URI\nindicated in the Freezefile can also be overridden via the command line:\n\n.. code-block:: bash\n\n datafreeze --db sqlite:///foo.db Freezefile.yaml\n\n\nExample Freezefile.yaml\n-----------------------\n\nA freeze file is composed of a set of scripted queries and\nspecifications on how their output is to be handled. An example could look\nlike this:\n\n.. code-block:: yaml\n\n common:\n\n database: \"postgresql://user:password@localhost/operational_database\"\n prefix: my_project/dumps/\n format: json\n\n exports:\n\n - query: \"SELECT id, title, date FROM events\"\n filename: \"index.json\"\n\n - query: \"SELECT id, title, date, country FROM events\"\n filename: \"countries/{{country}}.csv\"\n format: csv\n\n - query: \"SELECT * FROM events\"\n filename: \"events/{{id}}.json\"\n mode: item\n\n - query: \"SELECT * FROM events\"\n filename: \"all.json\"\n format: tabson\n\nAn identical JSON configuration can be found in this repository.\n\n\nOptions in detail\n-----------------\n\nThe freeze file has two main sections, ``common`` and ``exports``. Both\naccept many of the same arguments, with ``exports`` specifying a list of\nexports while ``common`` defines some shared properties, such as the\ndatabase connection string.\n\nThe following options are recognized:\n\n* ``database`` is a database URI, including the database type, username\n and password, hostname and database name. Valid database types include\n ``sqlite``, ``mysql`` and ``postgresql`` (requires psycopg2).\n* ``prefix`` specifies a common root directory for all extracted files.\n* ``format`` identifies the format to be generated, ``csv``, ``json`` and\n ``tabson`` are supported. ``tabson`` is a condensed JSON\n representation in which rows are not represented by objects but by\n lists of values.\n* ``query`` needs to be a valid SQL statement. All selected fields will\n become keys or columns in the output, so it may make sense to define\n proper aliases if any overlap is to be expected.\n* ``mode`` specifies whether the query output is to be combined into a\n single file (``list``) or whether a file should be generated for each\n result row (``item``).\n* ``filename`` is the output file name, appended to ``prefix``. All\n occurences of ``{{field}}`` are expanded to a fields value to allow the\n generation of file names e.g. by primary key. In list mode, templating\n can be used to group records into several buckets, e.g. by country or\n category.\n* ``wrap`` can be used to specify whether the output should be wrapped\n in a ``results`` hash in JSON output. This defaults to ``true`` for\n ``list``-mode output and ``false`` for ``item``-mode.\n\n\nContributors\n------------\n\n``dataset`` is written and maintained by `Friedrich Lindenberg\n`_, `Gregor Aisch `_ and\n`Stefan Wehrmeyer `_. We're standing on the\n`shoulders of giants `_.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/pudo/datafreeze", "keywords": "sql sqlalchemy etl loading utility", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "datafreeze", "package_url": "https://pypi.org/project/datafreeze/", "platform": "", "project_url": "https://pypi.org/project/datafreeze/", "project_urls": { "Homepage": "http://github.com/pudo/datafreeze" }, "release_url": "https://pypi.org/project/datafreeze/0.1.0/", "requires_dist": [ "PyYAML (>=3.10)", "dataset (>=1.0.0)", "six (>=1.7.3)" ], "requires_python": "", "summary": "Export data from a SQL database to a set of file formats.", "version": "0.1.0" }, "last_serial": 3162003, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "526c0f63f6250db6d3a22ccd878ed4cc", "sha256": "0a7ff7e5e92c01d7b74cfff294618b799dd6e5698ad585be60877fc807bc5d26" }, "downloads": -1, "filename": "datafreeze-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "526c0f63f6250db6d3a22ccd878ed4cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13839, "upload_time": "2017-09-09T17:04:49", "url": "https://files.pythonhosted.org/packages/e0/41/9e86652a1293a0c4664e5aa34a8f5b1a2fe5a04f7cae287ae79385f65ec0/datafreeze-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ccbde0ffaeffa3d9a802b7704aa38e21", "sha256": "e9611df781b34d7183d06755979014230216ce9c274360dd186a9a20fcca317f" }, "downloads": -1, "filename": "datafreeze-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ccbde0ffaeffa3d9a802b7704aa38e21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10837, "upload_time": "2017-09-09T17:04:50", "url": "https://files.pythonhosted.org/packages/82/c3/e90b668e08a185712f06467943284a4fc817eb689a262e16c383bef70a08/datafreeze-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "526c0f63f6250db6d3a22ccd878ed4cc", "sha256": "0a7ff7e5e92c01d7b74cfff294618b799dd6e5698ad585be60877fc807bc5d26" }, "downloads": -1, "filename": "datafreeze-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "526c0f63f6250db6d3a22ccd878ed4cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13839, "upload_time": "2017-09-09T17:04:49", "url": "https://files.pythonhosted.org/packages/e0/41/9e86652a1293a0c4664e5aa34a8f5b1a2fe5a04f7cae287ae79385f65ec0/datafreeze-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ccbde0ffaeffa3d9a802b7704aa38e21", "sha256": "e9611df781b34d7183d06755979014230216ce9c274360dd186a9a20fcca317f" }, "downloads": -1, "filename": "datafreeze-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ccbde0ffaeffa3d9a802b7704aa38e21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10837, "upload_time": "2017-09-09T17:04:50", "url": "https://files.pythonhosted.org/packages/82/c3/e90b668e08a185712f06467943284a4fc817eb689a262e16c383bef70a08/datafreeze-0.1.0.tar.gz" } ] }