Skip to main content

Python SDK for SpatialFlow - Real-time geospatial automation platform

Project description

SpatialFlow Python SDK

The official Python SDK for SpatialFlow - a real-time geospatial automation platform.

Installation

pip install spatialflow

Development Installation

cd sdks/python
pip install -e ".[dev]"

Quick Start

import asyncio
from spatialflow import SpatialFlow

async def main():
    async with SpatialFlow(api_key="sf_xxx") as client:
        # List geofences
        response = await client.geofences.list()
        for geofence in response.geofences:
            print(f"{geofence.name}: {geofence.id}")

        # Get workspace usage
        usage = await client.workspaces.get_usage()
        print(f"Event units: {usage.event_units}")

asyncio.run(main())

Supported Resources

Resource Methods Description
Geofences CRUD, upload, bulk Manage geofence boundaries
Workflows CRUD, execute, monitor, versioning Automation workflows
Webhooks CRUD, deliveries, DLQ, metrics Webhook endpoints and delivery tracking
Devices CRUD, location updates Device management
Account profile, API keys, metrics, onboarding User account management
Workspaces get, update, usage Workspace settings and usage metrics
Locations ingest, batch, stats Public location ingestion API
Integrations CRUD, test Third-party service connections
Storage presigned URLs, files File upload and management

Features

  • Fully async with aiohttp
  • Automatic retry with exponential backoff
  • Pagination helpers
  • Webhook signature verification
  • Workflow builders for common patterns
  • File upload with streaming (memory efficient)

Error Handling

from spatialflow import SpatialFlow, NotFoundError, ValidationError

async with SpatialFlow(api_key="sf_xxx") as client:
    try:
        geofence = await client.geofences.get("invalid-id")
    except NotFoundError as e:
        print(f"Geofence not found: {e}")
    except ValidationError as e:
        print(f"Invalid request: {e.errors}")

Raw API Access

For advanced use cases, access the generated API clients directly:

async with SpatialFlow(api_key="sf_xxx") as client:
    # Use raw generated API
    response = await client.raw.geofences.apps_geofences_api_list_geofences()

Available via client.raw:

  • geofences, workflows, webhooks, devices, storage, locations, integrations, workspaces, account (also wrapped)
  • authentication, admin, billing, subscriptions, tiles (raw only)

Alpha Notice: This SDK is in alpha (v0.1.0). Some generated APIs (email, system, gpx_simulator, public, default, e2e_test) are not yet exposed. Use the generated client directly for those.

Documentation

Full documentation: docs.spatialflow.io/sdks/python

License

MIT

Project details


Download files

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

Source Distribution

spatialflow-0.2.0.tar.gz (197.3 kB view details)

Uploaded Source

Built Distribution

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

spatialflow-0.2.0-py3-none-any.whl (495.1 kB view details)

Uploaded Python 3

File details

Details for the file spatialflow-0.2.0.tar.gz.

File metadata

  • Download URL: spatialflow-0.2.0.tar.gz
  • Upload date:
  • Size: 197.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for spatialflow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b0742f45ed73a9252a35a02dbd3f2755f0ac1810a92a92a1d555b85b88a1ac2f
MD5 1c6b13f41a72347c6c1e60d3e3d755b3
BLAKE2b-256 60ac6e4f697952797540b90c69ca1b81be5eca47e5fce40724c3d4a8a4314df3

See more details on using hashes here.

File details

Details for the file spatialflow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spatialflow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 495.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for spatialflow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8a377694bbb339dd4d8c569b28ffd4c9b6dc6f88a1450330e3f48e869d51a4
MD5 bd35aee4c85ad593b6d985f6a7b48b9a
BLAKE2b-256 047f49fecbd84ccce2b96b2fca17c4c1dd25ad7b7fffc265f98c8db9b74c6b6e

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