Skip to main content
cartograpy logo

cartograpy

PyPI Python License: MIT Docs

Mapping in Python, the way it was always meant to be.

Cartograpy is a Python package for loading, processing, and mapping geographic data in a few lines of code: from a country's administrative boundaries to the final static map, ready to export, anywhere in the world.

Example map produced with cartograpy

Features

  • Data: download administrative boundaries (GeoBoundaries), OpenStreetMap data, hydrography, geocoding, elevation (SRTM), World Bank indicators, weather/climate series (NASA POWER), Google Earth Engine imagery, or STAC catalogs (Planetary Computer, AWS Earth Search…) in one line; results returned as GeoDataFrame/DataFrame/RasterTools.
  • Processing: import/export all common formats (Shapefile, GeoJSON, KML, GPX, GPKG, CSV, Parquet…), reproject, clip, merge, compute centroids, joins, and dynamic attributes (VectorTools, RasterTools); automatic UTM projection for accurate metric distances/areas, lazy/windowed raster loading for large files.
  • Mapping: choropleth, point, polygon, raster, bivariate, or hexbin maps with the Map class (north arrow, scale bar, situation inset map, legends, graticule, PNG/SVG export); publication-ready multi-panel plates (Layout); interactive web maps (WebMap, Folium/lonboard/kepler.gl engines).
  • Styling: Google Fonts, 16 built-in palettes + seaborn/matplotlib, graphic styles (scienceplots, mplcyberpunk).
  • Project: Project structures folders and outputs, tracks the CRS, and validates dataset integrity.
  • CLI: a cartograpy command (init, fetch, inspect, convert, map, doctor) for common tasks without writing a Python script.

Installation

pip install cartograpy

Online data sources and web maps are optional extras:

Extra Enables Installs
osm OSM, OSM geocoding helpers osmnx
worldbank WorldBank wbdata
gee Gee (Google Earth Engine) earthengine-api, geemap
stac STAC catalogs (Planetary Computer…) pystac-client, planetary-computer
webmap WebMap folium, lonboard, keplergl, rio-tiler
all everything above
pip install cartograpy[osm,stac]   # or cartograpy[all]

How it works

Flow: sources → data → processing → mapper → final map

Quick start

from cartograpy.data import Bound
from cartograpy.mapper import Map

bound = Bound()
civ = bound.get_admin("CIV", adm=0)          # national boundaries, via GeoBoundaries

m = Map(title="Côte d'Ivoire")
m.add_polygons(civ, facecolor="lightyellow", edge_color="black", alpha=1)
m.add_north_arrow()
m.add_scale_bar()
m.show()

m.save("cote-divoire.png", dpi=300)          # print-ready export

Command line

Common tasks without writing Python, via the cartograpy command installed with the package:

cartograpy init mon_projet
cartograpy fetch boundary CIV --adm 2
cartograpy map regions.gpkg --column population -o map.png
cartograpy doctor        # check Python, GDAL/PROJ/GEOS, core and optional deps

The modules

The modules: data, processing, mapper, styling, project

Everything is importable from the root (from cartograpy import Map, Bound, Project) or from each submodule.

Going further

Full documentation (API reference, step-by-step guides, gallery) is available at mr-kam.github.io/cartograpy.

For an interactive tour of all the features, see the notebooks folder notebooks/.

License

MIT: see LICENSE.

Metadata

Release files for cartograpy 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cartograpy 3.0.0
File Size Uploaded
cartograpy-3.0.0.tar.gz 248.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cartograpy 3.0.0
File Interpreter ABI Platform
cartograpy-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 480.4 kB

Release files / cartograpy-3.0.0.tar.gz

Download URL cartograpy-3.0.0.tar.gz
Size 248.8 kB
Tags Source
SHA-256 checksum
How to use checksums
37e3e3ee070417fd4ca499fcc1b642cc3d362b7c4f5ed6af0ad380355dc44ffc
BLAKE2b-256 checksum
How to use checksums
aebd9513d23f40175ce81e66fd3e38e8e3d383f5927b6bde7c00503580705b91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / cartograpy-3.0.0-py3-none-any.whl

Download URL cartograpy-3.0.0-py3-none-any.whl
Size 231.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
733efae788263ecd66b39e3ebe13adce7871d7acfebae277f855d5e859b1395a
BLAKE2b-256 checksum
How to use checksums
20ca82245e187bbbce4b07c3c85f7262c6e0c3ca20a2ca2bc7ccbe89d9078eca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

3.0.1

2 release files

This release

3.0.0 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page