Skip to main content

Vector Tile Proxy for PMTiles

Project description

fast-pmtiles

A high-performance FastAPI-based vector tile server for PMTiles archives.

codecov

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

  1. Run the server:

    uvicorn fast_pmtiles.main:app
    
  2. View interactive Swagger docs: https://localhost:8000/docs

  3. 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
    
  4. 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

  1. Clone the repository:

    git clone https://github.com/bmcandr/fast-pmtiles.git
    cd fast-pmtiles
    
  2. Install dependencies:

    uv sync
    
  3. Install pre-commit hooks:

    pre-commit install
    
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_pmtiles-0.1.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_pmtiles-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for fast_pmtiles-0.1.1.tar.gz
Algorithm Hash digest
SHA256 672018aef9ad61488c506b714e351c938fa562182c19f9f94420382838b2a07f
MD5 f21fca0b5be26a72d78e9458aa7a9c76
BLAKE2b-256 809bb51f0153989485db03bbebeef5bdf3e4255d62ba94c4bd080de99ed39908

See more details on using hashes here.

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

Hashes for fast_pmtiles-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0458bcb8f0a4275faf7bbd74d388ab98f0af1be8877a43cae671a455da2f5552
MD5 423308a49630275e18bcecf5fdbad34f
BLAKE2b-256 d7c510cdce1f7a1b28b044557fcab45d9c075f5d7efca2d47205fa3c45b19378

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page