How openskynetwork/opensky-api works
This repository is a multi-part client SDK repo for the OpenSky Network API, plus the source for the public documentation site. The main architectural boundary is between the external OpenSky backend and three local deliverables: a Python client, a Java client, and generated docs.
1. External system
- The only real backend dependency is the OpenSky API itself.
- Both SDKs are thin consumers of that API; they do not store data locally or implement their own server.
2. Python client library
- Located under python/.
- Main entry point is opensky_api.py, with example.py showing usage and test_opensky_api.py covering behavior.
- The Python package is the actively maintained implementation and supports OAuth2 client-credentials authentication through a TokenManager.
- It exposes a user-facing API around query methods such as “get states,” returning Python-side objects or structured results.
3. Python data flow
- Application code instantiates OpenSkyApi.
- Optional credentials are loaded from a JSON file and exchanged for OAuth2 tokens.
- Requests go to OpenSky over HTTP via requests.
- API responses are turned into Python objects, then returned to the caller for inspection or downstream processing.
4. Java client library
- Located under java/.
- Maven-based project with pom.xml, tests under src/test, and implementation under src/main/java.
- Main API class is org.opensky.api.OpenSkyApi.
- Model classes include OpenSkyStates and StateVector, with OpenSkyStatesDeserializer handling JSON-to-object conversion.
- The README positions this Java code as an example/legacy implementation rather than the actively maintained SDK.
5. Java data flow
- Caller invokes OpenSkyApi.
- The client performs HTTP calls to OpenSky using OkHttp.
- JSON responses are deserialized into domain objects, especially OpenSkyStates containing a list of StateVector records.
- The consumer works with typed objects rather than raw JSON.
6. Auth model difference
- Python explicitly supports OAuth2 and anonymous fallback with reduced rate limits.
- The repository README does not describe equivalent OAuth2 support for Java, which reinforces the split between the maintained Python SDK and the older Java example.
7. Documentation subsystem
- Under docs/ and docs/free/.
- Built with Sphinx-style structure (conf.py, index.rst, language-specific pages).
- Documentation covers API concepts and endpoint families such as REST state queries, state vectors, flight response, track response, and Trino-related material.
- This is a separate artifact from the SDKs, but it shares the same repository and likely the same release workflow.
8. Publishing / site structure
- .nojekyll and the GitHub Pages-oriented layout suggest the docs are intended for static hosting.
- The docs tree likely produces the public site at the GitHub Pages URL referenced in the README.
9. CI / validation
- .github/workflows/main.yml likely orchestrates build/test checks for the repo.
- The presence of Python and Java tests suggests the workflow validates both SDKs independently.
10. Key architectural boundaries to draw
- Boundary 1: client libraries vs. OpenSky network service.
- Boundary 2: Python SDK vs. Java SDK, with different maturity and auth behavior.
- Boundary 3: code vs. generated documentation.
- Boundary 4: typed model layer (StateVector, OpenSkyStates) vs. raw HTTP/JSON transport.
In diagram form, the repo is best represented as two SDK pipelines feeding the same external OpenSky API, with a separate docs pipeline publishing reference material for those clients and endpoints.
Main entry points: index.rst Docs index · OpenSkyApi.java OpenSkyApi · opensky_api.py OpenSkyApi · main.yml Main workflow
Components 19
External service
The OpenSky backend API consumed by both SDKs.
- OpenSky API · External OpenSky Network HTTP API used by the clients.
Python SDK
Actively maintained Python client library and its usage flow.
- OpenSkyApi · Main Python entry point for querying the API.
python/opensky_api.py - TokenManager · OAuth2 client-credentials and credential handling for Python.
python/opensky_api.py - Example · Small Python usage example.
python/example.py - Python tests · Behavior coverage for the Python client.
python/test_opensky_api.py - Python package · Python deliverable and packaging metadata.
python/pyproject.toml
Java SDK
Maven-based Java client and typed model layer.
- OpenSkyApi · Main Java client entry point.
java/src/main/java/org/opensky/api/OpenSkyApi.java - OpenSkyStates · Typed response container for state vectors.
java/src/main/java/org/opensky/model/OpenSkyStates.java - StateVector · Individual state record used by the Java client.
java/src/main/java/org/opensky/model/StateVector.java - Deserializer · Converts JSON responses into Java domain objects.
java/src/main/java/org/opensky/model/OpenSkyStatesDeserializer.java - Java tests · Tests for the Java client and deserializer.
java/src/test/java/TestOpenSkyApi.java - Maven build · Project build and dependency configuration.
java/pom.xml
Documentation
Sphinx-style documentation sources for the public site.
- Docs index · Top-level Sphinx documentation entry point.
docs/free/index.rst - REST docs · REST endpoint and request documentation.
docs/free/rest.rst - State docs · State-vector and states-response documentation.
docs/free/state-vectors.rst - Track docs · Flight and track response documentation.
docs/free/track-response.rst - Trino docs · Trino-related documentation page.
docs/free/trino.rst
CI / release
Workflow and static hosting markers for validation and publishing.
- Main workflow · GitHub Actions validation workflow for the repository.
.github/workflows/main.yml - Pages marker · GitHub Pages nojekyll marker for static docs hosting.
.nojekyll
Connections 19
- OpenSkyApi → OpenSky API: HTTP queries · Python client sends requests to OpenSky over HTTP.
- TokenManager → OpenSkyApi: auth setup · Token management configures authenticated access for the client.
- Example → OpenSkyApi: usage · Example shows how callers instantiate and use the Python API.
- Python tests → OpenSkyApi: verifies · Python tests cover client behavior.
- OpenSkyApi → OpenSky API: HTTP queries · Java client sends requests to OpenSky over HTTP.
- OpenSkyApi → Deserializer: maps JSON · Client relies on JSON-to-object conversion for responses.
- Deserializer → OpenSkyStates: builds · Deserializer produces the typed response container.
- OpenSkyStates → StateVector: contains · States response wraps a list of state vectors.
- Java tests → OpenSkyApi: verifies · Java tests cover client behavior.
- Java tests → Deserializer: verifies · Java tests cover deserialization behavior.
- Maven build → OpenSkyApi: builds · Maven project builds the Java client implementation.
- Docs index → REST docs: navigates · Docs index links into REST coverage.
- Docs index → State docs: navigates · Docs index links into state-related pages.
- Docs index → Track docs: navigates · Docs index links into track and flight response pages.
- Docs index → Trino docs: navigates · Docs index links into Trino documentation.
- Main workflow → Python tests: runs · CI validates the Python SDK.
- Main workflow → Java tests: runs · CI validates the Java SDK.
- Main workflow → Docs index: builds · CI likely builds the documentation site.
- Pages marker → Docs index: hosts · Static hosting marker supports the generated docs site.