Skip to content

Repository files navigation

EVE-API banner

eve-api

CIPythonLicense: MITStatus: Stable

EVE-API is a minimal authenticated HTTP client for EVE (Earth Virtual Expert). It provides login, automatic JWT token refresh, and generic HTTP methods that return plain dicts. There are no domain-specific wrappers or Pydantic models.

EVE-API is part of an initiative by Trillium Technologies and ESA to realize the vision of Earth system predictability (ESP). You can read about the ESP vision here.

Installation

For the development version:

poetry install

or

pip install -e ".[dev]"

Supported Python versions: 3.11–3.14.

Usage

fromeve_apiimportEVEClientasyncwithEVEClient() aseve:
awaiteve.login("user@example.com", "password")
# Generic HTTP methods return parsed JSON (dict/list)me=awaiteve.get("/users/me")
conv=awaiteve.post("/conversations", json={"name": "Test"})
awaiteve.patch(f"/conversations/{conv['id']}", json={"name": "Renamed"})
awaiteve.delete(f"/conversations/{conv['id']}")
# Streaming (yields parsed SSE event dicts)asyncforeventineve.stream(
f"/conversations/{conv_id}/stream_messages",
json={"query": "What is Earth Observation?", "public_collections": ["eve-public"]},
):
ifevent["type"] =="token":
print(event["content"], end="")
# Raw httpx.Response when neededresponse=awaiteve.request("GET", "/health", auth_required=False)
# Direct token accessprint(eve.token)
print(eve.auth_headers)

Configuration

EVEClient is configured via constructor arguments — no environment variables are read.

ArgumentDefaultPurpose
base_urlhttps://api.eve-chat.chatBase URL of the EVE API.
timeout30.0Default request timeout in seconds. Per-call timeouts can be passed to individual methods.

Authentication

login() exchanges email/password for a JWT access token and a refresh token. Tokens are held in memory on the client instance.

Before every authenticated request, the client refreshes the access token if it is within 5 minutes of expiry (default expiry: 1 hour); refresh is lazy, not background. If the refresh token itself has expired, TokenExpiredError is raised and the caller must call login() again.

For unauthenticated endpoints, pass auth_required=False to request().

Examples

See examples/quickstart.py for a runnable script and examples/tutorial.ipynb for a notebook walk-through.

Errors

All errors derive from EVEError. Common subclasses exported from eve_api: AuthenticationError, NotAuthenticatedError, TokenExpiredError, APIError, NotFoundError, ForbiddenError, ValidationError, ServerError, StreamError.

Running tests

pytest

Contributing

See CONTRIBUTING.md for development setup, pre-commit hooks, and PR conventions.

Acknowledgements

Originally created by the GeoSTARS (STARS: Scientific Testing of Agentic Reasoning) team: ( James Walsh, Russell Spiewak, Will Fawcett, Raúl Ramos, and Poliana Santana ). Supported by the ESA Phi-Lab as part of Trillium Technologies Earth Systems Lab ESL.

License

MIT licensed. See LICENSE for the full text.

Copyright

© 2026 Trillium Technologies Ltd.

About

API for ESA EVE (Earth Virtual Expert).

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages