Sentinel OS Python SDK — maritime threat intelligence, vessel tracking, and critical infrastructure security
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spacetime_os-1.0.0.tar.gz.
File metadata
- Download URL: spacetime_os-1.0.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a36e8c61afb5a3976bf7be95f82bc250108a06631ad41a823ae055561875be7
|
|
| MD5 |
dc79c5f3c22fd7986821bd7263512a36
|
|
| BLAKE2b-256 |
1f0c5c9193e4abfe804755db58aa25a970edb20d4cde1d58c0cec84754cd3230
|
File details
Details for the file spacetime_os-1.0.0-py3-none-any.whl.
File metadata
- Download URL: spacetime_os-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da34accdec0eb66eb4c68b21ac3e040793c0bd27f4f49a0f569f523d3fe0cea8
|
|
| MD5 |
989cf6c71f98d1d0a206976f8371bc63
|
|
| BLAKE2b-256 |
29403155e9db8fdc94b47eec2f106541045ae424ee627700342ee81de3b8a195
|