Spatio for Python
High-performance spatial database for Python, powered by Rust.
What is it?
Spatio is an embedded database optimized for tracking moving objects. It uses a specialized Hot/Cold State architecture to provide real-time spatial queries and historical trajectory tracking with minimal overhead.
Quick Start
import spatio
# Open an in-memory database
db = spatio.Spatio.memory()
# Track a moving object
pos = spatio.Point(-74.006, 40.712, z=10.0)
db.upsert("drones", "drone_1", pos, {"status": "active"})
# Find objects within 500 meters
nearby = db.query_radius("drones", pos, radius=500, limit=10)
for object_id, point, metadata, distance in nearby:
print(f"Found {object_id} at {distance:.1f}m")
core API
Spatio (Local Database)
import spatio
# Creation
db = spatio.Spatio.memory()
db = spatio.Spatio.open("data.db")
# Tracking
db.upsert(namespace, object_id, point, metadata=None)
db.get(namespace, object_id) # Returns CurrentLocation or None
db.delete(namespace, object_id)
# Proximity Queries
# Returns list of (object_id, point, metadata, distance)
db.query_radius(namespace, center_point, radius, limit=100)
db.query_near(namespace, object_id, radius, limit=100)
# K-Nearest Neighbors
db.knn(namespace, center_point, k)
db.knn_near_object(namespace, object_id, k)
# Volume Queries
db.query_bbox(namespace, min_x, min_y, max_x, max_y, limit=100)
db.query_within_cylinder(namespace, center_point, min_z, max_z, radius, limit=100)
db.query_within_bbox_3d(namespace, min_x, min_y, min_z, max_x, max_y, max_z, limit=100)
# Relative Queries
db.query_bbox_near_object(namespace, object_id, width, height, limit=100)
db.query_cylinder_near_object(namespace, object_id, min_z, max_z, radius, limit=100)
# Trajectories
db.insert_trajectory(namespace, object_id, list_of_temporal_points)
db.query_trajectory(namespace, object_id, start_ts, end_ts, limit=100)
Data Types
Point
spatio.Point(lon, lat, z=None)
point.lon,point.lat,point.altpoint.distance_to(other_point)-> distance in meters (Haversine)
TemporalPoint
spatio.TemporalPoint(point, timestamp)
- Used for bulk trajectory ingestion.
Performance Tips
- Namespaces: Use namespaces to logically separate different types of objects (e.g., "delivery_trucks", "warehouses").
- Object Queries: Use
query_nearorknn_near_objectwhenever possible, as they avoid re-passing coordinates and leverage the internal Hot State index directly.
License
MIT - see LICENSE
Metadata
Release files for spatio 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 12.8 MB
Release files / spatio-0.3.0-cp314-cp314-win_amd64.whl
| Download URL | spatio-0.3.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 493.7 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0fa738b5fb73c3a3618d995c6c2fbf5d09e1db9d49e19d1045a244be8ceeac44
|
|
BLAKE2b-256 checksum How to use checksums |
a9e7236ab03b2ffc96119ae6e49237310383cc314e33a33d9bd66de55cdaa8ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.3.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 579.5 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c5d526ad27a13c816e0e44c1ad63847b1e3c2fff0765baab14cb06f32756e9df
|
|
BLAKE2b-256 checksum How to use checksums |
bf59cedb5b8e93cfb69e9c44d24d0972fab7bc6a1b474c0de1b107e788d90955
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.3.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 546.6 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
a959561bf22e4a5d2c77bdc1b9dca01216f646a4138ffff61a6bcf2e425171cd
|
|
BLAKE2b-256 checksum How to use checksums |
b44a2c70f3a97150711f81a9ab938aeab1ed5d791109b7eddd36bed6e08762e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | spatio-0.3.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 518.3 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c415e0cc45eaa8e92c1dfb090ae2807002c4aa88a85e6e767aa0c71e5b96fc17
|
|
BLAKE2b-256 checksum How to use checksums |
e9da5423c63a15f4efaa4c1daa08b8921f98259e9b68c149d7c711078ae460a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp313-cp313-win_amd64.whl
| Download URL | spatio-0.3.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 490.1 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d16306a15a52dcefa39fb7f3d1cc9a83153be2dca825c5064797e8ef01cb143d
|
|
BLAKE2b-256 checksum How to use checksums |
f7f0b5eba1dd2eaed487114249124ed9713e41f53218217a1d2ea81261d15f1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 576.1 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9550a7066b81d0ad1f691cbdb4f12773ede0c2d74942aa156dfa36c60462fd67
|
|
BLAKE2b-256 checksum How to use checksums |
c4c797856851bca780793c9a5443acdcb94375a39008b8d1b4cc259a9f546c49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 543.8 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
ee9f0b7d3355e6b078b2a36055eac56819e518dc8f9c7098a97c40ef178a40a1
|
|
BLAKE2b-256 checksum How to use checksums |
10165ae10e515b5ce28ea08fa3035ba90dc1a98fd1ea1149ac6d9456e0d41c14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | spatio-0.3.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 510.6 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a1d8dd9874de55318dc1108cd57ecf5e9bdb01af1eb1ef21098d99f64fc5685c
|
|
BLAKE2b-256 checksum How to use checksums |
8d571d86f528a9792c4449feac6531cd92b083e64d2a72047cdd19d59f3a5700
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp312-cp312-win_amd64.whl
| Download URL | spatio-0.3.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 490.2 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fb70825d16085cf0b1dba238e0767db34f6677fa1c258a1cc5980aac64c75909
|
|
BLAKE2b-256 checksum How to use checksums |
9a392375572f1fd4682486118941f099714e626e12a2a48879cca90a1a3c8dc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 576.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
df12f8fcb433f4574322c7ba33ea326cd6235dd0d3edbac4ccd02546aeb5fe14
|
|
BLAKE2b-256 checksum How to use checksums |
0cf03bfddd95de615a3585f3664049c3a9026afe5e94084d88f744730fb893db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 543.6 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
3b1a330cda103dc41f2007a60269ce4a4fccfb41ce9338d2867b5a887691bb60
|
|
BLAKE2b-256 checksum How to use checksums |
354d6c898a90ad96a4558d85a8ab3a64d90ba492bc799d846e887ef8c7b980eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | spatio-0.3.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 510.5 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
836cc1120e007886e2e9ad76c6d3edd7e83d100cb3d7002f33326e49d6cf964c
|
|
BLAKE2b-256 checksum How to use checksums |
d4f62fb26c223416c0b0a0b4a9b7b7d295f1ea3a4d63d0fbd79c357449e3ea03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp311-cp311-win_amd64.whl
| Download URL | spatio-0.3.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 492.5 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
870aee353fe54b055f0fda5ab4c7e310b92266b3cbef8a5be53615683c6ee56d
|
|
BLAKE2b-256 checksum How to use checksums |
07ab41ac4169f0e1ae581ac2bc0d5a448aaf84fc126fd8298b177b1f5689ff3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 576.8 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6d3bc0f6e8a1a46065faf0078cd0d47a4f67d401b0db317e2092b6796998cecc
|
|
BLAKE2b-256 checksum How to use checksums |
94f3022c8b9fc5b92b0dc644dec6dde580041ea6eda0b5d9bef40098f1dde573
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 544.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
d07268f2346e59469bb0e12fa35e1273ba67578fc1a87ae3d16e042a56bd091d
|
|
BLAKE2b-256 checksum How to use checksums |
10e785e4b5cd6b522b8bf93bf902d420565959bea89466440974687998be9a5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | spatio-0.3.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 512.8 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9339487b198517abcb7e8dc760ce7305676cc7e95a376fe1139188868ad66dbd
|
|
BLAKE2b-256 checksum How to use checksums |
7f267c4214d65affa48100ab6f8c7c541055d28121701ce79993135623efd0d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp310-cp310-win_amd64.whl
| Download URL | spatio-0.3.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 494.9 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5d24253f8004139d2a332cd3282971200a65a6f12bf55267a90d8c07d96a3677
|
|
BLAKE2b-256 checksum How to use checksums |
08fff997b33232c4cd4b495c9cdf307e906ba641d19fc5744733a764860f2232
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 579.2 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
3c57c625d5c14b65b434c966f2e052f8fbd31f56a08853f5060d1e893a91c014
|
|
BLAKE2b-256 checksum How to use checksums |
9a9779c926ed0f01c494e538b7c0f62e36b3552b998822593b9ea95f2bf000e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 546.8 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
9efc6fcdc0de843596fa170121765a720de4d9b2e16d984a0b242b5dafdc4f5f
|
|
BLAKE2b-256 checksum How to use checksums |
aeadba8e323af165ecd7b87e69cfcb82dfad52a12485ea9cf63a1870605e7765
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | spatio-0.3.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 515.1 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b07be63ae3c5453b32354b6608bfc920ccb8bcc51545464d6e092bd93aa63781
|
|
BLAKE2b-256 checksum How to use checksums |
fa15471b947cdfc5028ac60eeeefaa0c79f2159862d166b090da66bc2b171f82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp39-cp39-win_amd64.whl
| Download URL | spatio-0.3.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 499.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fb0a32478488f7722c9b5d5f2d9ecd16023b12f94531e3b2d2ea8dee3233864a
|
|
BLAKE2b-256 checksum How to use checksums |
b1fcc9c951e6a93b2048a8b40923d237cd14f53f809459c47fc70ced78b3b91e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 582.5 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d4b8a91b9ced27388e69d148322534571920611e72a5d38b837554fd1ed3673
|
|
BLAKE2b-256 checksum How to use checksums |
01259c74cae811a035fcb1c706445e3f2962fcfb88f5d8122a6fb34be1874148
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 550.7 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
005901867b2446309c5373b60aabd5804d9b9907d5334ce999e459bbe430f968
|
|
BLAKE2b-256 checksum How to use checksums |
df25533edc1002ebd94fe2cd47afbf091a8c74046aa3e63d503848a9ea5c5177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / spatio-0.3.0-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | spatio-0.3.0-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 518.0 kB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
81807986e8957a25948ce443f9436829e9382c4741864ba0b8ed2ecc12cb85e9
|
|
BLAKE2b-256 checksum How to use checksums |
fbdca566a27ff3f02bfcc17763ff2cf5f206dd68b5f1985e1e9cb4587d5057bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for spatio 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.