Skip to main content

Spatial data examples

Project description

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.

Install

From PyPI:

pip install geodatasets

or using conda or mamba from conda-forge:

conda install geodatasets -c conda-forge

The development version can be installed using pip from GitHub.

pip install git+https://github.com/geopandas/geodatasets.git

How to use

The package comes with a database of datasets. To see all:

In [1]: import geodatasets

In [2]: geodatasets.data
Out[2]:
{'geoda': {'airbnb': {'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
   'license': 'CC-0',
   'attribution': 'GeoDa Data and Lab',
   'name': 'geoda.airbnb',
   'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
   'nrows': 77,
   'ncols': 20,
   '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': 'CC-0',
   'attribution': 'GeoDa Data and Lab',
   'name': 'geoda.atlanta',
   'description': 'Atlanta, GA region homicide counts and rates',
   'nrows': 90,
   'ncols': 23,
   'details': 'https://geodacenter.github.io/data-and-lab//atlanta_old/',
   'hash': 'missing',
   'filename': 'atlanta_hom.zip'},
   ...

There is also convenient top-level API. One to get only the URL:

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.

Out[4]: '/Users/martin/Library/Caches/geodatasets/airbnb.zip'
In [4]: geodatasets.get_path('geoda airbnb')

You can also get all the details:

In [5]: geodatasets.data.geoda.airbnb
Out[5]:
{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
 'license': 'CC-0',
 'attribution': 'GeoDa Data and Lab',
 'name': 'geoda.airbnb',
 'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
 'nrows': 77,
 'ncols': 20,
 'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
 'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
 'filename': 'airbnb.zip'}

Or using the name query:

In [6]: geodatasets.data.query_name('geoda airbnb')
Out[6]:
{'url': 'https://geodacenter.github.io/data-and-lab//data/airbnb.zip',
 'license': 'CC-0',
 'attribution': 'GeoDa Data and Lab',
 'name': 'geoda.airbnb',
 'description': 'Airbnb rentals, socioeconomics, and crime in Chicago',
 'nrows': 77,
 'ncols': 20,
 'details': 'https://geodacenter.github.io/data-and-lab//airbnb/',
 'hash': 'a2ab1e3f938226d287dd76cde18c00e2d3a260640dd826da7131827d9e76c824',
 'filename': 'airbnb.zip'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geodatasets-2023.1.0b2.tar.gz (456.4 kB view details)

Uploaded Source

Built Distribution

geodatasets-2023.1.0b2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file geodatasets-2023.1.0b2.tar.gz.

File metadata

  • Download URL: geodatasets-2023.1.0b2.tar.gz
  • Upload date:
  • Size: 456.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for geodatasets-2023.1.0b2.tar.gz
Algorithm Hash digest
SHA256 6866b358b1c98dc5abf6f247f21781477b0b59e03051a95fc0d4c2b1a9fda8ca
MD5 64f8d7882ea0674b0ed205945da2c5b7
BLAKE2b-256 00100121918034d0b846e855b3e5018eee02b076d615e889629e318b1c0ce695

See more details on using hashes here.

File details

Details for the file geodatasets-2023.1.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for geodatasets-2023.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1941136be1319a57a5dd88fb2655d1256ac4e0fab1a3a44381c427875e0b1f2
MD5 31e9a2248bc85b1a73787fee3b6387f2
BLAKE2b-256 578ba80e8f6b33da231da3f6e120aa04f4e2787628c3aa2566d07fb533425352

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page