{ "info": { "author": "Michael Delgado", "author_email": "delgado.michaelt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "======\nxshape\n======\n\n\n.. image:: https://img.shields.io/pypi/v/xshape.svg\n :target: https://pypi.python.org/pypi/xshape\n\n.. image:: https://img.shields.io/travis/ClimateImpactLab/xshape.svg\n :target: https://travis-ci.org/ClimateImpactLab/xshape\n\n.. image:: https://readthedocs.org/projects/xshape/badge/?version=latest\n :target: https://xshape.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/ClimateImpactLab/xshape/shield.svg\n :target: https://pyup.io/repos/github/ClimateImpactLab/xshape/\n :alt: Updates\n\n\nTools for working with shapefiles, topographies, and polygons in xarray\n\n\n* Free software: MIT license\n* Documentation: https://xshape.readthedocs.io.\n\n\nFeatures\n--------\n\n* Read a shapefile and obtain an xarray DataArray of field records\n* Draw shapefile boundaries on gridded data\n* Plot xarray DataArray data indexed by shapefile records as a choropleth\n\nUsage\n-----\n\nGetting records for fields in a shapefile\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n In [1]: import xshape\n\n In [2]: fields, polygons = xshape.parse_shapefile(\n ...: 'tests/data/shapefiles/CA_counties/CA_counties',\n ...: encoding='latin1')\n\n In [3]: fields\n Out[3]: \n \n Dimensions: (shape: 58)\n Coordinates:\n * shape (shape) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...\n Data variables:\n STATEFP (shape) 0)].copy()\n ...: ca['fips'] = df['STATE'] * 1000 + df['COUNTY']\n ...: da = ca.set_index(['fips'])['POPESTIMATE2016'].to_xarray()\n ...: da.coords['GEOID'] = ('fips', ), list(map('{:05}'.format, da.fips.values))\n ...: da = da.swap_dims({'fips': 'GEOID'})\n\n In [9]: da.xshape.plot(\n ...: 'tests/data/shapefiles/CA_counties/CA_counties',\n ...: encoding='latin1',\n ...: cmap='YlGnBu');\n ...:\n\n.. figure:: docs/images/california_map_pop.png\n\nWe can also combine the information from the fields with the data contained in the DataArray:\n\n.. code-block:: python\n\n In [10]: land_area = (\n ....: fields\n ....: .set_coords('GEOID')\n ....: .swap_dims({'shape': 'GEOID'})\n ....: .ALAND.astype(float))\n\n In [11]: np.log(da / land_area).xshape.plot(\n ....: 'tests/data/shapefiles/CA_counties/CA_counties',\n ....: encoding='latin1',\n ....: cmap='YlGnBu');\n ....:\n\n.. figure:: docs/images/california_map_pop_per_m2.png\n\nTODO\n----\n\n* Use shapefiles to reshape gridded/pixel data\n\n\n=======\nHistory\n=======\n\n0.1.0 (2018-01-13)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.python.org/pypi", "keywords": "xshape", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "xshape", "package_url": "https://pypi.org/project/xshape/", "platform": "", "project_url": "https://pypi.org/project/xshape/", "project_urls": { "Homepage": "https://pypi.python.org/pypi" }, "release_url": "https://pypi.org/project/xshape/0.1.1/", "requires_dist": [ "Click (>=6.0)", "pyshp", "xarray", "numpy", "pandas", "matplotlib" ], "requires_python": "", "summary": "Tools for working with shapefiles, topographies, and polygons in xarray", "version": "0.1.1" }, "last_serial": 3525451, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "21c991a7cd697586afdc39f56207a154", "sha256": "adce4b94ddeb2262b8e815096cb6f55ce2b621ad51c6f7a2d62bc59a23e31b95" }, "downloads": -1, "filename": "xshape-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "21c991a7cd697586afdc39f56207a154", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8975, "upload_time": "2018-01-16T03:02:41", "url": "https://files.pythonhosted.org/packages/22/11/58d87bf6fb9354e55ca6c2d4df48febd85adeb0af034ceeea7165c5a8a4b/xshape-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a1a1bafeac501ebebb02071ee5a328d", "sha256": "c0aa766d233e8f9dfe54fe0cf8597c8d8baed6d1b4c6bbcd921546a3370bcbff" }, "downloads": -1, "filename": "xshape-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9a1a1bafeac501ebebb02071ee5a328d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3002892, "upload_time": "2018-01-16T03:02:55", "url": "https://files.pythonhosted.org/packages/58/62/750a9360fb9ca6d74501e8e9116b3267f6a7c4528f099664e42d1250ed61/xshape-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "917a63a71f038d82ed8aad1183b39f27", "sha256": "0139de2b25e1b74dfab9867776e355b02a24155c511ca53554703b1787192cf2" }, "downloads": -1, "filename": "xshape-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "917a63a71f038d82ed8aad1183b39f27", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8962, "upload_time": "2018-01-26T22:30:41", "url": "https://files.pythonhosted.org/packages/97/d8/00e17177ba152d832c7a043a498bd6e12a1555b7b843271c98d888fd5770/xshape-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "022dfafeb1937c01440a36e1b10cba46", "sha256": "a7eb34e55fe8aeb31ece1dd6a679b2bdb4ebe1dd0427e3138220373ea5f56c18" }, "downloads": -1, "filename": "xshape-0.1.1.tar.gz", "has_sig": false, "md5_digest": "022dfafeb1937c01440a36e1b10cba46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3002994, "upload_time": "2018-01-26T22:30:55", "url": "https://files.pythonhosted.org/packages/32/bc/5508489663182c16ebbc7ddec6f20e478345a67f8e017fd73938058d77ed/xshape-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "917a63a71f038d82ed8aad1183b39f27", "sha256": "0139de2b25e1b74dfab9867776e355b02a24155c511ca53554703b1787192cf2" }, "downloads": -1, "filename": "xshape-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "917a63a71f038d82ed8aad1183b39f27", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8962, "upload_time": "2018-01-26T22:30:41", "url": "https://files.pythonhosted.org/packages/97/d8/00e17177ba152d832c7a043a498bd6e12a1555b7b843271c98d888fd5770/xshape-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "022dfafeb1937c01440a36e1b10cba46", "sha256": "a7eb34e55fe8aeb31ece1dd6a679b2bdb4ebe1dd0427e3138220373ea5f56c18" }, "downloads": -1, "filename": "xshape-0.1.1.tar.gz", "has_sig": false, "md5_digest": "022dfafeb1937c01440a36e1b10cba46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3002994, "upload_time": "2018-01-26T22:30:55", "url": "https://files.pythonhosted.org/packages/32/bc/5508489663182c16ebbc7ddec6f20e478345a67f8e017fd73938058d77ed/xshape-0.1.1.tar.gz" } ] }