Skip to main content

spacetime-os

Sentinel OS Python SDK -- maritime threat intelligence, vessel tracking, and critical infrastructure security.

Installation

pip install spacetime-os

Or install from source:

git clone https://github.com/spacetime-io/spacetime-os.git
cd spacetime-os/packages/python-sdk
pip install -e .

Quick Start (async)

import asyncio
from spacetime_os import SentinelClient, EventCreate

async def main():
    async with SentinelClient(api_key="sk-...") as client:
        # Submit an AIS position event
        event = EventCreate(
            type="ais_position",
            source="ais-receiver-north",
            data={"mmsi": "211234567", "lat": 59.33, "lon": 18.07, "sog": 12.4},
        )
        result = await client.submit_event(event)
        print(f"Event accepted: {result.event_id}")

        # List recent incidents
        incidents = await client.list_incidents(severity="critical")
        for inc in incidents:
            print(f"[{inc.severity}] {inc.title}")

        # Search vessels
        vessels = await client.search_vessels("NORD STREAM")
        for v in vessels:
            print(f"{v.name} (MMSI: {v.mmsi}, Flag: {v.flag})")

asyncio.run(main())

Quick Start (sync)

Every async method has a _sync counterpart for scripts and notebooks:

from spacetime_os import SentinelClient

client = SentinelClient(api_key="sk-...")

# Get vessel risk assessment
risk = client.get_vessel_risk_sync("211234567")
print(f"Risk: {risk.risk_level} (score: {risk.score})")

# Resolve an incident
client.resolve_incident_sync("inc-abc123", note="False alarm confirmed")

client.close_sync()

API Coverage

Domain Methods
Events submit_event, submit_event_batch, list_events
Incidents list_incidents, get_incident, acknowledge_incident, escalate_incident, resolve_incident
Threat Intelligence query_threats, get_risk_assessment, get_vessel_activity, get_cable_risk
Vessels get_vessel, search_vessels, get_vessel_risk
Assets list_assets
Sensors list_sensors, register_sensor

Error Handling

from spacetime_os import SentinelClient, AuthError, RateLimitError, NotFoundError

client = SentinelClient(api_key="sk-...")

try:
    vessel = await client.get_vessel("999999999")
except AuthError:
    print("Invalid API key")
except NotFoundError:
    print("Vessel not found")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")

Configuration

client = SentinelClient(
    api_key="sk-...",
    base_url="https://oceanapi.ainative.studio/api/v1",  # default
    timeout=30.0,       # HTTP timeout in seconds
    max_retries=3,      # retries on 429/502/503 with exponential backoff
)

License

MIT -- SpaceTime Industries

Release files for spacetime-os 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spacetime-os 1.0.0
File Size Uploaded
spacetime_os-1.0.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spacetime-os 1.0.0
File Interpreter ABI Platform
spacetime_os-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size:16.1 kB

Release files / spacetime_os-1.0.0.tar.gz

Download URL spacetime_os-1.0.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1a36e8c61afb5a3976bf7be95f82bc250108a06631ad41a823ae055561875be7
BLAKE2b-256 checksum
How to use checksums
1f0c5c9193e4abfe804755db58aa25a970edb20d4cde1d58c0cec84754cd3230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / spacetime_os-1.0.0-py3-none-any.whl

Download URL spacetime_os-1.0.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da34accdec0eb66eb4c68b21ac3e040793c0bd27f4f49a0f569f523d3fe0cea8
BLAKE2b-256 checksum
How to use checksums
29403155e9db8fdc94b47eec2f106541045ae424ee627700342ee81de3b8a195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page