cartograpy
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.
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 asGeoDataFrame/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
Mapclass (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:
Projectstructures folders and outputs, tracks the CRS, and validates dataset integrity. - CLI: a
cartograpycommand (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
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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| cartograpy-3.0.1.tar.gz | 248.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|