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.7-cp314-cp314-win_amd64.whl (401.5 kB view details)

Uploaded CPython 3.14Windows x86-64

spatio-0.2.7-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (520.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

spatio-0.2.7-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (487.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

spatio-0.2.7-cp314-cp314-macosx_11_0_arm64.whl (445.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

spatio-0.2.7-cp313-cp313-win_amd64.whl (401.2 kB view details)

Uploaded CPython 3.13Windows x86-64

spatio-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (520.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

spatio-0.2.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (487.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

spatio-0.2.7-cp313-cp313-macosx_11_0_arm64.whl (445.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spatio-0.2.7-cp312-cp312-win_amd64.whl (401.3 kB view details)

Uploaded CPython 3.12Windows x86-64

spatio-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (520.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

spatio-0.2.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (487.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

spatio-0.2.7-cp312-cp312-macosx_11_0_arm64.whl (445.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spatio-0.2.7-cp311-cp311-win_amd64.whl (401.0 kB view details)

Uploaded CPython 3.11Windows x86-64

spatio-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (521.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

spatio-0.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (488.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

spatio-0.2.7-cp311-cp311-macosx_11_0_arm64.whl (446.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

spatio-0.2.7-cp310-cp310-win_amd64.whl (403.3 kB view details)

Uploaded CPython 3.10Windows x86-64

spatio-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (523.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

spatio-0.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (490.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

spatio-0.2.7-cp310-cp310-macosx_11_0_arm64.whl (448.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

spatio-0.2.7-cp39-cp39-win_amd64.whl (405.9 kB view details)

Uploaded CPython 3.9Windows x86-64

spatio-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (528.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spatio-0.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (494.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

spatio-0.2.7-cp39-cp39-macosx_11_0_arm64.whl (451.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: spatio-0.2.7-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 401.5 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.7-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e179d023944fe49395e7bbca60868045b351d4a9b10221cfbc6be6555e030ac5
MD5 f41879b7bb2b69edf00bcfb3324926eb
BLAKE2b-256 de8a07e099468cab048dcd0cc798fe3040f04129af8b8088ae759d61b91a9d0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7220b2a92c600ebbb95242522fdc1ac6d9861def369dc51d679fd108faf4b63f
MD5 ad8238ad1c383f97ddcba514d3b81bc7
BLAKE2b-256 df67cb84809327337e759bb220407ecad6d199f73db92f88d57a1d2b135e5ff7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 88dd3e445ad3b9fd9f4aab41a04c624609ec79f0a94fde0377f622d3b58013df
MD5 b83bc39b40aa084b5df47725ffedb385
BLAKE2b-256 64021fb25ed5e4fb002b5df63bc1d53c424104e02f98b847bbd954fa15f28cc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f51394a81b383b26370ad5a64254fc7bdd5530aca456f0e7b532ae1907a99701
MD5 2c802d63c33102ea447a327e517c8035
BLAKE2b-256 5f4cd99d6b00f785a30365cdf2f176a810da5156e01f4cd21c5409e7bce6f155

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 401.2 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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fdfa8cdded2d0dd7959705e188bd6d166fc3cfbf7226f72f2b2ff200743e46fd
MD5 90d939d3566d268de9aba5e9a06b77f7
BLAKE2b-256 0c43a122ec402a6459683e663d9b66eea22c877d33a92b357c3b7f35e3603de9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2aae437b4a24fbb8e5eff5ff768871a519676e4c75a97a293ec90c736629c244
MD5 1215bdb3e5943cc5c9d6cb40d60a4c1f
BLAKE2b-256 0f294c3a1f518242cf82af9c218f5f8cdc8f8b19aa3cc3e958f5d1ea21bf61dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f81b958bd7dbbc2fda333b9cdcfa257dbf57678e9341e99a099f531900adddcb
MD5 feac443a2bbf4eb412126d839059ab79
BLAKE2b-256 615373dbbb0c581511ffed7dc5c14b6038c9c95ab7afddf3b4396ca0d21e457e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a57ca29e1d2ff9b80b60be52be81c967aa02afbb20c31f8ddd193095d6c38652
MD5 69b070cea31d81ea8f236a2b5809f8ec
BLAKE2b-256 ce13c26a780cfd0fd0f60434274af28cfaf86f7f85edccb928ffc3f0cc1e8920

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 401.3 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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5490dc1bc16612ea77b310b0b5f1cd15e800b97a2e38cbf9c1954f5c556f2776
MD5 09d722ac42e37109a154ae98ba35971b
BLAKE2b-256 fa3b92ef03f6ccf19074bc82af949ef8bef775d94587989ac3b3cbe773635f01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b8d9ca98a9113b0e00abebed828085785cff7acde9fc0a2d5061f8dff79a887
MD5 67bed02b7df633bc146284e80182a792
BLAKE2b-256 af1d244a86f448f157ea38893e38ca752f1e418938c44f762dac416ac1d1fb8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 46a048fc593f2bd6bba90b6e8a77f9199ea1ee1d451469f4008c078c345d74ba
MD5 8079ad793f7660a099e50d22f94879b9
BLAKE2b-256 81d00443cf89f040fb5caea4122d14b056c7d0c1e7c5c0956d5cb2cdb9940d00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71b1e05d8779a1f43765db9a02622a8d8b391fc1ceeda8e0709a12782b1ec786
MD5 4552f4c3236a7d457261b5f91eba2e88
BLAKE2b-256 e04763b1995e5a388086e1c0af740d00ca9dde5938c4e7ea0fbf8a97b223a47b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 401.0 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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9b91e7bbf6c65dafdc707e171f05fb1c3c3c9f6ca294795105dad6d7513896d0
MD5 bfac75b34b529e9b05dfeda6cfb7aa36
BLAKE2b-256 5682fe1a915370f7cc7dae115f2dcf709e5631cc46d4d8cda053bc552a590e51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9fbd325ba48f304ef4149bbd7f3d55454903aef10bdbbb0266e9883ea4ca3730
MD5 46d1839952c6939bc188f873ae337d10
BLAKE2b-256 3673ae0c40996524ebef34720b0e5432f1b32b8b3fcd909b134af2d85e4b70f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 feaa6c04eb45ecd2205bfc0d453a86b49e904fb9cd0f5206b789069a667e9d78
MD5 a268b3dea4f4075598176df3090fdc7d
BLAKE2b-256 b3df3879d8471619fdd9413f5459bb53c65b9044f077d1e04d0b0b1ac3173bff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71e7f1ca14407cabe152449a4bb7b033db8128bcf292940cf0785b3a45d8cc20
MD5 7fce01a29bba22bb6236e7b4d35b4d43
BLAKE2b-256 11da6d8872f2d20f9d65a0b451a7bfbf304360ee5f40244ad161c3f13ea6ec36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 403.3 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.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0f729ff31051a62a681d1cdb42433a50a49d15cf5148869f0efa2f6f4041b1ec
MD5 8166626b049e5ff109fda2d3ab3591be
BLAKE2b-256 3e9c1ddf0bd4dbf1f3f0c2acde68af360b12c89f9b267364b1d042df777d91f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45a19e67ea58703acd6daa9270885b658f3e9792060544792512edccdebabceb
MD5 d7800f1536051e23d79eb338d9123f2a
BLAKE2b-256 6e4d4a1b6e5f104e27ae10ae83b9b7ecd5b43c7454f4e5bfadd42a7e14c04518

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bfdc931f0517bac3e18081bdc9e5ea8033d2e50ab3ac5852591fc4f78c3193e1
MD5 b661cbcc8c73995b0b9995cabbee0b6b
BLAKE2b-256 302b08ae38057650be9ea4cdbdedb6db877170cdff06a4266e194b9ac01a6744

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1dd2450591eede0727a04632a60b441913945137fe2369c5a6a44212bfd8885
MD5 6df4b09ecfec54b3fcfb3cdcda9c25b4
BLAKE2b-256 d07950a097cd57389e7c145b24933e5dbcf9dfd98897a86b9d58b906420bd3a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 405.9 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.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5cdba6b762b1913a0512e1204f6df5b175b38da3815764d418ca9410a3421efd
MD5 942d9be0e51ed914f75828da6efa77af
BLAKE2b-256 b27de8d9a15bdd76c2ea1177958f11df0156fd45fbe926736062529d8ad8e2e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41bb24b472176b2b15646958543e871bf7b1fbc10b1b800f3604edf40ad30a56
MD5 14061629ecf86526e4f32ce9e517e90e
BLAKE2b-256 c1a277a59e1812c213c898456464e24b575003a80cfa4cd1a3fa3cb27172277c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 345ace4ce7212857bc70607817fd909a090c406f7e57df3c5133cd69614934a3
MD5 75f32ec5bc7a6c5fb8d689f647cf7c3d
BLAKE2b-256 3cdde58be95fed8e210c22a420684420e4b7d02a266b375f90dff5596a2b2569

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bcbb69b3c9afb123e54618cd453a25ef16f1817fef484afe6c693bd1ec63a3e6
MD5 3fb2b4df16abed395d90ba60477b3441
BLAKE2b-256 401f13ffceb3ae6a6e8b0800b5d2e5e42413c638bdf90cc67d3bb411157a5f33

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