Skip to main content

A simple loader for Natural Earth map data.

Project description

NE Loader

CI

A simple, robust Python package to download and load Natural Earth map data using GeoPandas.

Features

  • Download and cache Natural Earth datasets
  • Load shapefiles as GeoDataFrames

Installation

pip install ne-loader

Usage

from ne_loader import map_loader
world = map_loader.get_natural_earth('cultural', 'admin_0_countries')

Errors are raised by default. To return the caught exception instead:

result = map_loader.get_natural_earth(
    'cultural',
    'admin_0_countries',
    error_mode='return',
)

CLI

ne-loader --help

To set an environment override for the NE data save path:

export NATURAL_EARTH_CACHE_DIR="..."

Some commands include:
List cached datasets.

ne-loader list

Query where the cached datasets are.
If you change NATURAL_EARTH_CACHE_DIR, the command shows the active cache path for the current environment.

ne-loader where

Download a Natural Earth Dataset. Default resolution is 10m.

ne-loader download {category} {name} --res {res}

Example usage to download 10m_admin_0_countries

ne-loader download cultural admin_0_countries

Delete either one dataset or all, from current cache directory.

ne-loader rm {dataset}
# or
ne-loader rm --all

Tests

python3 -m pytest tests

License

MIT

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

ne_loader-0.4.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ne_loader-0.4.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file ne_loader-0.4.1.tar.gz.

File metadata

  • Download URL: ne_loader-0.4.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ne_loader-0.4.1.tar.gz
Algorithm Hash digest
SHA256 3bc79140cdb71b813605ac80713c82f0642c90832bb16c937071320f842842ef
MD5 cba01647b3a72e44310db6017302c4d4
BLAKE2b-256 609270645e51630301c2351072a0595693d1aaeef72172e1beea25bee902bf7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ne_loader-0.4.1.tar.gz:

Publisher: publish.yml on erictunn/ne-loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ne_loader-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ne_loader-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ne_loader-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 111e55e2953db2a201fdf575c784975e3b4d25678413ac0652376b4d581c7395
MD5 dc767f78e6f6f7baa0e96775ad103806
BLAKE2b-256 96f220cf8011a2850ce7269378afd7207317dc8c06022751d105db6259fa7417

See more details on using hashes here.

Provenance

The following attestation bundles were made for ne_loader-0.4.1-py3-none-any.whl:

Publisher: publish.yml on erictunn/ne-loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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