Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

Contributors Forks Stargazers Issues MIT License


EUROCONTROL logo

eurocontrolpy

A Python client for EUROCONTROL PRISME / Network Manager (NM) trajectory and airspace-profile data stored in Oracle.
Read the docs »  ·  Report Bug  ·  Request Feature


Table of Contents
  1. About The Project
  2. Built With
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Authors
  9. Acknowledgments

About The Project

eurocontrolpy provides an object-oriented Python interface to EUROCONTROL PRISME / NM data. It ships two interchangeable backends that expose the same method surface:

Class Backend Returns
EUROCONTROLpy SQLAlchemy + python-oracledb pandas DataFrames
EUROCONTROLSpark PySpark + Oracle JDBC Spark DataFrames

Key capabilities:

  • Flights — flights_tidy, adrr_flights_tidy
  • Airspace profiles — airspace_profiles_tidy, flights_airspace_profiles_tidy
  • Point profiles & model trajectories — point_profiles_tidy, export_model_trajectory
  • SO6 segment export — generate_so6
  • Airspace geometries — acc_sf, ansp_sf, es_sf, fir_sf (GeoDataFrames, SQLAlchemy only)
  • H3 hexagon polyfill — polyfill_h3 (pandas or Spark UDF)
  • IATA seasons — season_iata, iata_season_for_date
  • OurAirports — airports_oa (no DB required)

(back to top)

Built With

Core

  • Python
  • Pandas
  • SQLAlchemy
  • python-oracledb

Optional

  • PySpark — EUROCONTROLSpark backend
  • GeoPandas — airspace geometry methods
  • H3 — hexagon polyfill
  • GeoPy — accurate geodesic distances

(back to top)

Getting Started

Prerequisites

  • Python ≥ 3.8
  • Access to the EUROCONTROL PRISME / NM Oracle database
  • Credentials in environment variables:
export PRU_DEV_USR="your_user"
export PRU_DEV_PWD="your_password"
export PRU_DEV_DBNAME="hostname:port/servicename"

Installation

pip install eurocontrolpy

Install optional extras as needed:

# Airspace geometries
pip install "eurocontrolpy[geo_shapes]"

# H3 polyfill
pip install "eurocontrolpy[h3]"

# PySpark backend
pip install "eurocontrolpy[spark]"

# Everything at once
pip install "eurocontrolpy[geo,geo_shapes,h3,spark]"

From source:

git clone https://github.com/eurocontrol/eurocontrolpy.git
cd eurocontrolpy
pip install -e ".[dev]"

(back to top)

Usage

pandas backend (recommended for notebooks)

from eurocontrolpy import EUROCONTROLpy

ec = EUROCONTROLpy()   # reads PRU_DEV_* environment variables

# Flight list for one day
flights = ec.flights_tidy("2024-07-01", "2024-07-02")

# Point profiles
traj = ec.point_profiles_tidy("2024-07-01", "2024-07-02", profile="CTFM")

# SO6 segment export
so6 = ec.generate_so6(traj)

# FIR geometries + H3 polyfill at resolution 4
firs   = ec.fir_sf(cfmu_airac=517)
h3_df  = ec.polyfill_h3(firs, resolution=4)

PySpark backend (large-scale pipelines)

from eurocontrolpy import EUROCONTROLSpark, build_spark_oracle_session

spark, url, props = build_spark_oracle_session(jar_path="jars/ojdbc8.jar")
ec = EUROCONTROLSpark(spark=spark, url=url, props=props)

# All methods are identical — return type is Spark DataFrame instead of pandas
flights = ec.flights_tidy("2024-07-01", "2024-07-02")
flights.show(5)

# H3 polyfill runs as a distributed UDF on Spark workers
from eurocontrolpy import EUROCONTROLpy
ec_py = EUROCONTROLpy()
firs  = ec_py.fir_sf(517)                       # geometry fetched via pandas
spark_h3 = ec.polyfill_h3(firs, resolution=4)   # polyfill on Spark
spark_h3.show(5)

spark.stop()

Full API reference and more examples: eurocontrol.github.io/eurocontrolpy

(back to top)

Roadmap

  • Oracle connection via environment variables
  • Flights, airspace profiles and point profile queries
  • SO6 segment export
  • SQLAlchemy / pandas backend (EUROCONTROLpy)
  • ADRR flight list format
  • Airspace geometries with geopandas (acc_sf, ansp_sf, es_sf, fir_sf)
  • H3 hexagon polyfill (polyfill_h3) — pandas and Spark UDF variants
  • IATA season helpers
  • Sphinx documentation with GitHub Actions auto-deploy
  • Async query execution

See the open issues for proposed features and known issues.

(back to top)

Contributing

Contributions are welcome. Please fork the repository and open a pull request.

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push the branch (git push origin feature/my-feature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for details.

(back to top)

Authors

Enrico Spinielli — original concept, R package architecture, data model
Aviation Intelligence Unit · EUROCONTROL
✉ enrico.spinielli@eurocontrol.int

Quinten Goens — Python port, SQLAlchemy backend, H3 polyfill, documentation
Aviation Intelligence Unit · EUROCONTROL
✉ quinten.goens@eurocontrol.int

Project: github.com/eurocontrol/eurocontrolpy

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages