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.2.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.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file fast_pmtiles-0.1.2.tar.gz.

File metadata

  • Download URL: fast_pmtiles-0.1.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.2.tar.gz
Algorithm Hash digest
SHA256 c0e020704150de8f9cad834b68d8a035a1a1fc78e53d44791b5e10687d8d227b
MD5 62818222dd6f4e74d87ce4ab7b2b22f0
BLAKE2b-256 d2f978eacc665b71338c64e993e30c3468860b36e6faa0e12dfb59ba5f308a6a

See more details on using hashes here.

File details

Details for the file fast_pmtiles-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fast_pmtiles-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf5a6d39839336d762515ea300733c20bd94be0c4c2b5874846f40de2d4961e1
MD5 5c1f23b0474a2cf724cc547f284e7714
BLAKE2b-256 f0d48749e0d46dce5ac2195a622905568957186c4e9ec508d1603fe8d773a950

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