{ "info": { "author": "Yomguithereal", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Utilities" ], "description": "[![Build Status](https://travis-ci.org/Yomguithereal/python-daj.svg)](https://travis-ci.org/Yomguithereal/python-daj)\n\n# daj\n\nAre you terminally annoyed by the number of unaesthetic lines you have to write when the only thing you need is just reading and parsing some fracking data?\n\nWell if this is the case, **daj** is made for you!\n\n**daj**'s philosophy is to enable you to read and write popular data formats in one simplistic line.\n\nNo more of the following nonsense:\n\n```python\nimport codecs\nimport json\n\nwith codecs.open('path/to/your-fracking-data.json', 'r', encoding='utf-8') as jf:\n data = json.load(jf)\n```\n\nNow, you just write:\n\n```python\nfrom daj import daj\n\ndata = daj < 'path/to/your-fracking-data.json'\n```\n\n**daj** is your quick & dirty scripting companion. No more annoying boilerplate code: you start coding things that matter right now!\n\n## Installation\n\nWith pip\n\n```python\npip install daj\n```\n\nTo install the latest dev version\n```bash\npip install git+https://github.com/Yomguithereal/python-daj.git\n```\n\n## Formats supported\n\n* plain text\n* json\n* yaml\n* csv\n* tsv\n\n## Reading\nNote that if you do not provide a method to **daj**, this one will try to guess your format by analyzing the file's extension.\n\nSo if you have a twisted mind and like to name csv files `table.json`, well first of all you are a sneaky bastard, second, just use the proper **daj** method.\n\n```python\n# Guessing the format\ndata = daj < 'file.json'\n\n# Will also work with raw text\ndata = daj < 'file.txt'\n\n# Using daj methods\ndata = daj.json < 'file.json'\ndata = daj.yml < 'file.yml'\ndata = daj.csv < 'file.csv'\ndata = daj.tsv < 'file.tsv'\n\n# Needing headers for your neat CSV files?\ndata = daj.csvh < 'file.csv'\ndata = daj.tsvh < 'file.tsv'\n```\n\n## Writing\nAs for reading, **daj** will try to guess the correct format for your data based on the extension of the file.\n\n```python\n# Writing some data\ndaj(data) > 'file.json'\n\n# Will also work with raw text\ndaj(data) > 'file.txt'\n\n# Using daj methods\ndaj.json(data) > 'file.json'\ndaj.yml(data) > 'file.yml'\n\n# If you want to ouput a pretty printed json\ndaj.pjson(data) > 'prettyfile.json'\n\n# For csv, you can give an array of arrays or an array of objects\n# If an array of objects is given, daj will output a csv with headers.\ndaj.csv(data) > 'file.csv'\ndaj.tsv(data) > 'file.tsv'\n```\n\n## Disclaimer\n**daj** is clearly orientated toward quick & dirty data processing. This is probably a bad idea to use it in a production context and I would not vouch for that.\n\n## Contribution\nContribution are more than welcome, be sure to add relevant unit tests and pass them all before subitting any code.\n\n```bash\n# To install dev environment (preferably in a virtualenv)\npip install -r requirements.txt\n\n# To run unit tests\n./runtests\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Yomguithereal/python-daj", "keywords": "data json yaml csv read write file", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "daj", "package_url": "https://pypi.org/project/daj/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/daj/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Yomguithereal/python-daj" }, "release_url": "https://pypi.org/project/daj/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Read and write data without further ado.", "version": "0.1.0" }, "last_serial": 1118616, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b716cf31e36b05e06e0ebbb64c4b00a8", "sha256": "af251190257e3c77999fd4ceea50a17d35bab73efa95f59df813bf77e4a463a8" }, "downloads": -1, "filename": "daj-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b716cf31e36b05e06e0ebbb64c4b00a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3882, "upload_time": "2014-06-08T21:41:18", "url": "https://files.pythonhosted.org/packages/3a/3b/f9b4f18cc91cdf48e240b432b608f4bd8e24e0c295497f7ed61b5d291ac7/daj-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b716cf31e36b05e06e0ebbb64c4b00a8", "sha256": "af251190257e3c77999fd4ceea50a17d35bab73efa95f59df813bf77e4a463a8" }, "downloads": -1, "filename": "daj-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b716cf31e36b05e06e0ebbb64c4b00a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3882, "upload_time": "2014-06-08T21:41:18", "url": "https://files.pythonhosted.org/packages/3a/3b/f9b4f18cc91cdf48e240b432b608f4bd8e24e0c295497f7ed61b5d291ac7/daj-0.1.0.tar.gz" } ] }