Vector Tile Proxy for PMTiles
Project description
fast-pmtiles
A high-performance FastAPI-based vector tile server for PMTiles archives.
Features
- Remote PMTiles Support: Serve tiles directly from PMTiles archives hosted anywhere (S3, HTTP, etc.)
- XYZ Tile API: Standard
/tiles/{z}/{x}/{y}endpoint compatible with any map client that supports MVT/PBF vector tiles - TileJSON Support: Automatic TileJSON generation for easy client integration
- Built-in Viewer: Simple viewer included for instant visualization
Installation
Requires Python 3.11 or higher.
-
Install with uv:
uv add fast-pmtiles
-
Or
pip:pip install fast-pmtiles
Quick Start
-
Run the server:
uvicorn fast_pmtiles.main:app -
View interactive Swagger docs: https://localhost:8000/docs
-
View tiles in your browser:
http://localhost:8000/viewer?url=https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2026-01-21/places.pmtiles
-
Get TileJSON description of the PMTiles source:
http://localhost:8000/tilejson.json?url=https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2026-01-21/places.pmtiles
Extending the application
from fast_pmtiles import app
@app.get("/my-new-route")
def my_new_route():
return {"status": "ok"}
Configuration
See .env.example. Settings are defined in settings.py.
Development
Setup
-
Clone the repository:
git clone https://github.com/bmcandr/fast-pmtiles.git cd fast-pmtiles
-
Install dependencies:
uv sync -
Install pre-commit hooks:
pre-commit install -
Run the server in development mode:
fastapi dev src/fast_pmtiles/main.py
Running Tests
uv run pytest
Code Quality
This project uses:
- Ruff for linting and formatting
- pre-commit for automated checks on commit
# Format code
ruff format
# Lint code
ruff check
Acknowledgments
This project builds on the excellent work of:
- PMTiles - Cloud-optimized archive format for pyramids of map tiles
- async-pmtiles - Async Python reader for PMTiles
- obstore - Highest-throughput Python interface to S3, GCS & Azure Storage
- FastAPI - Modern, fast web framework for building APIs
- MapLibre GL JS - Open-source map rendering library
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_pmtiles-0.1.1.tar.gz.
File metadata
- Download URL: fast_pmtiles-0.1.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
672018aef9ad61488c506b714e351c938fa562182c19f9f94420382838b2a07f
|
|
| MD5 |
f21fca0b5be26a72d78e9458aa7a9c76
|
|
| BLAKE2b-256 |
809bb51f0153989485db03bbebeef5bdf3e4255d62ba94c4bd080de99ed39908
|
File details
Details for the file fast_pmtiles-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fast_pmtiles-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0458bcb8f0a4275faf7bbd74d388ab98f0af1be8877a43cae671a455da2f5552
|
|
| MD5 |
423308a49630275e18bcecf5fdbad34f
|
|
| BLAKE2b-256 |
d7c510cdce1f7a1b28b044557fcab45d9c075f5d7efca2d47205fa3c45b19378
|