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.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 11.2 MB
Release files / spatio-0.2.10-cp314-cp314-win_amd64.whl
| Download URL | spatio-0.2.10-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 404.1 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1fc8029a53ed4421f92f61623a15dfca7890618eb8983a4f0dd960a2da053dce
|
|
BLAKE2b-256 checksum How to use checksums |
d7dace6f57341ed590a9b0a1e2da0446aeb544dae301bd9ccb44a8ab88570732
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.2.10-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 522.9 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
170c30cb5e57d765f2e880a33e0f0e9870418b715795756a3a91e4c9debc3de5
|
|
BLAKE2b-256 checksum How to use checksums |
768cfd18bfbe720017c56cb3d1dd11acd6f3a5aacf51aa8c285d847ccc5de411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.2.10-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 489.8 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
32d884ce139424489c7b7d94ce73900d01247f6ee7d2d0c20c6465e145e3edcf
|
|
BLAKE2b-256 checksum How to use checksums |
c43d5db0aad22a13ee3a2a82dbc0471f4c5f2cb1fa20b6f5061e94febcfee64c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | spatio-0.2.10-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 444.6 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5ba09d4b69d346ce104dcecf137780e4e7db0cf935f7dc5a72e6240d6b8a4b1b
|
|
BLAKE2b-256 checksum How to use checksums |
791404e102762d1722fcd73dda5a9d61f30f074607c511b41d8725cfea6af63f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp313-cp313-win_amd64.whl
| Download URL | spatio-0.2.10-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 403.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7279ec3d65ea5d032daa4035376767b33e439a84694014b8c7dad614012941a5
|
|
BLAKE2b-256 checksum How to use checksums |
9cb2f105b4e08551cee82c6af6c24bd2437d173a35c307e59068be4b698911c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.2.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 522.5 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6160fe2771396bef958aa4a42ab728168a72e57823577af6b30640e38db20f85
|
|
BLAKE2b-256 checksum How to use checksums |
c35d3c2d4924e3b2ebd4418039f1c666c240e75419c31d69b9109ece946e9e58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.2.10-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 489.6 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
528185c9ad1254b4084b8ed70529ad4fe32699c0e72622253ee460f10468f17d
|
|
BLAKE2b-256 checksum How to use checksums |
771da6d0966536c2eb32f5097ccbe57f49981e939c23b9bbd3d1dbc0d86a8b54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | spatio-0.2.10-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 444.1 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a053c0cd427cf0236eb7eca313c77d6df6d24b2fe418cb2a494ada08bb74b6c5
|
|
BLAKE2b-256 checksum How to use checksums |
4f98162813d7e55d1a2a0da6d2bbdb5eff2ffc0418bb519aa982d95986657541
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp312-cp312-win_amd64.whl
| Download URL | spatio-0.2.10-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 403.7 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b8e5b3735e5c9b948ddb68ed87511c908810b35cb8dbfd701bf0e7f9d5effd59
|
|
BLAKE2b-256 checksum How to use checksums |
8dc5982cf724b577b4571e9871aa3a2b92d7dfc38b4bd02747934f6ba91596d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.2.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 522.7 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
fbe1062f8ac83879e668978dc468ddad8c5ffdf4cdb4f64283cff0624cf18a76
|
|
BLAKE2b-256 checksum How to use checksums |
5943480ff24b5aa93520f6ed812550e2c1e34163b54f62a828a9d56465d5540e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.2.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 489.6 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
e11c5ad360213defb670e81f7d44079e80d9feab2a87746c6c09f880f6957e1e
|
|
BLAKE2b-256 checksum How to use checksums |
0a11b06cd601d46650f1ba2e3ede497fc08f5fac50cfec71e3707e21e3e0b158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | spatio-0.2.10-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 444.0 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ca3226b7a49e8d2542efc734782b56665e3663cced14acbec5c83ca6853caf1d
|
|
BLAKE2b-256 checksum How to use checksums |
542c37f57be0089164d56e7d78c8e1421368099825aef2887372a4c27d2d0a8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp311-cp311-win_amd64.whl
| Download URL | spatio-0.2.10-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 403.1 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e7634721cddd4d969667dd01747b8f9acf8aacb27ea77bfbd1f2400dea01f05b
|
|
BLAKE2b-256 checksum How to use checksums |
c5d545cd3e9f3026905991277a6ea76d257ed0aa144a2318c84ef154734bf696
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.2.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 523.1 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
eacf235315783607d18a2ac443e999bac44a0a0366749a06b3743f7b73e1ae7d
|
|
BLAKE2b-256 checksum How to use checksums |
b3f34be1ba230112db8dd29e85e76625e75833104a7a3315e365602048d3a3ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.2.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 490.2 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
a0c1e55fdc49d187201483c414fc0c2ad6a210aeef6221a5d4cc942d2aa143ae
|
|
BLAKE2b-256 checksum How to use checksums |
dd0edddd32a6e4b2d951417df2de9f7fe44ed6e38829ca8222890e9f853b241c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | spatio-0.2.10-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 445.0 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
963eea2e2475f61c38dc675b9c4dcc521230a209f28a26bdb5664b4f0338e8b7
|
|
BLAKE2b-256 checksum How to use checksums |
4b5327cbdfff639ea973cc274627e51e7511b2e6ccaf96a8e72e8b22f953228a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp310-cp310-win_amd64.whl
| Download URL | spatio-0.2.10-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 405.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6fead7d9a45d0af673659ae5293ce95466126bf641df08c530ee47954c62b098
|
|
BLAKE2b-256 checksum How to use checksums |
1182e9d25a9c88adbe60cf8ec9b65de0a671fb4c0f7580dcda12ad4cbb7c3846
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.2.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 525.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
96304835cb2bfbd95dd19a223c5c1b6b973b71659032c1c01cc3a521946b726b
|
|
BLAKE2b-256 checksum How to use checksums |
1d9c8681b53120b77ea37ad267546194a258ca651253363625a7f5ccc4adc3a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.2.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 492.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
a1cc7052293ead0a23187a83fb9b89492c0e5ef47897a11006386f85eb5f0ab5
|
|
BLAKE2b-256 checksum How to use checksums |
1eb298f0719df1f8f93ef8a9906a19596438bf0f9b0fb3226dcaca44ab080206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | spatio-0.2.10-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 447.6 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1ec71c3854997b2348033c46d9812c15cd9878b7200aa07eb8e5cd044806fe16
|
|
BLAKE2b-256 checksum How to use checksums |
30e5a0ec2afb29efe5d2c73f8428492f1364a56b47c7a591238fb9543775853e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp39-cp39-win_amd64.whl
| Download URL | spatio-0.2.10-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 408.0 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6333b8bf78cd7c1921f7346e3da4d3b0bdf26e3fbd6daca08e8d236d9156bc12
|
|
BLAKE2b-256 checksum How to use checksums |
63bb278037dab54b0d5fb6a3d62b36f382581aee0ac8197572ebcbecfb341341
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spatio-0.2.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 529.2 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
74758775641c0ce567e8f910fd2c1a83f6e5a0de5ec5826b262b068b85220c3f
|
|
BLAKE2b-256 checksum How to use checksums |
965cb85a7022715675ae83dedd0201167a3d31fcc635a1cb9078b3e1fb811f86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | spatio-0.2.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 495.9 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
046c76629ee8a60446e1f5d832779b49e2a1e4b1e42c1aeadd3d2967af8a0afe
|
|
BLAKE2b-256 checksum How to use checksums |
cf3361dda0e34a9b68a7b5cbf94c143f451a03f16f4c2f7a350913e5a32a7498
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / spatio-0.2.10-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | spatio-0.2.10-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 450.7 kB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1a3544372f83a85932f5e848b5615ab16b556afdfbbf13ecd76f578a44c7c8a7
|
|
BLAKE2b-256 checksum How to use checksums |
98371d5ba0a7593a9b3eb003266803a963ab2c9b4b0ec824fddc94238b60cd5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|