Cache
cache
¤
Classes:
Name | Description |
---|---|
FR24Cache |
|
CacheLike |
|
GlobMixin |
|
FlightListRegCache |
|
FlightListFlightCache |
|
FlightListBy |
|
PlaybackCache |
|
TimestampedCache |
|
NearestFlightsCache |
|
FlightDetailsCache |
|
Collection |
A directory containing scannable files. |
File |
|
Attributes:
Name | Type | Description |
---|---|---|
PATH_CACHE |
|
FR24Cache
¤
Methods:
Name | Description |
---|---|
default |
Create a cache in the |
Attributes:
Name | Type | Description |
---|---|---|
path |
|
|
flight_list |
|
|
playback |
|
|
live_feed |
|
|
nearest_flights |
|
|
live_flights_status |
|
|
top_flights |
|
|
flight_details |
|
|
playback_flight |
|
flight_list
instance-attribute
¤
flight_list = FlightListBy(
reg=FlightListRegCache(
Collection(flight_list_dir / "reg")
),
flight=FlightListFlightCache(
Collection(flight_list_dir / "flight")
),
)
live_feed
instance-attribute
¤
live_feed = TimestampedCache(
Collection(path / "feed"), schema=live_feed_schema
)
nearest_flights
instance-attribute
¤
nearest_flights = NearestFlightsCache(
Collection(path / "nearest_flights")
)
live_flights_status
instance-attribute
¤
live_flights_status = TimestampedCache(
Collection(path / "live_flights_status"),
schema=live_flights_status_schema,
)
top_flights
instance-attribute
¤
top_flights = TimestampedCache(
Collection(path / "top_flights"),
schema=top_flights_schema,
)
flight_details
instance-attribute
¤
flight_details = FlightDetailsCache(
Collection(path / "flight_details"),
schema=flight_details_schema,
)
playback_flight
instance-attribute
¤
playback_flight = FlightDetailsCache(
Collection(path / "playback_flight"),
schema=playback_flight_schema,
)
CacheLike
¤
Bases: Protocol
Methods:
Name | Description |
---|---|
get_path |
Get the path to the cached file. |
scan_table |
Lazily load a file from this collection. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
GlobMixin
¤
Bases: CacheLike
Methods:
Name | Description |
---|---|
glob |
Yield all scannable files matching the given pattern. |
get_path |
Get the path to the cached file. |
scan_table |
Lazily load a file from this collection. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
glob
¤
Yield all scannable files matching the given pattern.
FlightListRegCache
¤
Bases: GlobMixin
Methods:
Name | Description |
---|---|
get_path |
|
scan_table |
Lazily load a flight list file from this collection. |
glob |
Yield all scannable files matching the given pattern. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
scan_table
¤
scan_table(
reg: str, *, format: TabularFileFmt = "parquet"
) -> LazyFrame
Lazily load a flight list file from this collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reg
|
str
|
The aircraft registration number (e.g. |
required |
FlightListFlightCache
¤
Bases: GlobMixin
Methods:
Name | Description |
---|---|
get_path |
|
scan_table |
Lazily load a flight list file from this collection. |
glob |
Yield all scannable files matching the given pattern. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
scan_table
¤
scan_table(
flight: str, *, format: TabularFileFmt = "parquet"
) -> LazyFrame
Lazily load a flight list file from this collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flight
|
str
|
The flight number (e.g. |
required |
FlightListBy
¤
Methods:
Name | Description |
---|---|
__call__ |
|
Attributes:
Name | Type | Description |
---|---|---|
reg |
FlightListRegCache
|
|
flight |
FlightListFlightCache
|
|
__call__
¤
__call__(
kind: Literal["reg", "flight"],
) -> FlightListRegCache | FlightListFlightCache
PlaybackCache
¤
Bases: GlobMixin
Methods:
Name | Description |
---|---|
get_path |
|
scan_table |
Lazily load a playback file. |
glob |
Yield all scannable files matching the given pattern. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
scan_table
¤
scan_table(
flight_id: IntoFlightId,
*,
format: TabularFileFmt = "parquet",
) -> LazyFrame
Lazily load a playback file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flight_id
|
IntoFlightId
|
The flight ID of the record. |
required |
TimestampedCache
¤
Bases: GlobMixin
Methods:
Name | Description |
---|---|
get_path |
|
scan_table |
Lazily load a timestamped file. |
glob |
Yield all scannable files matching the given pattern. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
schema |
dict[str, DataType]
|
|
scan_table
¤
scan_table(
timestamp: IntoTimestamp | str,
*,
format: TabularFileFmt = "parquet",
) -> LazyFrame
Lazily load a timestamped file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timestamp
|
IntoTimestamp | str
|
A timestamp-like object, see fr24.utils.to_unix_timestamp. The |
required |
NearestFlightsCache
¤
Bases: GlobMixin
Methods:
Name | Description |
---|---|
get_path |
|
scan_table |
Lazily load a nearest flights file. |
glob |
Yield all scannable files matching the given pattern. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
scan_table
¤
scan_table(
lon: float,
lat: float,
timestamp: IntoTimestamp | str,
*,
format: TabularFileFmt = "parquet",
) -> LazyFrame
Lazily load a nearest flights file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lat
|
float
|
Latitude of the center point. |
required |
lon
|
float
|
Longitude of the center point. |
required |
timestamp
|
IntoTimestamp | str
|
A timestamp-like object, see fr24.utils.to_unix_timestamp. The |
required |
FlightDetailsCache
¤
Bases: GlobMixin
Methods:
Name | Description |
---|---|
get_path |
|
scan_table |
Lazily load a flight details file. |
glob |
Yield all scannable files matching the given pattern. |
Attributes:
Name | Type | Description |
---|---|---|
collection |
Collection
|
|
schema |
dict[str, DataType]
|
|
scan_table
¤
scan_table(
flight_id: IntoFlightId,
timestamp: IntoTimestamp | str,
*,
format: TabularFileFmt = "parquet",
) -> LazyFrame
Lazily load a flight details file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flight_id
|
IntoFlightId
|
The flight ID of the record. |
required |
timestamp
|
IntoTimestamp | str
|
A timestamp-like object, see fr24.utils.to_unix_timestamp. The |
required |
Collection
¤
A directory containing scannable files.
Methods:
Name | Description |
---|---|
new_bare_path |
Returns the bare path (without the file extension) to the file. |
Attributes:
Name | Type | Description |
---|---|---|
path |
Path
|
|
File
¤
Bases: Path
Methods:
Name | Description |
---|---|
scan_table |
Lazily load this file. |
Attributes:
Name | Type | Description |
---|---|---|
format |
TabularFileFmt
|
|