The REST API for BluebirdATC

bluebird-api runs the BluebirdATC digital twin in a server process, such that the simulation will evolve at regular time intervals, and Agents and/or frontend visualization software can interact with it via HTTP requests.
In particular, users can:
- Query available scenario categories and scenarios.
- Load a selected scenario.
- Evolve the simulation by a specified time interval.
- Obtain the current state of the
Environment. - Submit
Actionsto individual aircraft. - Save logfiles with data on all steps of the simulation.
Getting started
The quickest way to start the server is with uv:
uvx bluebird-api@latest
- Open http://localhost:8000 — you should see
"Hello, BluebirdATC!". - Navigate to http://localhost:8000/hmi to open the radar visualisation.
- Select Load new scenario in the top left, choose a scenario type (eg.
Springfield) and scenario (egtest1), and press Load.
This package includes a prebuilt HMI available by navigating to http://localhost:8000/hmi.
Initially, no scenario would be loaded, therefore showing the Bluebird logo on the radar.
To load a scenario, the top left of the window select Load new scenario.
A window will appear in the middle of the screen, select Springfield, then example-scenario and finally, Load.
Note: Running on a remote machine/cloud? Currently, the built version of the app is configured to look for the API running on
localhost. For deploying on remote machines, or a cloud service, it will be necessary to modifysrc/api/config.tsaccordingly, and rebuild vianpm run build.
Using the API
Any language that can make HTTP requests can drive the simulation. The example below is a Python agent that directs each aircraft to its exit fix and cleared flight level as it enters the sector. Install the required packages first:
pip install bluebird-dt requests
from bluebird_dt.core import Environment
import time, requests
callsigns_done = []
while True:
response = requests.get("http://localhost:8000/environment")
environment = Environment.from_json(response.text)
actions_to_issue = []
for aircraft in environment.aircraft.values():
if aircraft.callsign in callsigns_done or aircraft.current_sector != "SPRINGFIELD":
continue
exit_coordination = environment.exit_coordination("SPRINGFIELD", aircraft.callsign)
if exit_coordination is not None:
actions_to_issue.extend(
[
{
"callsign": aircraft.callsign,
"kind": "change_flight_level_to",
"value": exit_coordination.fl,
"sector": "SPRINGFIELD",
"agent": "agent",
},
{
"callsign": aircraft.callsign,
"kind": "route_direct_to",
"value": exit_coordination.fix,
"sector": "SPRINGFIELD",
"agent": "agent",
},
]
)
callsigns_done.append(aircraft.callsign)
if len(actions_to_issue) > 0:
requests.post("http://localhost:8000/actions", json=actions_to_issue)
time.sleep(4)
A more complete multi-language example (including Julia) is in NonPythonAgents.ipynb.
Documentation
Documentation of the endpoints of the API is available by running
uvx bluebird-api@latest
and navigating to http://localhost:8000/docs.
A json format of this API is also available in http://localhost:8000/openapi.json which can be used to generate clients automatically using OpenAPI generators for the language you are using.
Metadata
Release files for bluebird-api 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bluebird_api-0.3.0.tar.gz | 479.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bluebird_api-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 958.7 kB
Release files / bluebird_api-0.3.0.tar.gz
| Download URL | bluebird_api-0.3.0.tar.gz |
|---|---|
| Size | 479.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f584435aa91ecaf0dbc273040e7349b1439de69e96f1ef55737833b100cd7b3
|
|
BLAKE2b-256 checksum How to use checksums |
155b6594365eed0512336c5d4dcdb0dd0c70c74f88c067c84aab8f0511c9070d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / bluebird_api-0.3.0-py3-none-any.whl
| Download URL | bluebird_api-0.3.0-py3-none-any.whl |
|---|---|
| Size | 479.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e69f161f76b0ce19e41629a6536b79d497e21d9adaf4943ca1672540c5a5e196
|
|
BLAKE2b-256 checksum How to use checksums |
11df9787593f34bf209db36ebc72cb1ccae4999234c06c6f9b0770ba7f432c9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for bluebird-api 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.