Backends¶
Both backends inherit all data-access logic from
_EUROCONTROLBase. The only difference is
how a query is executed and what type is returned.
Connection |
SQLAlchemy engine (oracledb thin mode) |
Oracle JDBC over Spark |
Return type |
|
|
Geometry methods |
✓ acc_sf / ansp_sf / es_sf / fir_sf |
✗ (use EUROCONTROLpy then pass GeoDataFrame to polyfill_h3) |
polyfill_h3 |
Pure-Python h3 per row |
PySpark UDF (runs on workers) |
Best for |
Notebooks, interactive, moderate data sizes |
Large-scale production pipelines |
Switching backends¶
Because both classes expose the same method signatures, you can swap them with a single line change:
# Development / notebook
from eurocontrolpy import EUROCONTROLpy
ec = EUROCONTROLpy()
# Production (Spark)
# from eurocontrolpy import EUROCONTROLSpark, build_spark_oracle_session
# spark, url, props = build_spark_oracle_session()
# ec = EUROCONTROLSpark(spark, url, props)
# Everything below works unchanged:
flights = ec.flights_tidy("2024-01-01", "2024-01-02")
so6 = ec.generate_so6(flights.toPandas() if hasattr(flights, "toPandas") else flights)