Metadata-Version: 2.4
Name: aerokit-skybook
Version: 1.0.0
Summary: Object-oriented airline domain library: PNR generation, fare calculation, route/timezone maths, seat allocation and e-ticket building. Built for the SkyBook cloud flight booking application (NCI Cloud Platform Programming).
Author: Zeynep Tuna Akbiyik
License: MIT
Project-URL: Homepage, https://github.com/
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# aerokit

Object-oriented airline domain library built for the SkyBook cloud flight
booking application (MSc Cloud Platform Programming project, NCI).

Install with `pip install aerokit-skybook`, import as `aerokit`.

The library holds the airline business logic that must behave identically in
every part of the system - the Flask web application and the AWS Lambda
ticket generator both depend on it.

## What it provides

- **Airports & routes** - reference data with coordinates and IANA timezones;
  great-circle distances (haversine), block-time estimates, timezone-correct
  local arrival times.
- **PNR** - 6-character booking references from a CSPRNG, with a positional
  checksum character so typos and character swaps are rejected before any
  database lookup.
- **Fares** - a polymorphic pricing engine: `FareCalculator` sums abstract
  `FareComponent` subclasses (base distance fare, fuel surcharge, taxes,
  baggage), so pricing rules can be added without modifying the calculator.
- **Seats** - seat maps generated from layout strings like `"ABC DEF"`, with
  window/aisle-aware allocation and graceful fallback.
- **E-tickets** - a builder that renders a booking into a self-contained
  HTML ticket (or plain text), refusing to build incomplete tickets.

## Example

```python
from aerokit import CabinClass, FareCalculator, PNRGenerator, Route, SeatMap, SeatPreference

route = Route("DUB", "CDG")
quote = FareCalculator().quote(route, CabinClass.ECONOMY, bags=1)
pnr = PNRGenerator().generate()
seat = SeatMap().allocate(occupied=["1A"], preference=SeatPreference.WINDOW)
print(route.duration_str(), quote.total, pnr, seat.label)
```

## Tests

```bash
python -m pytest tests/
```
