Name | geodatasets JSON |
Version |
2024.8.0
JSON |
| download |
home_page | None |
Summary | Spatial data examples |
upload_time | 2024-08-30 14:35:31 |
maintainer | geodatasets contributors |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | BSD 3-Clause |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# geodatasets
Fetch links or download and cache spatial data example files.
The `geodatasets` contains an API on top of a JSON with metadata of externally hosted
datasets containing geospatial information useful for illustrative and educational
purposes.
See the documentation at [geodatasets.readthedocs.io/](https://geodatasets.readthedocs.io/).
## Install
From PyPI:
```sh
pip install geodatasets
```
or using `conda` or `mamba` from conda-forge:
```sh
conda install geodatasets -c conda-forge
```
The development version can be installed using `pip` from GitHub.
```sh
pip install git+https://github.com/geopandas/geodatasets.git
```
## How to use
The package comes with a database of datasets. To see all:
```py
In [1]: import geodatasets
In [2]: geodatasets.data
Out[2]:
{'geoda': {'airbnb': {'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.airbnb',
'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
'geometry_type': 'Polygon',
'nrows': 77,
'ncols': 21,
'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
'filename': 'airbnb.zip'},
'atlanta': {'url': 'https://geodacenter.github.io/data-and-lab//data/atlanta_hom.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.atlanta',
'description': 'Atlanta, GA region homicide counts and rates',
'geometry_type': 'Polygon',
'nrows': 90,
'ncols': 24,
'details': 'https://geodacenter.github.io/data-and-lab//atlanta_old/',
'hash': 'a33a76e12168fe84361e60c88a9df4856730487305846c559715c89b1a2b5e09',
'filename': 'atlanta_hom.zip',
'members': ['atlanta_hom/atl_hom.geojson']},
...
```
There is also a convenient top-level API. One to get only the URL:
```py
In [3]: geodatasets.get_url("geoda airbnb")
Out[3]: 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip'
```
And one to get the local path. If the file is not available in the cache, it will be
downloaded first.
```py
In [4]: geodatasets.get_path('geoda airbnb')
Out[4]: '/Users/martin/Library/Caches/geodatasets/airbnb.zip'
```
You can also get all the details:
```py
In [5]: geodatasets.data.geoda.airbnb
Out[5]:
{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.airbnb',
'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
'geometry_type': 'Polygon',
'nrows': 77,
'ncols': 21,
'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
'filename': 'airbnb.zip'}
```
Or using the name query:
```py
In [6]: geodatasets.data.query_name('geoda airbnb')
Out[6]:
{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
'license': 'NA',
'attribution': 'Center for Spatial Data Science, University of Chicago',
'name': 'geoda.airbnb',
'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
'geometry_type': 'Polygon',
'nrows': 77,
'ncols': 21,
'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
'filename': 'airbnb.zip'}
```
The whole structure `Bunch` class is based on a dictionary and can be flattened. If you want
to see all available datasets, you can use:
```py
In [7]: geodatasets.data.flatten().keys()
Out[7]: dict_keys(['geoda.airbnb', 'geoda.atlanta', 'geoda.cars', 'geoda.charleston1', 'geoda.charleston2', 'geoda.chicago_health', 'geoda.chicago_commpop', 'geoda.chile_labor', 'geoda.cincinnati', 'geoda.cleveland', 'geoda.columbus', 'geoda.grid100', 'geoda.groceries', 'geoda.guerry', 'geoda.health', 'geoda.health_indicators', 'geoda.hickory1', 'geoda.hickory2', 'geoda.home_sales', 'geoda.houston', 'geoda.juvenile', 'geoda.lansing1', 'geoda.lansing2', 'geoda.lasrosas', 'geoda.liquor_stores', 'geoda.malaria', 'geoda.milwaukee1', 'geoda.milwaukee2', 'geoda.ncovr', 'geoda.natregimes', 'geoda.ndvi', 'geoda.nepal', 'geoda.nyc', 'geoda.nyc_earnings', 'geoda.nyc_education', 'geoda.nyc_neighborhoods', 'geoda.orlando1', 'geoda.orlando2', 'geoda.oz9799', 'geoda.phoenix_acs', 'geoda.police', 'geoda.sacramento1', 'geoda.sacramento2', 'geoda.savannah1', 'geoda.savannah2', 'geoda.seattle1', 'geoda.seattle2', 'geoda.sids', 'geoda.sids2', 'geoda.south', 'geoda.spirals', 'geoda.stlouis', 'geoda.tampa1', 'geoda.us_sdoh', 'ny.bb', 'eea.large_rivers', 'naturalearth.land'])
```
Raw data
{
"_id": null,
"home_page": null,
"name": "geodatasets",
"maintainer": "geodatasets contributors",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Martin Fleischmann <martin@martinfleischmann.net>",
"download_url": "https://files.pythonhosted.org/packages/c5/19/37a772bf09a9758eb1c09ed9ad6a11dcf0435dadd89bc46e3f78d709f353/geodatasets-2024.8.0.tar.gz",
"platform": null,
"description": "# geodatasets\n\nFetch links or download and cache spatial data example files.\n\nThe `geodatasets` contains an API on top of a JSON with metadata of externally hosted\ndatasets containing geospatial information useful for illustrative and educational\npurposes.\n\nSee the documentation at [geodatasets.readthedocs.io/](https://geodatasets.readthedocs.io/).\n\n## Install\n\nFrom PyPI:\n\n```sh\npip install geodatasets\n```\n\nor using `conda` or `mamba` from conda-forge:\n\n```sh\nconda install geodatasets -c conda-forge\n```\n\nThe development version can be installed using `pip` from GitHub.\n\n```sh\npip install git+https://github.com/geopandas/geodatasets.git\n```\n\n## How to use\n\nThe package comes with a database of datasets. To see all:\n\n```py\nIn [1]: import geodatasets\n\nIn [2]: geodatasets.data\nOut[2]:\n{'geoda': {'airbnb': {'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',\n 'license': 'NA',\n 'attribution': 'Center for Spatial Data Science, University of Chicago',\n 'name': 'geoda.airbnb',\n 'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',\n 'geometry_type': 'Polygon',\n 'nrows': 77,\n 'ncols': 21,\n 'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',\n 'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',\n 'filename': 'airbnb.zip'},\n 'atlanta': {'url': 'https://geodacenter.github.io/data-and-lab//data/atlanta_hom.zip',\n 'license': 'NA',\n 'attribution': 'Center for Spatial Data Science, University of Chicago',\n 'name': 'geoda.atlanta',\n 'description': 'Atlanta, GA region homicide counts and rates',\n 'geometry_type': 'Polygon',\n 'nrows': 90,\n 'ncols': 24,\n 'details': 'https://geodacenter.github.io/data-and-lab//atlanta_old/',\n 'hash': 'a33a76e12168fe84361e60c88a9df4856730487305846c559715c89b1a2b5e09',\n 'filename': 'atlanta_hom.zip',\n 'members': ['atlanta_hom/atl_hom.geojson']},\n ...\n```\n\nThere is also a convenient top-level API. One to get only the URL:\n\n```py\nIn [3]: geodatasets.get_url(\"geoda airbnb\")\nOut[3]: 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip'\n```\n\nAnd one to get the local path. If the file is not available in the cache, it will be\ndownloaded first.\n\n```py\nIn [4]: geodatasets.get_path('geoda airbnb')\nOut[4]: '/Users/martin/Library/Caches/geodatasets/airbnb.zip'\n```\n\nYou can also get all the details:\n\n```py\nIn [5]: geodatasets.data.geoda.airbnb\nOut[5]:\n{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',\n 'license': 'NA',\n 'attribution': 'Center for Spatial Data Science, University of Chicago',\n 'name': 'geoda.airbnb',\n 'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',\n 'geometry_type': 'Polygon',\n 'nrows': 77,\n 'ncols': 21,\n 'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',\n 'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',\n 'filename': 'airbnb.zip'}\n```\n\nOr using the name query:\n\n```py\nIn [6]: geodatasets.data.query_name('geoda airbnb')\nOut[6]:\n{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',\n 'license': 'NA',\n 'attribution': 'Center for Spatial Data Science, University of Chicago',\n 'name': 'geoda.airbnb',\n 'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',\n 'geometry_type': 'Polygon',\n 'nrows': 77,\n 'ncols': 21,\n 'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',\n 'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',\n 'filename': 'airbnb.zip'}\n```\n\nThe whole structure `Bunch` class is based on a dictionary and can be flattened. If you want\nto see all available datasets, you can use:\n\n```py\nIn [7]: geodatasets.data.flatten().keys()\nOut[7]: dict_keys(['geoda.airbnb', 'geoda.atlanta', 'geoda.cars', 'geoda.charleston1', 'geoda.charleston2', 'geoda.chicago_health', 'geoda.chicago_commpop', 'geoda.chile_labor', 'geoda.cincinnati', 'geoda.cleveland', 'geoda.columbus', 'geoda.grid100', 'geoda.groceries', 'geoda.guerry', 'geoda.health', 'geoda.health_indicators', 'geoda.hickory1', 'geoda.hickory2', 'geoda.home_sales', 'geoda.houston', 'geoda.juvenile', 'geoda.lansing1', 'geoda.lansing2', 'geoda.lasrosas', 'geoda.liquor_stores', 'geoda.malaria', 'geoda.milwaukee1', 'geoda.milwaukee2', 'geoda.ncovr', 'geoda.natregimes', 'geoda.ndvi', 'geoda.nepal', 'geoda.nyc', 'geoda.nyc_earnings', 'geoda.nyc_education', 'geoda.nyc_neighborhoods', 'geoda.orlando1', 'geoda.orlando2', 'geoda.oz9799', 'geoda.phoenix_acs', 'geoda.police', 'geoda.sacramento1', 'geoda.sacramento2', 'geoda.savannah1', 'geoda.savannah2', 'geoda.seattle1', 'geoda.seattle2', 'geoda.sids', 'geoda.sids2', 'geoda.south', 'geoda.spirals', 'geoda.stlouis', 'geoda.tampa1', 'geoda.us_sdoh', 'ny.bb', 'eea.large_rivers', 'naturalearth.land'])\n```\n",
"bugtrack_url": null,
"license": "BSD 3-Clause",
"summary": "Spatial data examples",
"version": "2024.8.0",
"project_urls": {
"Home": "https://github.com/geopandas/geodatasets",
"Repository": "https://github.com/geopandas/geodatasets"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ddde30e144271280d263c0c10f34fbcf2e09e9a82bd11a165c5f1f498899a29",
"md5": "12e1251d515c2540f5ef1c41bfb35e4f",
"sha256": "fd2a91618277553dbb180496bb952d496e4bc99e8c0066c5dc06701d66d53540"
},
"downloads": -1,
"filename": "geodatasets-2024.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "12e1251d515c2540f5ef1c41bfb35e4f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20029,
"upload_time": "2024-08-30T14:35:29",
"upload_time_iso_8601": "2024-08-30T14:35:29.822482Z",
"url": "https://files.pythonhosted.org/packages/9d/dd/e30e144271280d263c0c10f34fbcf2e09e9a82bd11a165c5f1f498899a29/geodatasets-2024.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c51937a772bf09a9758eb1c09ed9ad6a11dcf0435dadd89bc46e3f78d709f353",
"md5": "809608a9a8deb0fc9edc0f20bf284117",
"sha256": "ea1b0f885f1b3305d4a308b2ddee042e425c5288b5ff6b00e6b0ac74a4d5e8d9"
},
"downloads": -1,
"filename": "geodatasets-2024.8.0.tar.gz",
"has_sig": false,
"md5_digest": "809608a9a8deb0fc9edc0f20bf284117",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 457760,
"upload_time": "2024-08-30T14:35:31",
"upload_time_iso_8601": "2024-08-30T14:35:31.198714Z",
"url": "https://files.pythonhosted.org/packages/c5/19/37a772bf09a9758eb1c09ed9ad6a11dcf0435dadd89bc46e3f78d709f353/geodatasets-2024.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-30 14:35:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "geopandas",
"github_project": "geodatasets",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "geodatasets"
}