{ "info": { "author": "John Bjorn Nelson", "author_email": "jbn@falsifiable.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Code Generators", "Topic :: System :: Filesystems", "Topic :: Utilities" ], "description": ".. image:: https://travis-ci.org/jbn/pathsjson.svg?branch=master\n :target: https://travis-ci.org/jbn/pathsjson\n.. image:: https://ci.appveyor.com/api/projects/status/xre5b722qk6ckqaf?svg=true\n :target: https://ci.appveyor.com/project/jbn/pathsjson/branch/master\n.. image:: https://coveralls.io/repos/github/jbn/pathsjson/badge.svg?branch=master\n :target: https://coveralls.io/github/jbn/pathsjson?branch=master \n.. image:: https://img.shields.io/pypi/v/pathsjson.svg\n :target: https://pypi.python.org/pypi/pathsjson\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n :target: https://raw.githubusercontent.com/jbn/pathsjson/master/LICENSE\n.. image:: https://img.shields.io/pypi/pyversions/pathsjson.svg\n :target: https://pypi.python.org/pypi/pathsjson\n\n\nWhat is this?\n=============\n\nA JSON-based DSL for describing paths in your project.\n\nWhy is this?\n~~~~~~~~~~~~\n\nMy etl/data analysis projects are littered with code like,\n\n.. code:: python\n\n import os\n\n DATA_DIR = \"data\"\n CLEAN_DIR = os.path.join(DATA_DIR, \"clean\")\n RAW_DIR = os.path.join(DATA_DIR, \"raw\")\n TARGET_HTML = os.path.join(RAW_DIR, \"something.html\")\n OUTPUT_FILE = os.path.join(CLEAN_DIR, \"something.csv\")\n\n with open(TARGET_HTML) as fp:\n csv = process(fp)\n\n with open(OUTPUT_FILE) as fp:\n write_csv(fp)\n\nIt's fine for one file, but when you have a whole ELT pipeline tucked\ninto a ``Makefile``, the duplication leads to fragility and violates\nDRY. It's a **REALLY** common pattern in file-based processing. This\npackage and format lets you do create a ``.paths.json`` file like,\n\n.. code:: json\n\n {\n \"__ENV\": {\"VERSION\": \"0.0.1\"},\n \"DATA_DIR\": [\"data\", \"$$VERSION\"],\n \"CLEAN_DIR\": [\"$DATA_DIR\", \"clean\"],\n \"RAW_DIR\": [\"$DATA_DIR\", \"raw\"],\n \"SOMETHING_HTML\": [\"$RAW_DIR\", \"something.html\"],\n \"SOMETHING_CSV\": [\"$RAW_DIR\", \"something.csv\"]\n }\n\nThen, from your python scripts,\n\n.. code:: python\n\n from pathsjson.automagic import PATHS\n\n print(\"Processing:\", PATHS['SOMETHING_HTML'])\n with PATHS.resolve('SOMETHING_HTML').open() as fp:\n csv = process(fp)\n\n with PATHS.resolve('SOMETHING_CSV').open(\"w\") as fp:\n write_csv(fp)\n\nInstallation\n------------\n.. code:: bash\n\n pip install pathsjson\n\n\nValidation\n----------\n\nThere is a ``.paths.json`` \n`schema `_. \nIt's validated with `JSON-Schema `_.\n\nMore details\n------------\n\nRead the docs: `here `_.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pathsjson.falsifiable.com", "keywords": "data analysis", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pathsjson", "package_url": "https://pypi.org/project/pathsjson/", "platform": "", "project_url": "https://pypi.org/project/pathsjson/", "project_urls": { "Homepage": "https://pathsjson.falsifiable.com" }, "release_url": "https://pypi.org/project/pathsjson/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.0.3" }, "last_serial": 3328696, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "78e6770bc4b75c4af052e2e457c8d85c", "sha256": "998b4a1ad43543ae2d0c24cf42846fca10197061d6bddd5f264d35a22f005730" }, "downloads": -1, "filename": "pathsjson-0.0.1.tar.gz", "has_sig": false, "md5_digest": "78e6770bc4b75c4af052e2e457c8d85c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5607, "upload_time": "2017-10-25T19:02:15", "url": "https://files.pythonhosted.org/packages/4f/e0/9488ede98422d34ccd27a91d62671ac2e1d087703cb8c8042ff97c5de148/pathsjson-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "704eb83cd4f74c91c720936298aac19d", "sha256": "6920fb70d5a0ddb151b288ce3570fda56e3e6dbbba156fd293aa2528536b60da" }, "downloads": -1, "filename": "pathsjson-0.0.2.tar.gz", "has_sig": false, "md5_digest": "704eb83cd4f74c91c720936298aac19d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6663, "upload_time": "2017-10-26T00:16:32", "url": "https://files.pythonhosted.org/packages/6e/57/5972e3a11e09425510eac709bb223f8f4a9f7c6e668c31ef6d4c842a39cc/pathsjson-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f328d2497cb1c9db37c6b541fe867332", "sha256": "61370bbfdfe99e068cd5582338d6d13af021031144bebecbfcf612b9c638488a" }, "downloads": -1, "filename": "pathsjson-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f328d2497cb1c9db37c6b541fe867332", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11956, "upload_time": "2017-11-13T14:26:05", "url": "https://files.pythonhosted.org/packages/80/8e/5066f27ada75500358cc2a69924fb999b0312e4937d09e756e392bd180ef/pathsjson-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f328d2497cb1c9db37c6b541fe867332", "sha256": "61370bbfdfe99e068cd5582338d6d13af021031144bebecbfcf612b9c638488a" }, "downloads": -1, "filename": "pathsjson-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f328d2497cb1c9db37c6b541fe867332", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11956, "upload_time": "2017-11-13T14:26:05", "url": "https://files.pythonhosted.org/packages/80/8e/5066f27ada75500358cc2a69924fb999b0312e4937d09e756e392bd180ef/pathsjson-0.0.3.tar.gz" } ] }