Datatypes

class flightplandb.datatypes.StatusResponse(message: str, errors: List[str] | None)

Returned for some functions to indicate execution status

message

The message associated with the status returned

Type:

str

errors

A list of any errors raised

Type:

Optional[List[str]]

class flightplandb.datatypes.User(id: int, username: str, location: str | None = None, gravatarHash: str | None = None, joined: datetime | None = None, lastSeen: datetime | None = None, plansCount: int | None = 0, plansDistance: float | None = 0.0, plansDownloads: int | None = 0, plansLikes: int | None = 0)

Describes users registered on the website

id

Unique user identifier number

Type:

int

username

Username

Type:

str

location

User provided location information. None if not available

Type:

Optional[str]

gravatarHash

Gravatar hash based on user's account email address.

Type:

Optional[str]

joined

UTC Date and time of user registration

Type:

Optional[datetime] = None

lastSeen

UTC Date and time the user was last connected

Type:

Optional[datetime] = None

plansCount

Number of flight plans created by the user

Type:

Optional[int]

plansDistance

Total distance of all user's flight plans

Type:

Optional[float]

plansDownloads

Total download count of all user's plans

Type:

Optional[int]

plansLikes

Total like count of all user's plans

Type:

Optional[int]

class flightplandb.datatypes.UserSmall(id: int, username: str, location: str | None = None, gravatarHash: str | None = None)

Describes users registered on the website, with far less info

id

Unique user identifier number

Type:

int

username

Username

Type:

str

location

User provided location information. None if not available

Type:

Optional[str]

gravatarHash

Gravatar hash based on user's account email address.

Type:

Optional[str]

class flightplandb.datatypes.Application(id: int, name: str | None = None, url: str | None = None)

Describes application associated with a flight plan

id

Unique application identifier number

Type:

int

name

Application name

Type:

Optional[str]

url

Application URL

Type:

Optional[str]

class flightplandb.datatypes.Via(ident: str, type: str)

Describes routes to RouteNode s

ident

desc

Type:

str

type

Type of Via; must be one of Via.validtypes

Type:

str

validtypes

Do not change. Valid Via types.

Type:

List[str]

class flightplandb.datatypes.RouteNode(ident: str, type: str, lat: float, lon: float, id: int | None = None, alt: float | None = None, name: str | None = None, via: Via | Dict[str, Any] | None = None)

Describes nodes in Route s

id

For some obscure reason an apparently useless id is included with each node when the node is inside a Track route. Goodness knows why.

Type:

Optional[int]

ident

Node navaid identifier

Type:

str

type

Type of RouteNode; must be one of RouteNode.validtypes

Type:

str

lat

Node latitude in decimal degrees

Type:

float

lon

Node longitude in decimal degrees

Type:

float

alt

Suggested altitude at node

Type:

Optional[float]

name

Node name.

Type:

Optional[str]

via

Route to node.

Type:

Optional[Via]

validtypes

Do not change. Valid RouteNode types.

Type:

List[str]

class flightplandb.datatypes.Route(nodes: List[RouteNode], eastLevels: List[str] | None = None, westLevels: List[str] | None = None)

Describes the route of a Plan

nodes

A list of RouteNode s. A route must have at least 2 nodes.

Type:

List[RouteNode]

eastLevels

Valid eastbound flightlevels. Only used inside a NATS Track.

Type:

Optional[List[str]]

westLevels

Valid westbound flightlevels. Only used inside a NATS Track.

Type:

Optional[List[str]]

class flightplandb.datatypes.Cycle(id: int, ident: str, year: int, release: int)

Navdata cycle

id

FlightPlanDB cycle id

Type:

int

ident

AIP-style cycle id

Type:

str

year

Last two digits of cycle year

Type:

int

release

Cycle release

Type:

int

class flightplandb.datatypes.Plan(fromICAO: str | None, toICAO: str | None, fromName: str | None, toName: str | None, id: int | None = None, flightNumber: str | None = None, distance: float | None = None, maxAltitude: float | None = None, waypoints: int | None = None, likes: int | None = None, downloads: int | None = None, popularity: int | None = None, notes: str | None = None, encodedPolyline: str | None = None, createdAt: datetime | str | None = None, updatedAt: datetime | str | None = None, tags: List[str] | None = None, user: User | None = None, application: Application | None = None, route: Route | None = None, cycle: Cycle | None = None)

A flight plan; the thing this whole API revolves around

id

Unique plan identifier number

Type:

int

fromICAO

ICAO code of the departure airport

Type:

Optional[str]

toICAO

ICAO code of the destination airport

Type:

Optional[str]

fromName

Name of the departure airport

Type:

Optional[str]

toName

Name of the destination airport

Type:

Optional[str]

flightNumber

Flight number of the flight plan

Type:

Optional[str]

distance

Total distance of the flight plan route

Type:

Optional[float]

maxAltitude

Maximum altitude of the flight plan route

Type:

Optional[float]

waypoints

