{ "info": { "author": "Miguel Exp\u00f3sito Mart\u00edn", "author_email": "miguel.exposito@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries" ], "description": "**LAST RELEASE 1.0**: update to 1.0 version is highly recommended, since it supports JSON-stat 2.0 and brings other improvements.\n\n=======\npyjstat\n=======\n\n.. image:: https://travis-ci.org/predicador37/pyjstat.svg?branch=master\n :target: https://travis-ci.org/predicador37/pyjstat\n\n**pyjstat** is a python library for **JSON-stat** formatted data manipulation\nwhich allows reading and writing JSON-stat [1]_ format with python,using the\nDataFrame structures provided by the widely accepted pandas library [2]_.\nThe JSON-stat format is a simple lightweight JSON format for data\ndissemination, currently in its 2.0 version.\nPyjstat is inspired in rjstat [3]_, a library to read and write\nJSON-stat with R, by ajschumacher. Note that, like in the rjstat project,\nnot all features are supported (i.e. not all metadata are converted).\n**pyjstat** is provided under the Apache License 2.0.\n\n.. [1] http://json-stat.org/ for JSON-stat information\n.. [2] http://pandas.pydata.org for Python Data Analysis Library information\n.. [3] https://github.com/ajschumacher/rjstat for rjstat library information\n\nThis library was first developed to work with Python 2.7. With some fixes\n(thanks to @andrekittredge), now it works with Python 3.4 too.\n\nSupport for JSON-stat 1.3 and 2.0 is provided. JSON-stat 1.3 methods are\ndeprecated now and shouldn't be used in the future, but backwards compatibility\nhas been preserved.\n\nPyjstat 1.0 is aimed for simplicity. JSON-stat classes have been replicated\n(Dataset, Collection and Dimension) and provided with simple read() and write()\nmethods. Funcionality covers common use cases as having a URL or dataframe\nas data sources.\n\nMethods for retrieving the value of a particular cube cell are taken from the\nJSON-stat Javascript sample code. Thanks to @badosa for this.\n\nAlso, version 1.0 makes use of the requests package internally, which should\nmake downloading of datasets easier.\n\nTest coverage is 88% and Travis CI is used.\n\nFinally, note that the new classes and methods are inspired by JSON-stat 2.0,\nand hence, won't work with previous versions of JSON-stat. However, older\nmethods are still available incorporating bug fixes and performance\nimprovements.\n\nInstallation\n============\n\npyjstat requires pandas package. For installation::\n\n pip install pyjstat\n\nUsage of version 1.0 and newer (with JSON-stat 2.0 support)\n===========================================================\n\nDataset operations: read and write\n----------------------------------\n\nTypical usage often looks like this::\n\n from pyjstat import pyjstat\n\n EXAMPLE_URL = 'http://json-stat.org/samples/galicia.json'\n\n # read from json-stat\n dataset = pyjstat.Dataset.read(EXAMPLE_URL)\n\n # write to dataframe\n df = dataset.write('dataframe')\n print(df)\n\n # read from dataframe\n dataset_from_df = pyjstat.Dataset.read(df)\n\n # write to json-stat\n print(dataset_from_df.write())\n\nDataset operation: get_value\n----------------------------------\n\nThis operation mimics the Javascript example in the JSON-stat web page::\n\n from pyjstat import pyjstat\n\n EXAMPLE_URL = 'http://json-stat.org/samples/oecd.json'\n query = [{'concept': 'UNR'}, {'area': 'US'}, {'year': '2010'}]\n\n dataset = pyjstat.Dataset.read(EXAMPLE_URL)\n print(dataset.get_value(query))\n\nCollection operations: read and write\n-------------------------------------\n\nA collection can be parsed into a list of dataframes::\n\n from pyjstat import pyjstat\n\n EXAMPLE_URL = 'http://json-stat.org/samples/collection.json'\n\n collection = pyjstat.Collection.read(EXAMPLE_URL)\n df_list = collection.write('dataframe_list')\n print(df_list)\n\nExample with UK ONS API\n-----------------------\n\nIn the following example, apikey parameter must be replaced by a real api key\nfrom ONS. This dataset corresponds to residence type by sex by age in London::\n\n EXAMPLE_URL = 'http://web.ons.gov.uk/ons/api/data/dataset/DC1104EW.json?'\\\n 'context=Census&jsontype=json-stat&apikey=yourapikey&'\\\n 'geog=2011HTWARDH&diff=&totals=false&'\\\n 'dm/2011HTWARDH=E12000007'\n dataset = pyjstat.Dataset.read(EXAMPLE_URL)\n df = dataset.write('dataframe')\n print(df)\n\nMore examples\n-------------\n\nMore examples can be found in the examples directory, both for versions 1.3\nand 2.0.\n\n\nUsage of version 0.3.5 and older (with support for JSON-stat 1.3)\n=================================================================\n\nThis syntax is deprecated and therefore not recommended anymore.\n\nFrom JSON-stat to pandas DataFrame\n-----------------------------------\n\nTypical usage often looks like this::\n\n from pyjstat import pyjstat\n import requests\n from collections import OrderedDict\n\n EXAMPLE_URL = 'http://json-stat.org/samples/us-labor.json'\n\n data = requests.get(EXAMPLE_URL)\n results = pyjstat.from_json_stat(data.json(object_pairs_hook=OrderedDict))\n print (results)\n\nFrom pandas DataFrame to JSON-stat\n----------------------------------\n\nThe same data can be converted into JSON-stat, with some unavoidable metadata\nloss::\n\n from pyjstat import pyjstat\n import requests\n from collections import OrderedDict\n import json\n\n EXAMPLE_URL = 'http://json-stat.org/samples/us-labor.json'\n\n data = requests.get(EXAMPLE_URL)\n results = pyjstat.from_json_stat(data.json(object_pairs_hook=OrderedDict))\n print (results)\n print (json.dumps(json.loads(pyjstat.to_json_stat(results))))\n\nChanges\n-------\n\nFor a changes, fixes, improvements and new features reference, see CHANGES.txt.\n\n\n", "description_content_type": "", "docs_url": "https://pythonhosted.org/pyjstat/", "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/predicador37/pyjstat", "keywords": "json-stat,json,statistics,dataframe,converter", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "pyjstat", "package_url": "https://pypi.org/project/pyjstat/", "platform": "", "project_url": "https://pypi.org/project/pyjstat/", "project_urls": { "Homepage": "https://github.com/predicador37/pyjstat" }, "release_url": "https://pypi.org/project/pyjstat/1.1.0/", "requires_dist": [ "pandas", "requests" ], "requires_python": "", "summary": "Library to handle JSON-stat data in python using pandas DataFrames.", "version": "1.1.0" }, "last_serial": 5704087, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2cff47877b5da271cd1a8de695f45fb3", "sha256": "83d0019662c3f137de8ee9816ad9a3b58429d0fe261f481166d18eb437957e9e" }, "downloads": -1, "filename": "pyjstat-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2cff47877b5da271cd1a8de695f45fb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16163, "upload_time": "2014-05-22T17:43:22", "url": "https://files.pythonhosted.org/packages/95/70/46db14945ec2973e603b79a2567695c77ed274ff779d7b4c9b07750d6c37/pyjstat-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "548e16844af7f544cee11db3be533805", "sha256": "3b247ee0d962401f731cb355840a52e849d69d526051bf3d2f5f910caf070d0a" }, "downloads": -1, "filename": "pyjstat-0.1.1.tar.gz", "has_sig": false, "md5_digest": "548e16844af7f544cee11db3be533805", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16164, "upload_time": "2014-05-22T18:24:05", "url": "https://files.pythonhosted.org/packages/3b/b3/685072a9d39de2f88f36e3b34c620d3bbec184ee360ae492c19b866b2fd5/pyjstat-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d224e4bb92b491d8eb44ffca1a96f433", "sha256": "1a3e7d114350627403b5245d027e9fff7517a3e0a139e2c20f3eb3adee48ee00" }, "downloads": -1, "filename": "pyjstat-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d224e4bb92b491d8eb44ffca1a96f433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16208, "upload_time": "2014-05-22T19:03:48", "url": "https://files.pythonhosted.org/packages/fa/2f/f8508ad054fd72978f2102465d561a4fa3bd3d2e43fd72b7504e190e6296/pyjstat-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ed8f1b2046638d6119ce2075988f2004", "sha256": "f794080df9272acc85d33616bc680dedfbeb3b1d369a94313fba7e101b96a187" }, "downloads": -1, "filename": "pyjstat-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ed8f1b2046638d6119ce2075988f2004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16197, "upload_time": "2014-05-22T19:08:31", "url": "https://files.pythonhosted.org/packages/70/b3/932ffd67c32ada0a0a7fa45dd905487f5637d01c22d5d633e09ca1b469c3/pyjstat-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "c768b82449218c1a73dee2a3fa9adf61", "sha256": "1ceaf9dc9632a81b1043c6a9cb588eda98170190761172f052d5c27a23fefe97" }, "downloads": -1, "filename": "pyjstat-0.1.4.tar.gz", "has_sig": false, "md5_digest": "c768b82449218c1a73dee2a3fa9adf61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 157120, "upload_time": "2014-05-25T15:59:32", "url": "https://files.pythonhosted.org/packages/68/fc/fde77333eb4e512775cb00ac12dccc80ff4addaedf73a87b75862af1c954/pyjstat-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "2cd60f84d71569bd806a979341fe5698", "sha256": "7b128422d5ff6d5fc978630ff14b69e798ab552ed2ea1af3a7b988d8455c8b8f" }, "downloads": -1, "filename": "pyjstat-0.1.5.tar.gz", "has_sig": false, "md5_digest": "2cd60f84d71569bd806a979341fe5698", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 157222, "upload_time": "2014-06-08T18:39:40", "url": "https://files.pythonhosted.org/packages/a7/34/ccd655ce02feec74bd9d25209eff027d23e8d21faef251cacc3d530911ee/pyjstat-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "5f120d0572098aa169b89e153844627a", "sha256": "c42d00b48111456c4043b4e94350ebbb9b08d42089b559c286c71bfd7862e285" }, "downloads": -1, "filename": "pyjstat-0.1.6.tar.gz", "has_sig": false, "md5_digest": "5f120d0572098aa169b89e153844627a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 160663, "upload_time": "2014-09-18T06:48:27", "url": "https://files.pythonhosted.org/packages/8e/0a/2b643620ebb90c748f5a9821bf59412a85f4395ebc247a9c6cce0a2b32a2/pyjstat-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "0f85ddba4e6c529c25b0f5209319df2f", "sha256": "fb78dccaf7e21dbf4cd6c6e841368f557b00ff6532cceae6c362461873cdff30" }, "downloads": -1, "filename": "pyjstat-0.1.7.tar.gz", "has_sig": false, "md5_digest": "0f85ddba4e6c529c25b0f5209319df2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 163128, "upload_time": "2015-02-28T22:52:00", "url": "https://files.pythonhosted.org/packages/09/7a/304e2bd26a2f16e19cc1049b974803e1b1716c009a5dc04daaeb2f64443f/pyjstat-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "9dc730257399dfe6b1c772dc588aa513", "sha256": "15358b1a10821cfc76e42843568b25a49aaad3566ef7488f2afdce4cc7317988" }, "downloads": -1, "filename": "pyjstat-0.1.8.tar.gz", "has_sig": false, "md5_digest": "9dc730257399dfe6b1c772dc588aa513", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 164540, "upload_time": "2015-03-02T17:47:39", "url": "https://files.pythonhosted.org/packages/55/61/ee17552716d946d0e861a5f025d37e1c4a47fce4e3f1bc9bfffeaf3759f4/pyjstat-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "4e734fd3e4827397ca47855e9804a96d", "sha256": "d0328fedf48d6255c5c511ce09ee2cb52b660bf868c877a53d35b5dbdaa2dc0d" }, "downloads": -1, "filename": "pyjstat-0.1.9.tar.gz", "has_sig": false, "md5_digest": "4e734fd3e4827397ca47855e9804a96d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 171076, "upload_time": "2015-08-15T19:17:52", "url": "https://files.pythonhosted.org/packages/82/6f/a12f9064216c7d422d95a15ed7353df0c22cca00b4102b72c204e5dbe4ec/pyjstat-0.1.9.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "483baa67068621095183c08a42125009", "sha256": "9a0c2b81d4f0a06b50d9f4b56c49264a053cd864558218cf642900c2053fe258" }, "downloads": -1, "filename": "pyjstat-0.2.0.tar.gz", "has_sig": false, "md5_digest": "483baa67068621095183c08a42125009", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 171466, "upload_time": "2015-08-16T22:01:16", "url": "https://files.pythonhosted.org/packages/dd/70/e4d85503e2afa0d5f76433e893209dddb0a992cc5866402da940ad340138/pyjstat-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "fb358f9beb7b7310dfe689b0ad7da6af", "sha256": "594ee5ddd99cb019871b20601e277ae92ee208b1ad6834a4b745d6bda0835bfd" }, "downloads": -1, "filename": "pyjstat-0.3.0.tar.gz", "has_sig": false, "md5_digest": "fb358f9beb7b7310dfe689b0ad7da6af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 166839, "upload_time": "2015-08-19T22:50:23", "url": "https://files.pythonhosted.org/packages/8f/d3/85d015b85f5aae68c4ed13beeaeb7c946de05313ec53806e9ad74c331721/pyjstat-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "7c65088cf983b42330c5d38fa0e23ec3", "sha256": "026faab9030293ca411cc2a219c0ce0839cea563c525653234f7f854d68907f0" }, "downloads": -1, "filename": "pyjstat-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7c65088cf983b42330c5d38fa0e23ec3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 268198, "upload_time": "2015-09-04T20:31:42", "url": "https://files.pythonhosted.org/packages/86/4d/e2207d45fe35d33268664a21ac492197f04ca773c6c08138ea259705399c/pyjstat-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "e9719c8838c1cb212769abd69b964c5d", "sha256": "02c63206def09f2474792981133a93459bd146eb5d6803e15daa8ee49c76c181" }, "downloads": -1, "filename": "pyjstat-0.3.2.tar.gz", "has_sig": false, "md5_digest": "e9719c8838c1cb212769abd69b964c5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 270005, "upload_time": "2015-11-26T20:16:08", "url": "https://files.pythonhosted.org/packages/9d/0b/caf0570900d6e35ff27e075ed1f5a6a3ad36bd6d1adaee5cf0440d18a95e/pyjstat-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "bc89435ed9eaf8d3f1fcbf6313a1244e", "sha256": "20951e62466423f8f68013f5269ec584a7db82b368b074afaeb501b68c61f382" }, "downloads": -1, "filename": "pyjstat-0.3.3.tar.gz", "has_sig": false, "md5_digest": "bc89435ed9eaf8d3f1fcbf6313a1244e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 687987, "upload_time": "2016-10-02T21:08:52", "url": "https://files.pythonhosted.org/packages/71/19/4aa29384d991881b7fb24120b28bc550b94d9ea88e879cb490045cb23b8e/pyjstat-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "636e915c376dd0ac661bbcef96a292b8", "sha256": "20fe7e4713beb64a32c3275ca65f10b0bc0b4b3e743c005c818a60eda052085f" }, "downloads": -1, "filename": "pyjstat-0.3.4.tar.gz", "has_sig": false, "md5_digest": "636e915c376dd0ac661bbcef96a292b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 688023, "upload_time": "2016-10-02T21:36:11", "url": "https://files.pythonhosted.org/packages/f2/1a/9deb30430c07aa2487fa3817673154389d4f1f978c42f8946aac029b0547/pyjstat-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "dd0b308d93586d245405045afc51a336", "sha256": "93ebd1bd6b4ab2856ca87025b5114eca3b2839f8387b09d24274cd14325f6242" }, "downloads": -1, "filename": "pyjstat-0.3.5.tar.gz", "has_sig": false, "md5_digest": "dd0b308d93586d245405045afc51a336", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 831318, "upload_time": "2016-10-29T19:24:36", "url": "https://files.pythonhosted.org/packages/28/ca/a8a382f99eeeeb50ca553ae80142753150b236074d1f02a02c7e3380a453/pyjstat-0.3.5.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "7ce0bf17d8ec3d28ed8037684ac9c181", "sha256": "d94d288fa51dd99b1ca8012257043dfe65a5964c3de2933cea8eb9abc37a2d2e" }, "downloads": -1, "filename": "pyjstat-1.0.0.tar.gz", "has_sig": false, "md5_digest": "7ce0bf17d8ec3d28ed8037684ac9c181", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 866395, "upload_time": "2017-03-03T21:19:29", "url": "https://files.pythonhosted.org/packages/76/d7/227814d324e01c7cef7e1a34dfb89ee66309dfb69e3af8986c831e6c4e61/pyjstat-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5d0899873bae4649d97d524169f0a746", "sha256": "ebe87fc4e9836da0c54e56dd6110fca6e86f91c73dfdc8364a9eec479d6a5519" }, "downloads": -1, "filename": "pyjstat-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5d0899873bae4649d97d524169f0a746", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 866427, "upload_time": "2017-03-03T21:47:00", "url": "https://files.pythonhosted.org/packages/1e/8e/d1a5f703b4067746d69a9025ab85368845323a51bf5063463619db2297a8/pyjstat-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "8675d3431b9ae92ac3ddca958eff46ba", "sha256": "0e9976698c3ebb067a4b28e89cec3cdf4d19afa5b10f8780b7cfa20f9e4ab72b" }, "downloads": -1, "filename": "pyjstat-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8675d3431b9ae92ac3ddca958eff46ba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18394, "upload_time": "2019-08-20T15:42:38", "url": "https://files.pythonhosted.org/packages/50/cf/dcc5ca12a24bb0c9e28856e352ce3a812759dbb1c8ba0381eaa16d1e4fe4/pyjstat-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b76048d550c116a74ae6e4f821f75e3", "sha256": "d9b4f84ed906b18e8b2a315aa480b01aa04abaa137459fa3797fd3b40b5d2f21" }, "downloads": -1, "filename": "pyjstat-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7b76048d550c116a74ae6e4f821f75e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 863495, "upload_time": "2019-08-20T15:42:40", "url": "https://files.pythonhosted.org/packages/59/61/cdca1b3f2026b22da697b6c6386cd3759da505eb1e6bb2816e298fd3a956/pyjstat-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8675d3431b9ae92ac3ddca958eff46ba", "sha256": "0e9976698c3ebb067a4b28e89cec3cdf4d19afa5b10f8780b7cfa20f9e4ab72b" }, "downloads": -1, "filename": "pyjstat-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8675d3431b9ae92ac3ddca958eff46ba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18394, "upload_time": "2019-08-20T15:42:38", "url": "https://files.pythonhosted.org/packages/50/cf/dcc5ca12a24bb0c9e28856e352ce3a812759dbb1c8ba0381eaa16d1e4fe4/pyjstat-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b76048d550c116a74ae6e4f821f75e3", "sha256": "d9b4f84ed906b18e8b2a315aa480b01aa04abaa137459fa3797fd3b40b5d2f21" }, "downloads": -1, "filename": "pyjstat-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7b76048d550c116a74ae6e4f821f75e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 863495, "upload_time": "2019-08-20T15:42:40", "url": "https://files.pythonhosted.org/packages/59/61/cdca1b3f2026b22da697b6c6386cd3759da505eb1e6bb2816e298fd3a956/pyjstat-1.1.0.tar.gz" } ] }