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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cartogram-1.0.2.tar.gz | 57.3 kB | With provenance | Details for cartogram-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cartogram-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for cartogram-1.0.2-py3-none-any.whl |
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 logRelease 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 logSecurity for cartogram 1.0.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cartogram-1.0.2.tar.gz
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 logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.