Skip to main content

Blazingly fast spatio-temporal database library

Project description

Spatio for Python

High-performance spatial database for Python, powered by Rust.

PyPI Python 3.9+ License: MIT

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, altitude=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, altitude=0.0)

  • point.lon, point.lat, point.alt
  • point.distance_to(other_point) -> distance in meters (Haversine)

TemporalPoint

spatio.TemporalPoint(point, timestamp)

  • Used for bulk trajectory ingestion.

Performance Tips

  1. Namespaces: Use namespaces to logically separate different types of objects (e.g., "delivery_trucks", "warehouses").
  2. Object Queries: Use query_near or knn_near_object whenever possible, as they avoid re-passing coordinates and leverage the internal Hot State index directly.

License

MIT - see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spatio-0.2.6-cp314-cp314-win_amd64.whl (396.3 kB view details)

Uploaded CPython 3.14Windows x86-64

spatio-0.2.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (515.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

spatio-0.2.6-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (479.6 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

spatio-0.2.6-cp314-cp314-macosx_11_0_arm64.whl (438.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

spatio-0.2.6-cp313-cp313-win_amd64.whl (396.0 kB view details)

Uploaded CPython 3.13Windows x86-64

spatio-0.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (514.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

spatio-0.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (479.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

spatio-0.2.6-cp313-cp313-macosx_11_0_arm64.whl (438.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spatio-0.2.6-cp312-cp312-win_amd64.whl (396.1 kB view details)

Uploaded CPython 3.12Windows x86-64

spatio-0.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (514.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

spatio-0.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (479.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

spatio-0.2.6-cp312-cp312-macosx_11_0_arm64.whl (438.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spatio-0.2.6-cp311-cp311-win_amd64.whl (396.2 kB view details)

Uploaded CPython 3.11Windows x86-64

spatio-0.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (515.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

spatio-0.2.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (479.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

spatio-0.2.6-cp311-cp311-macosx_11_0_arm64.whl (439.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

spatio-0.2.6-cp310-cp310-win_amd64.whl (398.4 kB view details)

Uploaded CPython 3.10Windows x86-64

spatio-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (517.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

spatio-0.2.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (482.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

spatio-0.2.6-cp310-cp310-macosx_11_0_arm64.whl (441.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

spatio-0.2.6-cp39-cp39-win_amd64.whl (400.6 kB view details)

Uploaded CPython 3.9Windows x86-64

spatio-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (521.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spatio-0.2.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (486.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

spatio-0.2.6-cp39-cp39-macosx_11_0_arm64.whl (445.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file spatio-0.2.6-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: spatio-0.2.6-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 396.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spatio-0.2.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4d35ccb64ca1aba94b4807f943c920a100589f233fdb2a4d1d4101df0dfdcfef
MD5 a0a24c1d31957cadcf597a1025fd66bf
BLAKE2b-256 dffa40bafe5ba39f6df2a1451ea23f4dad37803029d1e1ff3c416bb4e32f95d5

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55ad7f710cb9aade98d7503324c590cc07282df8410c7a0f9a0ac3f2f8f53543
MD5 6477225d9c0436990281a0ea91c94c6f
BLAKE2b-256 f17ba8ad77c4c0815564bb4ad2ffff9e3f4bf07f7c9b5c3908b8c364d9939391

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d825ee0cccb51620a2152b45d7d3019cd2cd285bd1b724a32bdbbb4bd17aee6a
MD5 b3166f0cfcacea29ebd965831d0651cc
BLAKE2b-256 2f9fe68cbfa4b1f4b3b1f3a12254ed89bab258628cdbfe96d9a2f1b7efa0c480

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 816c7ad08666b5941a7d47ecf5ccb628fdb85b54082fd3050194be9053dedf30
MD5 4617333f35abdf59ee24e53569af82db
BLAKE2b-256 17b0a7a6cf08eb1b2c929999b41aa39ee815c336de571958db157998da896560

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: spatio-0.2.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 396.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spatio-0.2.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 afcecaf56017532d5c66a8e97202bda1c6db99fea672fd1463a834d19375c856
MD5 fca972745df19735b5ba6bc2e855877d
BLAKE2b-256 00aedd46a1e0f8d8d94ffe5737796ff3f9ea91049405015a61b54a76f00c744b

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4317f096efa89cdf143d68636d68ed393dac7f2f4937d94b5131fb3a1c06005
MD5 540d65aacbce7bf039d0705057535073
BLAKE2b-256 ac6ce835f6f4b3aee1d857c0488b9ab20c3bfe2ab728b952130fbfce17cf1a6a

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6f21305a9e9a559f390e770a88aaea45178712eea1e1b7123b69749601659b67
MD5 a254d640c4b317f9a4324e2313c9cfbb
BLAKE2b-256 1c45a1dd4f426582c09cedd21810ca7902442923326918b672f94d49c1980c48

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf2363d609b3f759afec1aea68fc4fe1b31d32e1cd49702e0ee1e06c7a86e908
MD5 8e0ada20a3d53a14b78aa7c42495b901
BLAKE2b-256 6855907f5ce076b80d48961855a8d9268865858e228ca9ab158ea68da1fd86af

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: spatio-0.2.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 396.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spatio-0.2.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 13ca2be54b53ddc9a9601a459fd5b097b1109d0b5dde026146f4286ab7b06b0d
MD5 313eda390e43f45af336b6d1c389e1cf
BLAKE2b-256 4e7c34a55beb59d231bb622e4bd6c1245ebc76590c380ad884cc9ed3e48e1fb4

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9472f1a5c2c277bb78a5a7522a06dfd29c1f434f250dcb2e76ba9ea9658fa14b
MD5 ac535cf1bf5b7d92657936fbd5254a3d
BLAKE2b-256 c592884d8f2f38901c0739252d708a98778a7f323d876a0eb40099d42ff3b6d6

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 22b55f210996f6e45960b08d4f25984a07c29d0567b11055ec9e35d9e8b9ea57
MD5 d773fcbfde8562eda6c4fbdbb2e9e782
BLAKE2b-256 42dbf73b08e553f5cb503e9444671f91acf793317aa7601248aa6f4439bd666a

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e684e9887d44f458f98080dcad04a1ea7f2adc9475c916083d2dae541cda5de0
MD5 04fa3a83262a1879bba3bf4470f49895
BLAKE2b-256 6a5a41eff232853f757c9c8871b6c99287e18bd022c4fefe6ca67afce3fdaac3

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: spatio-0.2.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 396.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spatio-0.2.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 08783640f8fba88d4fa5fe57ebfdbba8f00667179c304f6b073fb561c40ff563
MD5 5d095fc6b0b9fbd83e56a6a987fc2029
BLAKE2b-256 d77129bc24396d62dd9c4717ade7c80cb146758a310227069eb206d4ad92de50

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1f173f2bda3250513aa30835c149c13a25b5cf4d1ec4ae1bf8bc762f09c5a74
MD5 958cde7471824ecd9258296cb245041a
BLAKE2b-256 73b135c7938020c81d88f877927f064593948b53250252fda2fdfc9aaf830785

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 87e40a03a580091d0c9cb11f37aef329785465a6a5594f9a6bfb018e2a510047
MD5 3df60657b3e1332e1d4d7ed87a9a5fd8
BLAKE2b-256 6f66594fac077c0a4389d61e242a1584a82693c21d439e38b05ea8c12e987369

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd29ae6d0488bfc5fc223d3959dbc0977ddd02cd07af6a3ae51035cc7f71377a
MD5 6c71af1ec091d727dea4df4a3fd6218d
BLAKE2b-256 6900d00af994b06734c04190c2ea891c71a754b288f367445825cca05e5b21b0

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: spatio-0.2.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 398.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spatio-0.2.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 43da4516e8eae9d117d5d82c1f1a3aeabb298cfa2da78008eb914504884edc26
MD5 288b211d3446d6e01a15ee1f627ed729
BLAKE2b-256 65d53605f21c1d4237bf0e52bc775b6e85c415709540e94a8175dba76969b105

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c84b84f54830b57b71bfb146665c755e9b7925a7d710f43a836891241e716e16
MD5 de081e93426bd170f26ad8ea1d382474
BLAKE2b-256 904edc9d8d57ae27782caa7f129a70e05d40809afde32e78e4edd0525b0be5b4

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1b42c24b8fb6d1e414980d9376a6c1f78c4a5d607f5153e1e43f1e0a95684fd0
MD5 d228d1141931171f10bd9ce8102376ce
BLAKE2b-256 f4790ee5041bb90f127ff331aeb4962aa9504aeeda1859233fed0ac0f4f7bdc0

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e926769c8a754455c8df270c227e5c399b906637a522cf925fa3ce773c77fde
MD5 db9fa38b8d712d20ac75856933330b8a
BLAKE2b-256 6d83b291e86338dc71862495b8a7402063f99642d657f10d74e254c9d0032ba7

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: spatio-0.2.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 400.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spatio-0.2.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 41d65d6ffb39720efa8bd704596373b448da15c6ba3914b44cc264239c6e2bdb
MD5 2f041630073451a0b6c79e93031068f6
BLAKE2b-256 ae89e3451e3e21a6c7bed006509277bd021fc60e9db0c5c00885fd50d8570dc6

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 52c80a89aa66e32dd608b54bea79b64b3dbbac15a911184318081141b7c7f9d8
MD5 84e9ece34bb11e30faaf8a17f5125a65
BLAKE2b-256 f6c3856f31c4fb89c2ed78f57276a2b46625ac7fe71be9e327251ada5d44f550

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 41208acdc2e3c221226564b6cec1db8abe697f7aa8e77cc2061acd263049b0dc
MD5 8c10bda3bb01a4f92e9f056484636dae
BLAKE2b-256 90872887d654d9efa5a728faab1973938d94bc66ae5e5960ed30b90595aa4dc1

See more details on using hashes here.

File details

Details for the file spatio-0.2.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spatio-0.2.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d85af6af92eaa3d3823ae331adecdf0cfb61c7824ca26dfe6bb54da93879aeb2
MD5 435fa2f5f71cfad665951e1801b92b82
BLAKE2b-256 d100e1750304e91545a3129446af94cc52a84cd23ccf846a889a138a735e97af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page