Skip to main content

msgspec-geojson

A collection of GeoJSON types for msgspec.

Inspired by the msgspec GeoJSON example code and geojson-pydantic.

This lets you parse GeoJSON into type-safe objects, including properties, and serialize those objects back to GeoJSON:

>>> import msgspec.json
>>> from msgspec import Struct
>>> from msgspec_geojson import Feature, Point

>>> class PoiProperties(Struct):
...    name: str
...    kind: str

>>> obj = msgspec.json.decode("""
...     {"type": "Feature", "id": 1,
...      "properties": {"name": "Zoo Zürich", "kind": "tourism/zoo"},
...      "geometry": {"type": "Point", "coordinates": [8.574695, 47.384510]}}
... """, type=Feature[Point, PoiProperties])

>>> obj.id
1
>>> obj.geometry
Point(coordinates=(8.574695, 47.38451))
>>> obj.properties
PoiProperties(name='Zoo Zürich', kind='tourism/zoo')

>>> feature = Feature(
...     Point(coordinates=(7.5823576, 47.5489249)),
...     PoiProperties(name="Zoo Basel", kind="tourism/zoo"),
... )
>>> msgspec.json.encode(feature)
b'{"type":"Feature","geometry":{"type":"Point","coordinates":[7.5823576,47.5489249]},"properties":{"name":"Zoo Basel","kind":"tourism/zoo"}}'

Metadata

Release files for msgspec-geojson 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for msgspec-geojson 0.2.2
File Size Uploaded Provenance Actions
msgspec_geojson-0.2.2.tar.gz 2.8 kB Without provenance Details for msgspec_geojson-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for msgspec-geojson 0.2.2
File Interpreter ABI Platform Actions
msgspec_geojson-0.2.2-py3-none-any.whl Python 3 none any Details for msgspec_geojson-0.2.2-py3-none-any.whl

Total release size: 6.7 kB

Release files / msgspec_geojson-0.2.2.tar.gz

Download URL msgspec_geojson-0.2.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fa8ab93b244ba1a5d935dcd24383d41dde0f87b83c74864d94eeeffb529d9ce9
BLAKE2b-256 checksum
How to use checksums
16f92d24052e00e81bc21d4d40cf63830a3de538d79b49c5bdca8476f05c3b15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / msgspec_geojson-0.2.2-py3-none-any.whl

Download URL msgspec_geojson-0.2.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05c25c2f707a3a0e10d6b3763efbcb65cdf851f76f538cc5ec429833883bed49
BLAKE2b-256 checksum
How to use checksums
a4d0ad68d9ddaa4c08a6ab7391a4ba526babde916fbbe2c931da438f2115b98a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for msgspec-geojson 0.2.2

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page