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.1

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.1
File Size Uploaded
cartograpy-3.0.1.tar.gz 248.8 kB Details

Built distribution (wheel)

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

Total release size: 480.3 kB

Release files / cartograpy-3.0.1.tar.gz

Download URL cartograpy-3.0.1.tar.gz
Size 248.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9eeb93e53df3a7e48dcfb6c085dcee901a86691b93f2c9a9c4c65950df74ee22
BLAKE2b-256 checksum
How to use checksums
98f4e3d74ad124eb311c50103b38427959bff458bc6844573de12092c69322f2
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.1-py3-none-any.whl

Download URL cartograpy-3.0.1-py3-none-any.whl
Size 231.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30cf5a8f790fedc0e4ddbb641e33eb963a455fb0db01bb220fa42d372cf1b29c
BLAKE2b-256 checksum
How to use checksums
0b7062b2b231e58c90dffc692243d33a56cf7058a028f2615db28c9e9a7793c8
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

This release

3.0.1 This release

2 release files

3.0.0

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