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, pyarrow, keplergl (Python < 3.13), 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.2

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.2
File Size Uploaded
cartograpy-3.0.2.tar.gz 249.0 kB Details

Built distribution (wheel)

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

Total release size: 480.6 kB

Release files / cartograpy-3.0.2.tar.gz

Download URL cartograpy-3.0.2.tar.gz
Size 249.0 kB
Tags Source
SHA-256 checksum
How to use checksums
77b441eed04617b158ff2bb533b819af7bc58f13083bc487f3ef62dd75ff959e
BLAKE2b-256 checksum
How to use checksums
29c95c6a7d75bd53d198b8413ecc7ee6024dec59c05aa379918211953396ea8d
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.2-py3-none-any.whl

Download URL cartograpy-3.0.2-py3-none-any.whl
Size 231.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9508fa0192661078efd709a050d29e2627a7fdfedf9c7ec9a7b7f5411529f04d
BLAKE2b-256 checksum
How to use checksums
7571898390bf00c6d25c9e8920dd9f5c336c74a085658f7ad3a0aebacef03e4e
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.2 This release

2 release files

3.0.1

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