A modular library for aircraft simulation, airspace and route visualization, and flight tracking.
Project description
AirSpaceSim
Aircraft Simulation and Airspace Visualization
AirSpaceSim is a simulation-first Python library for modeling aircraft movement in structured airspace and visualizing trajectories on map-based interfaces.
Purpose
AirSpaceSim exists to support:
- trajectory prototyping
- scenario generation for testing and research
- visualization-driven debugging
- repeatable simulation experiments
It is designed to be useful as a standalone simulator.
Scope
Current focus:
- multi-aircraft movement simulation with both legacy thread-per-aircraft mode and scalable batched scheduler mode
- waypoint and route processing (DMS and decimal coordinates)
- map configuration and visualization helpers (Leaflet-compatible)
- JSON-based aircraft state output for downstream tooling
- CLI bootstrap with
airspacesim init
Non-goals:
- operational ATM/UTM control
- certified safety-critical deployment
- full 4D flight dynamics or weather-integrated ops modeling
Installation
From PyPI:
python3 -m venv .venv
source .venv/bin/activate
pip install airspacesim
From source:
git clone https://github.com/sankarebarri/AirSpaceSim.git
cd AirSpaceSim
pip install -e .
Offline-constrained source install (no index access):
pip install --no-build-isolation --no-deps -e .
If a fresh offline venv lacks setuptools, bootstrap it and install editable:
python3 scripts/offline_editable_install.py --venv .venv-offline
Offline install from local wheel:
python3 setup.py sdist bdist_wheel
pip install --no-index --find-links dist airspacesim
PyPI Release Checklist
From repository root:
# 1) clean old artifacts
rm -rf dist build *.egg-info
# 2) run quality gate
pytest -q
ruff check .
# 3) build distributions
python3 -m build
# 4) verify package metadata/rendering
python3 -m twine check dist/*
# 5) upload (requires PYPI_TOKEN in env)
python3 -m twine upload dist/*
Recommended:
- publish first to TestPyPI with
--repository testpypibefore main PyPI. - tag release in git after upload.
- if
python3 -m buildis unavailable in your environment, fallback build is:python3 setup.py sdist bdist_wheel
Quick Start
Initialize project files in your working directory:
airspacesim init
Then run your simulation script (for example examples/example_simulation.py) and open templates/map.html in a browser.
The default generated data files are:
data/map_config.v1.jsondata/airspace_config.jsondata/airspace_data.jsondata/scenario_airspace.v1.jsondata/scenario.v0.1.jsondata/scenario_aircraft.v1.jsondata/inbox_events.v1.jsondata/render_profile.v1.jsondata/aircraft_data.jsondata/aircraft_state.v1.jsondata/trajectory.v0.1.jsondata/ui_runtime.v1.jsondata/aircraft_ingest.json
UI Simulation Test
Run these in separate terminals from your initialized project directory:
python3 examples/example_simulation.py
Optional quick run:
python3 examples/example_simulation.py --max-wait 5
python3 dev_server.py
Then open one of:
http://127.0.0.1:8080/templates/map.htmlhttp://127.0.0.1:8080/airspacesim-playground/templates/map.html(when running simulation fromairspacesim-playground)
Operator controls notes:
- Use
dev_server.pyfor POST support. Static-only servers (for example Live Server on:5500) may return405on/api/events. SET_SPEED.payload.aircraft_idmust be the aircraft ID (for exampleAC800), not callsign (for exampleOPS800).ADD_AIRCRAFTnow skips duplicate aircraft IDs instead of creating duplicate runtime entries.- Speed guardrails apply:
- warning above
700 kt - rejection above
1200 kt(default mode)
- warning above
Simulation Quality Tools
Stress scenario:
python3 -m airspacesim.examples.stress_simulation --aircraft 100 --duration 5 --speed 420
Performance benchmark:
python3 -m airspacesim.examples.benchmark_simulation --aircraft 200 --steps 50 --writes 25
Interoperability export example:
python3 examples/interoperability_export.py
Minimal Runnable Example
from airspacesim.utils.conversions import dms_to_decimal, haversine
wp1 = (16, 15, 0, "N"), (0, 2, 0, "W")
wp2 = (16, 30, 0, "N"), (0, 5, 0, "E")
lat1, lon1 = dms_to_decimal(*wp1[0]), dms_to_decimal(*wp1[1])
lat2, lon2 = dms_to_decimal(*wp2[0]), dms_to_decimal(*wp2[1])
distance_nm = haversine(lat1, lon1, lat2, lon2)
print(round(distance_nm, 2))
Edge-Case Example (Mixed Coordinates)
When creating aircraft routes, a waypoint can already provide decimal coordinates (dec_coords) while another uses DMS (coords). AircraftManager.add_aircraft(...) accepts both patterns and converts DMS waypoints during load.
routes = {
"MIXED_ROUTE": [
{"coords": {"lat": [16, 10, 0, "N"], "lon": [0, 3, 0, "W"]}},
{"dec_coords": [16.45, 0.08]},
]
}
Interoperability
AirSpaceSim can act as a scenario and trajectory producer for:
- conflict modeling pipelines (for example SPECTRA)
- robustness/invariance audit pipelines (for example AIRE)
- language + trajectory paired research workflows
Planned output contracts:
airspacesim.trajectory.v0.1for time-stepped aircraft stateairspacesim.scenario.v0.1for route and airspace definitions
Research vs Production Claims
Research claims:
- suitable for simulation, prototyping, and experimentation workflows
- useful for generating structured trajectory data for algorithm testing
Production claims:
- none at this stage; this repo is not positioned as operational ATM software
Safety and Limitations
- Not an operational separation assurance system
- No regulatory assurance, certification, or operational safety case
- Results depend on scenario design and model assumptions
- Current packaging/docs need consolidation for full out-of-the-box setup
Roadmap
Execution milestones are in new_roadmap.md.
Operational/developer guide is maintained in documentation.md.
Hands-on walkthrough is in docs/tutorial.md.
Ecosystem Compatibility
This project is independently usable and developed as a standalone system. It also supports interoperability with related ATC research tools through versioned data contracts and documented interfaces.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airspacesim-0.1.3.tar.gz.
File metadata
- Download URL: airspacesim-0.1.3.tar.gz
- Upload date:
- Size: 67.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e852df791bc2a55d04bb40559391c78688ab9c25c45a68bb9a0a94377500940e
|
|
| MD5 |
ecd9de0d6a21449cf9a458a65ac93d43
|
|
| BLAKE2b-256 |
37ba38820b3d16997f2d2b32cceac19a6f88329886eb4569e281709768a88f9f
|
File details
Details for the file airspacesim-0.1.3-py3-none-any.whl.
File metadata
- Download URL: airspacesim-0.1.3-py3-none-any.whl
- Upload date:
- Size: 76.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6885d9043549874219096aeed179524ecc75af3a39c5be9aa269e1dea3227e
|
|
| MD5 |
0fa64dd87b56758b57e22116d85f63a4
|
|
| BLAKE2b-256 |
649f116d58cb3bde2b32f85ea16f65c0a9d2a6145dd31d66eca96e9ed52fdf25
|