Skip to main content

The REST API for BluebirdATC PyPI version BluebirdATC logo

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 Actions to 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
  1. Open http://localhost:8000 — you should see "Hello, BluebirdATC!".
  2. Navigate to http://localhost:8000/hmi to open the radar visualisation.
  3. Select Load new scenario in the top left, choose a scenario type (eg. Springfield) and scenario (eg test1), 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 modify src/api/config.ts accordingly, and rebuild via npm 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.

ProjectBluebird

Metadata

Release files for bluebird-api 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bluebird-api 0.4.0
File Size Uploaded Provenance
bluebird_api-0.4.0.tar.gz 489.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bluebird-api 0.4.0
File Interpreter ABI Platform
bluebird_api-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 977.8 kB

Release files / bluebird_api-0.4.0.tar.gz

Download URL bluebird_api-0.4.0.tar.gz
Size 489.1 kB
Tags Source
SHA-256 checksum
How to use checksums
69af11b2de32475f6bce23ca06e0c6a29128878d3d025a1eba9c57d4ef2c1ddb
BLAKE2b-256 checksum
How to use checksums
ed4224618f8708da67e4921392b63fcafba6b5c59452e3531631840b568ccb7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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.4.0-py3-none-any.whl

Download URL bluebird_api-0.4.0-py3-none-any.whl
Size 488.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
296b0c78458a0de0bb8629ff184ff0838d5c5de75b97817b7e9f86cd5d2bcc83
BLAKE2b-256 checksum
How to use checksums
ae986fc3eed3f30dad9f25fb04988a7b59db32057a01c1806d7050515f17880b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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.4.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page