Skip to main content

Compute continous cartograms (anamorphic maps)

This is a Python package to compute cartograms from geopandas.GeoDataFrames, using the algorithm presented in Dougenik et al. (1985). It is the ‘sister project’ and Python implementation of our QGIS plugin which continues to be available.

Installation

cartogram is available from the PyPi package repository, install it, for instance, using pip:

pip install cartogram

Quick start

Input data

You will need a polygon data set in any format readable by geopandas that features a numeric attribute column to use as the relative target values to base the cartogram distortion on.

If you want to have a quick try-out, see the population data for Austrian provinces in the tests/data directory of this repository.

Cartogram creation

import cartogram
import geopandas

df = geopandas.read_file("input-data.gpkg")
c = cartogram.Cartogram(df, column="population")

c.to_file("output-data.gpkg")

Documentation

Find more detailed examples and an API reference at https://python-cartogram.readthedocs.io/.

Metadata

Release files for cartogram 1.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 cartogram 1.0.2
File Size Uploaded
cartogram-1.0.2.tar.gz 57.3 kB Details

Built distribution (wheel)

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

Total release size: 75.2 kB

Release files / cartogram-1.0.2.tar.gz

Download URL cartogram-1.0.2.tar.gz
Size 57.3 kB
Tags Source
SHA-256 checksum
How to use checksums
81ed9fa1c5b68d9c8cb7b96a9c3676e1830f71e1dc4ca765ce432a37e19b55e8
BLAKE2b-256 checksum
How to use checksums
c5fa133f14f1e6c2ee67192cfa0275949992ce44594cb3972cfc656f969dbf15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.

Transparency log

Release files / cartogram-1.0.2-py3-none-any.whl

Download URL cartogram-1.0.2-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
590a89837d64c5403c3f99cbc977a0585f8dc52d1d0b04822d27ecfc547e4eca
BLAKE2b-256 checksum
How to use checksums
7d9f95a56aadb39c4367fc91e8a0c39272d9b4557ab4ccd3dc9a8c0f72195c1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

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