Skip to main content

Python client for Atlas4D - Open 4D Spatiotemporal AI Platform

Project description

Atlas4D Python SDK

Simple Python client for Atlas4D spatiotemporal platform.

Installation

pip install atlas4d

Requires Python 3.9+

Quick Start

Sync Client

from atlas4d import Client

# Connect to Atlas4D
client = Client(host="localhost", port=8090)

# Check health
print(client.health())

# Ask documentation questions (RAG)
answer = client.ask("How do I create a module?")
print(answer.text)
print(f"Sources: {len(answer.sources)}")

# Get observations
obs = client.observations.list(
    lat=42.5, 
    lon=27.5, 
    radius_km=10,
    hours=24
)
print(f"Found {len(obs)} observations")

# Get anomalies
anomalies = client.anomalies.list(hours=24)

Async Client

import asyncio
from atlas4d import AsyncClient

async def main():
    async with AsyncClient() as client:
        # Ask documentation questions
        answer = await client.ask("How do I deploy Atlas4D?")
        print(answer.text)
        
        # Get observations
        obs = await client.observations.list(limit=100)
        print(f"Found {len(obs)} observations")

asyncio.run(main())

Configuration

# Using environment variables
# ATLAS4D_HOST=myserver.com
# ATLAS4D_PORT=8090

client = Client()  # Uses env vars

# Or explicit configuration
client = Client(host="myserver.com", port=8090, timeout=60)

RAG (Documentation Q&A)

Ask questions about Atlas4D documentation in natural language:

# English
answer = client.ask("What is Atlas4D Core?")

# Bulgarian
answer = client.ask("Какво е Atlas4D?", lang="bg")

# With more sources
answer = client.ask("How to deploy?", top_k=5)

# Access sources
for source in answer.sources:
    print(f"- {source['doc_id']}: {source['similarity']:.0%}")

API Reference

Client / AsyncClient

Method Description
health() Check API health
stats() Get platform statistics
ask(question, top_k=3, lang="en") Ask documentation questions

Observations API

Method Description
list(lat, lon, radius_km, hours, limit) List observations
geojson(limit) Get as GeoJSON

Anomalies API

Method Description
list(hours, limit) List anomalies

Changelog

See CHANGELOG.md for version history.

Links

License

Apache 2.0

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

atlas4d-0.3.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

atlas4d-0.3.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file atlas4d-0.3.0.tar.gz.

File metadata

  • Download URL: atlas4d-0.3.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for atlas4d-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f8428f0ae911c9be40d4040fa78ea3f167e06ab31a218b79597c36c78750f26c
MD5 e3a7e2484370897e297befbdc3b5fa74
BLAKE2b-256 f138f0f198156b4633b079f5e426d8c01e9e6ae452a2ec93544d3b6c43f692a5

See more details on using hashes here.

File details

Details for the file atlas4d-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: atlas4d-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for atlas4d-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1bf8a04e391ffaa32a4145c839b9cb4d39cf78673e936b74047841c1e73c06a
MD5 aba4081ba35db408a1d47a342dd899d0
BLAKE2b-256 95b38d0edcf2dd86da3e1a839d5204c96c46db97e067ebf7f9f7ace3378de5e1

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