contextily
Context geo-tiles in Python
Decision gist · record as of 2026-08-14
Yes. Contextily is actively maintained, has no known vulnerabilities, low install friction, and solves a common need in geospatial Python workflows. If you work with matplotlib and geographic data and need quick access to map tiles, it is a straightforward, well-integrated choice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or above; rasterio and pillow have optional compiled dependencies on some platforms.
- Low friction: pure Python wheel, active maintenance (last commit 2026-07-27), and a straightforward dependency stack of well-established geospatial and visualization libraries.
- Requires Python 3.10 or above.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you can use, modify, and distribute contextily with minimal restrictions in commercial or private projects.
last release 2026-07-10 (35 days) · last repo commit 2026-07-27 · 589 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 667,841 downloads/mo, #5,418 on PyPI
Alternatives
Verify before relying
pip install contextily
import contextily as ctx
import matplotlib.pyplot as plt
ax = plt.gca()
ctx.add_basemap(ax, crs='EPSG:3857')
plt.show()- Whether xyzservices provider list is kept current and how often it is updated.
- Performance characteristics when working with large geographic areas or high-resolution tiles.
- Whether all Stamen Design tile variants (Toner, Terrain, Watercolor) remain available and stable.
What it is and what it does
Contextily is a lightweight Python package that fetches map tiles from web services and integrates them into matplotlib visualizations or saves them as geospatial raster files. It abstracts away the complexity of tile coordinate systems, allowing you to work in either WGS84 (latitude/longitude) or Spheric Mercator (Web Mercator) projections. The package leverages xyzservices to provide access to popular tile providers including OpenStreetMap and Stamen Design variants.
Typically used in geospatial analysis workflows, contextily lets you quickly add geographic context to plots without managing tile URLs or coordinate transformations manually. It handles the download, caching, and reprojection of tiles, making it straightforward to create publication-ready maps with minimal code. The package is actively maintained and supports modern Python versions (3.10 and above).
Use it for
- Add OpenStreetMap or Stamen Design basemaps to matplotlib plots for geographic data visualization.
- Export downloaded map tiles as GeoTIFF or other raster formats for offline use or further processing.
- Quickly prototype geospatial analyses by overlaying vector data on contextual map imagery.
- Create web-ready map visualizations by combining local geospatial datasets with standard tile providers.
- Support coordinate system conversions between WGS84 and Web Mercator when working with tile-based services.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Contextily is actively maintained, has no known vulnerabilities, low install friction, and solves a common need in geospatial Python workflows. If you work with matplotlib and geographic data and need quick access to map tiles, it is a straightforward, well-integrated choice.
Install
contextily on PyPI
Before you install
Low friction: pure Python wheel, active maintenance (last commit 2026-07-27), and a straightforward dependency stack of well-established geospatial and visualization libraries. Requires Python 3.10 or above.
Requires Python 3.10 or above; rasterio and pillow have optional compiled dependencies on some platforms.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute contextily with minimal restrictions in commercial or private projects.
Quickstart
pip install contextily
import contextily as ctx
import matplotlib.pyplot as plt
ax = plt.gca()
ctx.add_basemap(ax, crs='EPSG:3857')
plt.show()
Verify before relying
- Whether xyzservices provider list is kept current and how often it is updated.
- Performance characteristics when working with large geographic areas or high-resolution tiles.
- Whether all Stamen Design tile variants (Toner, Terrain, Watercolor) remain available and stable.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 8 packagesgeopymatplotlibmercantilepillowrasteriorequestsjoblibxyzservices |
| Maintenance | Actively maintained 35 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 667,841 / month, #5,418 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: MatplotlibProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: contextily-1.7.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tile basemap matplotlib”
- contextilyContextily retrieves tile-based map imagery from the internet and…
- xyzservicesProvides a Python API and JSON database of XYZ tile service providers…
- basemap-dataProvides geographic data assets (coastlines, political boundaries,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also xyzservices · morecantile · basemap-data · pyGeoTile · basemap · pytiled-parser · pytile · mercantile · staticmap · supermorecado