Skip to main content

High-performance, embedded spatio-temporal database

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

Uploaded CPython 3.14Windows x86-64

spatio-0.2.8-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (515.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

spatio-0.2.8-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (482.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

spatio-0.2.8-cp314-cp314-macosx_11_0_arm64.whl (436.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

spatio-0.2.8-cp313-cp313-win_amd64.whl (398.6 kB view details)

Uploaded CPython 3.13Windows x86-64

spatio-0.2.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (514.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

spatio-0.2.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (482.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

spatio-0.2.8-cp313-cp313-macosx_11_0_arm64.whl (436.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spatio-0.2.8-cp312-cp312-win_amd64.whl (398.6 kB view details)

Uploaded CPython 3.12Windows x86-64

spatio-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (514.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

spatio-0.2.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (482.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

spatio-0.2.8-cp312-cp312-macosx_11_0_arm64.whl (436.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spatio-0.2.8-cp311-cp311-win_amd64.whl (399.0 kB view details)

Uploaded CPython 3.11Windows x86-64

spatio-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (515.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

spatio-0.2.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (483.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

spatio-0.2.8-cp311-cp311-macosx_11_0_arm64.whl (436.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

spatio-0.2.8-cp310-cp310-win_amd64.whl (400.9 kB view details)

Uploaded CPython 3.10Windows x86-64

spatio-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (518.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

spatio-0.2.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (486.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

spatio-0.2.8-cp310-cp310-macosx_11_0_arm64.whl (439.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

spatio-0.2.8-cp39-cp39-win_amd64.whl (403.7 kB view details)

Uploaded CPython 3.9Windows x86-64

spatio-0.2.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (521.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spatio-0.2.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (489.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

spatio-0.2.8-cp39-cp39-macosx_11_0_arm64.whl (442.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: spatio-0.2.8-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 399.0 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.8-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 279b6c4cc555192747f4ad251ab2263e32ad31f81b5d9257055fdb138fac86b0
MD5 dd13b3c08d5b34d3858e5139088747d7
BLAKE2b-256 792ba9f2d7ec3d06ba88e62e8a656fca45cc8b4521898db4c90624aa51607e0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b91d6ba3dd51d5682d909cb061c4742a5ce6ca3f8c92bb03d9bac368e1e1475
MD5 3cb860c886c802ddab86a542d5fac7f0
BLAKE2b-256 2ddc72f107e5e41cf364eed27f5d17931369f9bb7e8ef26b62403c7c288f8841

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 45ebe7d43dee302cb33ba443282592444e8bf1b6fc9610e6941628e1111197ef
MD5 5e10b5ae534f3ba20eee7637ab8690b7
BLAKE2b-256 f49495f44d02aed32a60dda003c8565dfbefb3e471355329c0b913632a81afee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7cb7276a18f9c83e88dc3f0f77fcc7bd92550725f5f4caa7a41090c98c06ed3
MD5 7cfb2a906801ae56d5684ea9dfd85e89
BLAKE2b-256 a4f73b1376c851887dabce49215564cddd8bc645261f9e6e233fc0737b51dc17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 398.6 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.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4614ee3b8909b5a7038283562486eaf5ee9cea3c5a68f55fe0376e0df6ff3c82
MD5 0a8c9f6cf2f392a24d85079700159b33
BLAKE2b-256 1375164835c00dece689a02d05002f8860f641b7c1df2b26e5d2c2f9e277624b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 11c39d040c924fd585da0b97ba8a77135d3962b0c6545c3df31708e0b0526a72
MD5 46ca045fb4cf5c0189363f57ac14d386
BLAKE2b-256 6640d1d00f485d3b5f195fc4f9206cf945feba66fbc7475bde12785fa2a0e4b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2937da1d46a5cd5ba48deac7dc7769a21dc4bec53417e9d476654bd562c7702f
MD5 4006dc8b72f591b2ac001b10f881978a
BLAKE2b-256 3259737a13706fbc43c3052bae8c6a79594eb3322b493d2e6fd015ed684b7456

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44112bcee1b27960e9f14a4da949de94c272fdfa429ceda11f020ce2ab7f120d
MD5 193f9b09a747c753ecdd002b04e0695c
BLAKE2b-256 59870628dde6fa614b074de90c4034abec2430c04ebd7fafef9ff3d14b24b0ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 398.6 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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6301aba34995343726ceb5451b58a2bfbbf4b8fd638bfd15cdb064415e861d71
MD5 c74dffa56fb3b90a31f1f5ed22f21617
BLAKE2b-256 4efe266eceba82ada6b378df6aa1c0bbe8128ec322dd9d13712edf8d1728f691

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a55e78c418c572e99d1a95fe13ea0509fa05c6d71162571fc0f323394a1d53d5
MD5 52fa2d418d0637fcf6230258f723a4d4
BLAKE2b-256 d59d0e1d9eac7b1633c82a0ae5c00f398a58a03939338ee438435f5c2d671330

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50b135c42e7dcd6494dcff5361be27a243137c5be8a789c714ec7c6b97270054
MD5 5f53ddabfd94da923f8b4491a954f703
BLAKE2b-256 9363d0dc4f8852ca38aea293f5b17815cb5c666e96a52a1ae3a5e738adc7458c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f9338846d3d27de45c5b8e6331ef5429f356472c0510450534c862967a4a013
MD5 1f7ba36a186751b2c798df7f3d8c131f
BLAKE2b-256 87924c3a6d8b9bc246a87549056fde021c8e0f58c51185b485df716cd3972f2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 399.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.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 69f9cb621be5328ea5ff80f1a4f60d8185a4ff0beac77e5fafa282e7f71977a9
MD5 e52c6865bfc52428059ce3fafa5da02f
BLAKE2b-256 79bbace5fad28b8ba067e0b8a75a1af85cf237927e75ea2c8afb4de28f4a1235

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 223d5d7c940382a4187ddd44980f04596e037ffe566449f0503f30593d4be489
MD5 675382bd979b36a72d32172436e31452
BLAKE2b-256 3fa23f09e5ccb325a0151a4e622903dde6203cde45738bdd07a52fb22d03afcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5bd563813815d50239f4938ee5114e875401925f8b0396d1aec31c93bdf0b44d
MD5 ad28b69ae2e8f3443fb58df1f0177133
BLAKE2b-256 55823b9c857a4b3a616b0d4d257b0b38108da846d366a67ce1ba9024a0d758f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a30504abcfec797932af6892660e4c762d8a2d877372a770afcfd243ad256ebf
MD5 63814084d22aecd5cbd21593903da2b0
BLAKE2b-256 68ecccbc92badc88fbd5310dcaff85eb5370df61c13c7731fbb6589d290a75fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 400.9 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.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2d9575eba16def98f695d24d737b05f62efba7e22a1a20d48d388b62f736206d
MD5 49d6b8e3dcfdb81afeff08df1604bb1e
BLAKE2b-256 bd3318582df748924c88f65b169942067fbbc921a59c62d0472363628754d675

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5e34339630dc8239ecd96959756684e22c3c59179f4b88d480b0ef030724230
MD5 b9ae108bb0e5e2733de5822234354d4f
BLAKE2b-256 04b6d26d7716447887d645d823d4cd08c172020265ac812c24487f45889e37bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a33c189451be6a97b1612acfc350bb514c6dfa53c90b43c24a337149c1be7e1c
MD5 20d1247838d2774e355772b6135e06a0
BLAKE2b-256 f9d503d53ec5d1f3af4b2cf822222e8c54b21df754c1f44b6989fd12b9b12a0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c45895f98aba362b73a07b2762b030ee76dc460c4d800d1a6407bf9534dc7788
MD5 159c6cb1f80aefacd146ef6cc1501e6b
BLAKE2b-256 75a4862a2115c6083790afefd924935fbaa0d7087abba16cca9a2b076927cb3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spatio-0.2.8-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 403.7 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.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c06bfd11f77862ea1239bfc12e73e2cbb68cdb07ac71a170a193a1c771baefa7
MD5 bf89d8e913b8969d1f6fe4380454ef9e
BLAKE2b-256 146024928e59058a936fef9ba1bb61e02be0c38d72d3b712a597f6ab2d270af2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e13f58cc4e538d96a60aaed71d51bc41d02df8ecf9d8d146c021feb378f1da4b
MD5 be4039b800a383d71fc7cf299de4565a
BLAKE2b-256 27cdbbbf588902d1774ad265d9939a1d0f7e64306e21afe9c0b12a448c5a2bf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b336d406762724e659b5bb68c59563a92cae32d31660533d8a55aebafa78ede9
MD5 c10770c10ce770af558968d1c230558d
BLAKE2b-256 cfc2856150d52e69d9014fe1c6d2d40ef8b35fdfdc3075f71ec1db9f6643e6a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spatio-0.2.8-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10f0c3fc7de7d95a5a918139d8a6db741786ea7cd9ae8ac6e3ed5e7165f0e73b
MD5 362b3860492a107dee8cfeec56c8749a
BLAKE2b-256 1108b0228915b7f0a2b0ea958e9fb07601cdd111c12a4f47f9940390b742ab54

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