{"id":24247,"library":"pmtiles","title":"PMTiles","description":"Library and utilities to write and read PMTiles archives — cloud-optimized archives of map tiles. Version 3.7.0, actively maintained with frequent releases.","status":"active","version":"3.7.0","language":"python","source_language":"en","source_url":"https://github.com/protomaps/pmtiles","tags":["map-tiles","pmtiles","geospatial","cloud-optimized"],"install":[{"cmd":"pip install pmtiles","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Reader is in the reader module, not top-level.","wrong":"from pmtiles import Reader","symbol":"Reader","correct":"from pmtiles.reader import Reader"},{"note":"Writer is in the writer module.","wrong":"from pmtiles import Writer","symbol":"Writer","correct":"from pmtiles.writer import Writer"}],"quickstart":{"code":"from pmtiles.reader import Reader\n\n# Read from a local file or URL\nreader = Reader('example.pmtiles')\nheader = reader.header()\nprint(header.tile_type, header.min_zoom, header.max_zoom)\n\n# Fetch a tile at zoom 10, x 512, y 512\ntile = reader.get_tile(10, 512, 512)\nif tile:\n    print(f'Tile size: {len(tile)} bytes')","lang":"python","description":"Open a PMTiles archive, inspect header, and fetch a tile."},"warnings":[{"fix":"Use `from pmtiles.reader import Reader` or `from pmtiles.writer import Writer`.","message":"In v3, the main import changed from `pmtiles` to submodules. Code using `import pmtiles` and accessing `pmtiles.Reader` will break.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Pass a file path or a file-like object directly.","message":"The `Reader` no longer accepts an `open` keyword argument for custom file opening. Use a file-like object or a path.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure tile coordinates follow the TMS standard (y=0 at top).","message":"Tile coordinates use the Slippy Map tilename convention (x, y, z) with origin at top-left. y increases southward.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace `from pmtiles import Reader` with `from pmtiles.reader import Reader`.","cause":"In v3, Reader is no longer in the top-level package.","error":"ImportError: cannot import name 'Reader' from 'pmtiles'"},{"fix":"Call `Reader('path.pmtiles')` instead of `Reader().open('path.pmtiles')`.","cause":"The `open` method was removed in v3; use the constructor directly.","error":"AttributeError: 'Reader' object has no attribute 'open'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}