farepy.batch#
Batch flight search – cartesian combinations and file parsing.
Functions
|
Parse a batch file and run all searches. |
|
Run a cartesian product of legs x departure_dates x return_dates. |
|
Parse a batch file into search parameter dicts. |
- farepy.batch.batch_from_file(file_content, *, sources=None, currency='EUR', adults=1, non_stop=None, max_results=50, use_cache=True, cache_dir=None, cache_ttl_hours=24)[source]#
Parse a batch file and run all searches.
- farepy.batch.batch_search(legs, departure_dates, *, return_dates=None, sources=None, currency='EUR', adults=1, non_stop=None, max_results=50, use_cache=True, cache_dir=None, cache_ttl_hours=24)[source]#
Run a cartesian product of legs x departure_dates x return_dates.
Each combination is searched sequentially to respect API rate limits. Caching ensures repeated combinations are not re-queried.
- Parameters:
legs (
list[str]) – List of IATA pairs, e.g. [“MRS-REK”, “CDG-KEF”]return_dates (
list[str] |None) – List of YYYY-MM-DD dates (None for one-way)sources (
list[str] |None) – Which sources to query (None = all available)currency (
str) – ISO 4217 currency codeadults (
int) – Number of adult travelersmax_results (
int) – Max results per source per searchuse_cache (
bool) – Use cached resultscache_ttl_hours (
float) – Cache TTL
- Return type:
- Returns:
List of SearchResult dicts, one per combination.