Number of nodes in the flight plan route

Type:

Optional[int]

likes

Number of times the flight plan has been liked

Type:

Optional[int]

downloads

Number of times the flight plan has been downloaded

Type:

Optional[int]

popularity

Relative popularity of the plan based on downloads and likes

Type:

Optional[int]

notes

Extra information about the flight plan

Type:

Optional[str]

encodedPolyline

Encoded polyline of route, which can be used for quickly drawing maps

Type:

Optional[str]

createdAt

UTC Date and time of flight plan creation

Type:

Optional[datetime]

updatedAt

UTC Date and time of the last flight plan edit

Type:

Optional[datetime]

tags

List of flight plan tags

Type:

Optional[List[str]]

user

User associated with the item. None if no user linked

Type:

Optional[User]

application

Application associated with the item. None if no application linked

Type:

Optional[Application]

route

The flight plan route

Type:

Optional[Route]

cycle

Navigation data cycle associated with the item. None if no cycle linked

Type:

Optional[Cycle]

class flightplandb.datatypes.PlanQuery(q: str | None = None, From: str | None = None, to: str | None = None, fromICAO: str | None = None, toICAO: str | None = None, fromName: str | None = None, toName: str | None = None, flightNumber: str | None = None, distanceMin: str | None = None, distanceMax: str | None = None, tags: List[str] | None = None, includeRoute: bool | None = None)

Simple search query.

q

Username, tags and the flight number

Type:

Optional[str]

From

From search query. Search departure ICAO & name

Type:

Optional[str]

to

To search query. Search departure ICAO & name

Type:

Optional[str]

fromICAO

Matches departure airport ICAO

Type:

Optional[str]

toICAO

Matches destination airport ICAO

Type:

Optional[str]

fromName

Matches departure airport name

Type:

Optional[str]

toName

Matches destination airport name

Type:

Optional[str]

flightNumber

Matches flight number

Type:

Optional[str]

distanceMin

Minimum route distance

Type:

Optional[str]

distanceMax

Maximum route distance, with units determined by the X-Units header

Type:

Optional[str]

tags

List of tag names to search

Type:

Optional[List[str]]

class flightplandb.datatypes.GenerateQuery(fromICAO: str, toICAO: str, useNAT: bool | None = True, usePACOT: bool | None = True, useAWYLO: bool | None = True, useAWYHI: bool | None = True, cruiseAlt: float | None = 35000, cruiseSpeed: float | None = 420, ascentRate: float | None = 2500, ascentSpeed: float | None = 250, descentRate: float | None = 1500, descentSpeed: float | None = 250)

Generate plan query.

fromICAO

The departure airport ICAO code

Type:

str

toICAO

The destination airport ICAO code

Type:

str

useNAT

Use Pacific Organized Track System tracks in the route generation

Type:

Optional[bool]

usePACOT

Use Pacific Organized Track System tracks in the route generation

Type:

Optional[bool]

useAWYLO

Use low-level airways in the route generation

Type:

Optional[bool]

useAWYHI

Use high-level airways in the route generation

Type:

Optional[bool]

cruiseAlt

Basic flight profile cruise altitude (altitude)

Type:

Optional[float]

cruiseSpeed

Basic flight profile cruise speed (speed)

Type:

Optional[float]

ascentRate

Basic flight profile ascent rate (climb rate)

Type:

Optional[float]

ascentSpeed

Basic flight profile ascent speed (speed)

Type:

Optional[float]

descentRate

Basic flight profile descent rate (climb rate)

Type:

Optional[float]

descentSpeed

Basic flight profile descent speed (speed)

Type:

Optional[float]

class flightplandb.datatypes.Tag(name: str, description: str | None, planCount: int, popularity: int)

Flight plan tag

name

Tag name

Type:

str

description

Description of the tag. None if no description is available

Type:

Optional[str]

planCount

Number of plans with this tag

Type:

int

popularity

Popularity index of the tag

Type:

int

class flightplandb.datatypes.Timezone(name: str | None, offset: float | None)

Contains timezone information

name

The IANA timezone the airport is located in. None if not available

Type:

Optional[str]

offset

The number of seconds the airport timezone is currently offset from UTC. Positive is ahead of UTC. None if not available

Type:

Optional[float]

class flightplandb.datatypes.Times(sunrise: datetime | str, sunset: datetime | str, dawn: datetime | str, dusk: datetime | str)

Contains relevant times information

sunrise

Time of sunrise

Type:

datetime

sunset

Time of sunset

Type:

datetime

dawn

Time of dawn

Type:

datetime

dusk

Time of dusk

Type:

datetime

class flightplandb.datatypes.RunwayEnds(ident: str, lat: float, lon: float)

Ends of Runway . No duh.

ident

The identifier of the runway end

Type:

str

lat

The latitude of the runway end

Type:

float

lon

The longitude of the runway end

Type:

float

class flightplandb.datatypes.Navaid(ident: str, type: str, lat: float, lon: float, airport: str, runway: str, frequency: float | None, slope: float | None, bearing: float | None, name: str | None, elevation: float, range: float)

