mlt_py
Python bindings for the MapLibre Tile (MLT) format via PyO3.
Decoding
import maplibre_tiles
data = open("tile.mlt", "rb").read()
# Structured decode with geo-referencing
layers = maplibre_tiles.decode_mlt(data, z=14, x=8297, y=10749, tms=True)
for layer in layers:
print(f"Layer: {layer.name}, extent: {layer.extent}")
for feat in layer.features[:3]:
print(f" id={feat.id}, type={feat.geometry_type}")
print(f" wkb={len(feat.wkb)} bytes, props={dict(feat.properties)}")
# Raw tile-local coordinates (no z/x/y needed)
layers = maplibre_tiles.decode_mlt(data)
# GeoJSON string output (tile-local coords)
geojson_str = maplibre_tiles.decode_mlt_to_geojson(data)
# Fast layer listing (no full decode)
names = maplibre_tiles.list_layers(data)
Decoded objects
decode_mlt(...) returns a list of MltLayer objects.
Each MltLayer represents one decoded MLT layer and exposes:
name: str- the layer name.extent: int- the layer extent.z_step: int | None- the power of ten of the z grid's step in metres, orNonewhen the vertices carry no z.features: list[MltFeature]- the decoded features in that layer.
Each MltFeature represents one decoded feature and exposes:
id: int | None- the feature id, if present.geometry_type: str- the decoded geometry type.wkb: bytes- the geometry as WKB. A layer with z writes ISO WKB Z, with grid values in tile coordinates and elevations in metres oncez/x/yproject.properties: dict- the feature properties.
import maplibre_tiles
layers = maplibre_tiles.decode_mlt(data)
for layer in layers:
print(layer.name, layer.extent)
for feature in layer.features[:2]:
print(feature.id, feature.geometry_type, dict(feature.properties))
Encoding
encode_geojson(geojson, name, extent=4096, *, tessellate=False, sort="auto", shared_dict=True, fsst=True, fastpfor=True, z_step=None) -> bytes encodes a single layer to an MLT blob.
geojsonis a GeoJSONFeatureCollection. Geometry is in tile-local coordinate space (no projection), matchingtilezen/mapbox-vector-tile's default. Coordinates must be integers, and 2D unlessz_stepis set. They must be JSON integers (2048), not floats: a float-typed value such as2048.0raisesValueError.nameandextentset the MLT layer metadata, since aFeatureCollectionhas no slot for them.extentdefaults to4096.tessellategenerates triangulation data for polygons and multi-polygons.sortcontrols which feature ordering(s) the encoder tries:all,auto,morton,hilbert,id, ornone.shared_dictenables grouping strings into shared dictionaries.fsstenables FSST string compression.fastpforenables FastPFOR integer compression.z_stepis the power of ten of the z grid's step in metres, from-3(1 mm) to4(10 km). Every position is then[x, y, z], wherez = 0sits at -10000 m, and the layer is written in the experimental v2 format.
encode_mvt(data, *, tessellate=False, sort="auto", shared_dict=True, fsst=True, fastpfor=True) -> bytes encodes an entire raw Mapbox Vector Tile (protobuf) to MLT using the same encoding options.
import maplibre_tiles
blob = maplibre_tiles.encode_geojson(
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 1,
"geometry": {"type": "Point", "coordinates": },
"properties": {"name": "main", "lanes": 3},
},
],
},
name="roads",
extent=4096,
)
# Multi-layer tiles -> encode each layer and concatenate the bytes
tile = b"".join([
maplibre_tiles.encode_geojson(roads, name="roads"),
maplibre_tiles.encode_geojson(water, name="water"),
])
import maplibre_tiles
mvt = open("tile.mvt", "rb").read()
blob = maplibre_tiles.encode_mvt(mvt)
# With explicit encoding options
blob = maplibre_tiles.encode_mvt(
mvt,
tessellate=False,
sort="auto",
shared_dict=True,
fsst=True,
fastpfor=True,
)
Input is validated strictly.
A non-FeatureCollection input, a non-Feature member, float-typed or 3D coordinates, null or empty geometry, nested or non-scalar property values, a non-u64 id, and an empty collection all raise ValueError.
Metadata
Release files for maplibre-tiles 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| maplibre_tiles-0.3.0.tar.gz | 509.7 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 24.8 MB
Release files / maplibre_tiles-0.3.0.tar.gz
| Download URL | maplibre_tiles-0.3.0.tar.gz |
|---|---|
| Size | 509.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cacb5e97b6f55be8847b02dda5db0e0233fee7af5023e88dc4bf19b6086d3d7a
|
|
BLAKE2b-256 checksum How to use checksums |
8d9db35a8cc83a30eadbb675d72648bb0497e479e4701a9f472881b44d53cec6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp315-cp315-macosx_11_0_arm64.whl
| Download URL | maplibre_tiles-0.3.0-cp315-cp315-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.15 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6ae1af351794d1d1d4383cd06d44bcc285eb6588915e5da64c62ca767c38f5f4
|
|
BLAKE2b-256 checksum How to use checksums |
bd6467c0c5a8ff22a705d4fdcc3b23474f7342b9e3aeabab35bf807a41c80e7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp314-cp314-manylinux_2_31_x86_64.whl
| Download URL | maplibre_tiles-0.3.0-cp314-cp314-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
6e22be125646bcc1037e66bffb7ec3e7e87bf1bdb08f440ef404c35d814f6703
|
|
BLAKE2b-256 checksum How to use checksums |
b1d606e15763f4e37d270fdd5c7f494790aa2cf6db1c4f84a2096a4e350e89b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | maplibre_tiles-0.3.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ba487c362157a0f8dd7bd13380862bcbdfe8de8ca5320f2cd2e129c5ade9f681
|
|
BLAKE2b-256 checksum How to use checksums |
38738715c23f3387138937858adc649177a60b15bb548a838b4b45af4b120426
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp314-cp314-macosx_10_12_x86_64.whl
| Download URL | maplibre_tiles-0.3.0-cp314-cp314-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.14 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
6f4e031e115d8e7bc5711d8fbad6bb267599f1ae43946deafe1d96f9464e6ac3
|
|
BLAKE2b-256 checksum How to use checksums |
72d1cf85614eb589bafecf1e8030e2e02eac477c544ad6c76f59eea452912db0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | maplibre_tiles-0.3.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
caf35beed17cd18bc0c6b1dfd5af468c93ab9e904919de9af1c0e0ecb5b854ae
|
|
BLAKE2b-256 checksum How to use checksums |
5510f4f4845d9d8d03b18ed5091239c4c5d8746af592406d60f6912104d1d761
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | maplibre_tiles-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4a7bb6111c90631dbafc02dbce6c96564bcced4cfc564428428327d7fbf32dd8
|
|
BLAKE2b-256 checksum How to use checksums |
1928470de370f2de3bb5815e52f0bd0fcc62cc98c2f22d2c5e9547cec2d26ec9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | maplibre_tiles-0.3.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
dae76008d7ec5ccb623af07e8fde64d58076262b9592d6b716234501e0f0c0a5
|
|
BLAKE2b-256 checksum How to use checksums |
7f1d2072f8d4f37d04e4c7586411b5b551292440040f5d45c1319fd4a2d0a45f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | maplibre_tiles-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
311179d953aea1c39c51486c8c63cfe37c4067ad1d2ece063694d0f562de462e
|
|
BLAKE2b-256 checksum How to use checksums |
27e128e1b88dcc2a69cdefe452a702a792e2967250e4ed48a0c075b73823ad31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | maplibre_tiles-0.3.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c5480d460d0fb9759fec6d8049ba1033316d59616324b1b88d33d5489053ee8d
|
|
BLAKE2b-256 checksum How to use checksums |
26474eab42f4e3617a6ccfa9f84241a123a26add678cbd29ef7d6b188364d30a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | maplibre_tiles-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
58560f901c380773b705d0d9f17a5775c44a49b4f1e062b64c1ba51cfa976599
|
|
BLAKE2b-256 checksum How to use checksums |
a4cbc682dba594c961480b15ed65806b253903722f70fa724d80dee55f92478b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Release files / maplibre_tiles-0.3.0-cp310-cp310-manylinux_2_31_x86_64.whl
| Download URL | maplibre_tiles-0.3.0-cp310-cp310-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
839ca7341d4e074be36c87335885c87f5004682df4e853bbf633cc2a0412fa0c
|
|
BLAKE2b-256 checksum How to use checksums |
d651f7415dedc73e305455974bc05f7b82c447793903dfedcb2137599addb0d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}
|
Security for maplibre-tiles 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.