Skip to main content

Airtravel provider for Faker

Acknowlegements

faker_airtravel is a provider for the Faker Python package, and a fork of https://github.com/kennethwsmith/faker_vehicle. I would like to thank the maintainer of that repository, since I used the structure to create this one.

Description

faker_airtravel provides airtravel related fake data for testing purposes. The definition of "fake" in this context really means "random," as the airport codes, cities, and locations are real. However, I make no claims about accuracy, so do not use this as location data!

Installation

Install with pip:

pip install faker_airtravel

Add as a provider to your Faker instance:

from faker import Faker
from faker_airtravel import AirTravelProvider
fake.add_provider(AirTravelProvider)

If you already use faker, you probably know the conventional use is:

fake = Faker()

Airport Object

>>> fake.airport_object()
{'Airport': 'Tocumen International Airport',
'iata': 'PTY',
'icao': 'MPTO',
'City': 'Tocumen',
'State': 'Panama',
'Country': 'Panama'}

>>> fake.airport_name()
'Lisbon Airport'

Airport Codes (IATA and ICAO)

>>> fake.airport_iata()
'LSC'

>>> fake.airport_icao()
'KOKC'

Airlines

>>> fake.airline()
'Sichuan Airlines'

Flight

The flight object is an example of how the data might be combined to create larger structures, and may not be the exact format you need. However it does have the advantage that it will never choose the same 'origin' and 'destination' object.

>>>fake.flight()

{'airline': 'Maya Island Air',
 'origin': {'Airport': 'Noi Bai Airport',
  'iata': 'HAN',
  'icao': 'VVNB',
  'City': 'Hanoi',
  'State': 'Ha Noi',
  'Country': 'Vietnam'},
 'destination': {'Airport': 'Geneva Airport',
  'iata': 'GVA',
  'icao': 'LSGG',
  'City': 'Geneva',
  'State': 'Canton of Geneva',
  'Country': 'Switzerland'},
 'stops': 'non-stop',
 'price': 641}

Metadata

Release files for faker_airtravel 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faker_airtravel 0.4
File Size Uploaded
faker_airtravel-0.4.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for faker_airtravel 0.4
File Interpreter ABI Platform
faker_airtravel-0.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 36.3 kB

Release files / faker_airtravel-0.4.tar.gz

Download URL faker_airtravel-0.4.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1db3115f9ad5ef5b6da914702b00114c0c76695c3ee495fc02ab88b8a6eeae2c
BLAKE2b-256 checksum
How to use checksums
91d6951a3d8c6a6ab42e7c87b0c34c00a742e2ff0b218e5a63b1578f3aa7ab82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release files / faker_airtravel-0.4-py2.py3-none-any.whl

Download URL faker_airtravel-0.4-py2.py3-none-any.whl
Size 18.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7401fdd87ddfec5768dc85f831aa8fa801c4c41c6f607fe6aef423f2f7c4d9bf
BLAKE2b-256 checksum
How to use checksums
c6beffc83029bffdb105d94e0980e21967d50cb6c1b96675547ea56dc5bd8c76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page