Describes a navigational aid

ident

The navaid identifier

Type:

str

type

The navaid type. Must be one of Navaid.validtypes

Type:

str

lat

The navaid latitude

Type:

float

lon

The navaid longitude

Type:

float

airport

The airport associated with the navaid

Type:

str

runway

The runway associated with the navaid

Type:

str

frequency

The navaid frequency in Hz. None if not available

Type:

Optional[float]

slope

The navaid slope in degrees from horizontal used for type GS

Type:

Optional[float]

bearing

The navaid bearing in true degrees. None if not available

Type:

Optional[float]

name

The navaid name. None if not available

Type:

Optional[str]

elevation

The navaid elevation above mean sea level (elevation)

Type:

float

range

The navaid range; units determined by the X-Units header (distance)

Type:

float

validtypes

Do not change. Valid Navaid types.

Type:

List[str]

class flightplandb.datatypes.Runway(ident: str, width: float, length: float, bearing: float, surface: str, markings: List[str], lighting: List[str], thresholdOffset: float, overrunLength: float, ends: List[RunwayEnds], navaids: List[Navaid])

Describes a runway at an Airport

ident

The runway identifier

Type:

str

width

The runway width, with units determined by the X-Units header (length)

Type:

float

length

The runway length, with units determined by the X-Units header (length)

Type:

float

bearing

The runway bearing in true degrees

Type:

float

surface

The runway surface material

Type:

str

markings

List of strings of runway markings

Type:

List[str]

lighting

List of strings of runway lighting types

Type:

List[str]

thresholdOffset

The distance of the displaced threshold from the runway end (length)

Type:

float

overrunLength

The runway overrun length, with units determined by the X-Units header

Type:

float

ends

Two element List containing the location of the two ends of the runway

Type:

List[RunwayEnds]

navaids

List of navaids associated with the current runway

Type:

List[Navaid]

class flightplandb.datatypes.Frequency(type: str, frequency: float, name: str | None)

Holds frequency information

type

The frequency type

Type:

str

frequency

The frequency in Hz

Type:

float

name

The frequency name. None if not available

Type:

Optional[str]

class flightplandb.datatypes.Weather(METAR: str | None, TAF: str | None)

Contains weather reports and predictions

METAR

Current METAR report for the airport

Type:

Optional[str]

TAF

Current TAF report for the airport

Type:

Optional[str]

class flightplandb.datatypes.Airport(ICAO: str, IATA: str | None, name: str, regionName: str | None, elevation: float, lat: float, lon: float, magneticVariation: float, timezone: Timezone, times: Times, runwayCount: int, runways: List[Runway], frequencies: List[Frequency], weather: Weather)

Describes an airport. An oversized dataclass with more information than you'd need in 500 years.

ICAO

The airport ICAO code

Type:

str

IATA

The airport IATA code. None if not available

Type:

Optional[str]

name

The airport name

Type:

str

regionName

The geographical region the airport is located in. None if not available

Type:

Optional[str]

elevation

The airport elevation above mean sea level (elevation)

Type:

float

lat

The airport latitude in degrees

Type:

float

lon

The airport longitude in degrees

Type:

float

magneticVariation

The current magnetic variation/declination at the airport, based on the World Magnetic Model

Type:

float

timezone

The airport timezone information

Type:

Timezone

times

Relevant times at the airport

Type:

Times

runwayCount

The number of runways at the airport

Type:

int

runways

List of runways. Note: each physical runway will appear twice, once from each end

Type:

List[Runway]

frequencies

List of frequencies associated with the airport

Type:

List[Frequency]

weather

Airport weather information

Type:

Weather

class flightplandb.datatypes.Track(ident: str | int, route: Route, validFrom: datetime, validTo: datetime)

Used for NATS and PACOTS tracks

ident

Track identifier; str in NATS, int in PACOTS

Type:

Union[str, int]

route

Route of the track

Type:

Route

validFrom

UTC datetime the track is valid from

Type:

datetime

validTo

UTC datetime the track is valid to

Type:

datetime

class flightplandb.datatypes.SearchNavaid(ident: str, type: str, lat: float, lon: float, elevation: float, runwayIdent: str | None = None, airportICAO: str | None = None, name: float | None = None)

Describes a navigational aid, as returned by the search function

ident

The navaid identifier

Type:

str

type

The navaid type. Must be one of SearchNavaid.validtypes

Type:

str

lat

The navaid latitude

Type:

float

lon

The navaid longitude

Type:

float

elevation

The navaid elevation above mean sea level (elevation)

Type:

float

runwayIdent

The runway associated with the navaid. None if not available

Type:

Optional[str]

airportICAO

The ICAO of the airport associated with the navaid. None if not available

Type:

Optional[str]

name

The navaid name. None if not available

Type:

Optional[float]

validtypes

Do not change. Valid SearchNavaid types

Type:

List[str]