Metadata-Version: 2.4
Name: cartograpy
Version: 3.0.1
Summary: Python package to create maps easily
Author-email: Anicet Cyrille KAMBOU <kanicetcyrille@gmail.com>
License: MIT License
        
        Copyright (c) 2025 mr-kam
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://mr-kam.github.io/cartograpy/
Project-URL: Repository, https://github.com/mr-kam/cartograpy
Project-URL: Documentation, https://mr-kam.github.io/cartograpy/
Project-URL: Bug Tracker, https://github.com/mr-kam/cartograpy/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cartopy>=0.23
Requires-Dist: click>=8.0
Requires-Dist: drawarrow>=0.1
Requires-Dist: geopandas>=0.14
Requires-Dist: geojson>=3.0
Requires-Dist: geopy>=2.4
Requires-Dist: highlight-text>=0.2
Requires-Dist: matplotlib>=3.8
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.1
Requires-Dist: pillow>=10.0
Requires-Dist: pypalettes>=0.1
Requires-Dist: pyproj>=3.6
Requires-Dist: rasterio>=1.3
Requires-Dist: reportlab>=4.0
Requires-Dist: rlPyCairo>=0.4
Requires-Dist: requests>=2.31
Requires-Dist: requests-cache>=1.1
Requires-Dist: scipy>=1.11
Requires-Dist: seaborn>=0.13
Requires-Dist: shapely>=2.0
Requires-Dist: svglib>=1.5
Requires-Dist: tqdm>=4.66
Requires-Dist: matplotlib-map-utils==3.1.2
Requires-Dist: pyfonts>=1.3.0
Requires-Dist: scienceplots>=2.1
Requires-Dist: mplcyberpunk>=0.7
Requires-Dist: geohexgrid>=3.0
Provides-Extra: osm
Requires-Dist: osmnx>=1.9; extra == "osm"
Provides-Extra: worldbank
Requires-Dist: wbdata>=1.0; extra == "worldbank"
Provides-Extra: gee
Requires-Dist: earthengine-api>=1.0; extra == "gee"
Requires-Dist: geemap>=0.37.2; extra == "gee"
Provides-Extra: stac
Requires-Dist: pystac-client>=0.8; extra == "stac"
Requires-Dist: planetary-computer>=1.0; extra == "stac"
Provides-Extra: all
Requires-Dist: cartograpy[gee,osm,stac,webmap,worldbank]; extra == "all"
Provides-Extra: notebook
Requires-Dist: jupyter>=1.1.1; extra == "notebook"
Provides-Extra: webmap
Requires-Dist: folium>=0.15; extra == "webmap"
Requires-Dist: lonboard>=0.9; extra == "webmap"
Requires-Dist: keplergl>=0.3.2; extra == "webmap"
Requires-Dist: rio-tiler>=6.0; extra == "webmap"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: jupyterlab>=4.0.0; extra == "dev"
Dynamic: license-file

<img src="https://raw.githubusercontent.com/Mr-KAM/cartograpy/master/assets/img/logo.png" alt="cartograpy logo" width="220">

# cartograpy

[![PyPI](https://img.shields.io/pypi/v/cartograpy.svg)](https://pypi.org/project/cartograpy/)
[![Python](https://img.shields.io/pypi/pyversions/cartograpy.svg)](https://pypi.org/project/cartograpy/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Mr-KAM/cartograpy/blob/master/LICENSE)
[![Docs](https://img.shields.io/badge/docs-mr--kam.github.io-blue.svg)](https://mr-kam.github.io/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.

![Example map produced with cartograpy](https://raw.githubusercontent.com/Mr-KAM/cartograpy/master/assets/img/create_python_maps.py.png)

## 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

```bash
pip install cartograpy
```

> [!NOTE]
> Python 3.11+. Use a virtual environment to avoid dependency conflicts
> (`venv`, `conda`, `uv`…). On Windows, if the GDAL/GEOS/PROJ installation
> fails, install `geopandas rasterio cartopy` via `conda-forge` before
> `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 | |

```bash
pip install cartograpy[osm,stac]   # or cartograpy[all]
```

## How it works

![Flow: sources → data → processing → mapper → final map](https://mermaid.ink/svg/Zmxvd2NoYXJ0IExSCiAgICBTWyJTb3VyY2VzPGJyLz5sb2NhbCBmaWxlcyDCtyBHZW9Cb3VuZGFyaWVzIMK3IE9TTTxici8-SHlkcm8gwrcgU1JUTSDCtyBXb3JsZCBCYW5rIMK3IEdFRSDCtyBTVEFDIl0gLS0-IERbImNhcnRvZ3JhcHkuZGF0YSJdCiAgICBEIC0tPnwiR2VvRGF0YUZyYW1lIC8gRGF0YUZyYW1lInwgUFsiY2FydG9ncmFweS5wcm9jZXNzaW5nIl0KICAgIFAgLS0-IE1bImNhcnRvZ3JhcHkubWFwcGVyIl0KICAgIFNUWyJjYXJ0b2dyYXB5LnN0eWxpbmciXSAtLi0-IE0KICAgIE0gLS0-IE9bIkZpbmFsIG1hcDxici8-UE5HIMK3IFNWRyDCtyBIVE1MIl0)



## Quick start

```python
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:

```bash
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](https://mermaid.ink/svg/Z3JhcGggVEQKICAgIEFbImNhcnRvZ3JhcHkiXSAtLT4gRFsiZGF0YTxici8-PGk-bG9hZC9zYXZlLCBvbmxpbmUgc291cmNlczwvaT4iXQogICAgQSAtLT4gUFsicHJvY2Vzc2luZzxici8-PGk-dmVjdG9yIGFuZCByYXN0ZXIgcHJvY2Vzc2luZzwvaT4iXQogICAgQSAtLT4gTVsibWFwcGVyPGJyLz48aT5zdGF0aWMgYW5kIHdlYiBtYXAgcmVuZGVyaW5nPC9pPiJdCiAgICBBIC0tPiBTWyJzdHlsaW5nPGJyLz48aT5mb250cywgcGFsZXR0ZXMsIGdyYXBoaWMgc3R5bGVzPC9pPiJdCiAgICBBIC0tPiBQUlsicHJvamVjdDxici8-PGk-Y2FydG9ncmFwaGljIHByb2plY3Qgb3JnYW5pemF0aW9uPC9pPiJd)


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](https://mr-kam.github.io/cartograpy/)**.

For an interactive tour of all the features, see the notebooks folder
[`notebooks/`](https://github.com/Mr-KAM/cartograpy/blob/master/notebooks/).

## License

MIT: see [`LICENSE`](https://github.com/Mr-KAM/cartograpy/blob/master/LICENSE).
