Skip to content
master
Switch branches/tags
Code
This branch is 5 commits ahead, 15 commits behind dxmekch:master.
Contribute
Fetch upstream

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

ZRHSpotterTool


discontinued updating the website download feature

The new airport website has a publicly available json file to get the flights directly: dxp-fds.flughafen-zuerich.ch.

Or use the new repository: LSZHMovements


(formerly: mnemocron/ZRHMovementsSpottertool)

This Python script can fetch the full arrival / departure list of the Zürich airport (ZRH). The output format is 'json'. There are multiple lists available. Both the arrivals and depatrures of regular civil flights, as well as both the arrivals and departures of all available flights (including private and freight flights). Typically a regular list contains ~400 flights per day, while a spotter list contains ~450 flights.

Furthermore there is a dict.json that contains further information for given registration numbers. The dict.json also overrides the sorting of special flights.

dxmek.ch/zrharr

currently work in progress: refactoring and porting to Python 3


Usage

Download Timetables

python3 get-zrh.py downloads all available tables

python3 get-zrh.py --today --arrivals only fetch arrivals of today

python3 get-zrh.py --tomorrow --departures only fetch departures of tomorrow

Set the output directory to a place other than ./timetables

python3 get-zrh.py -d ./folder

Filter the special flights

python3 sort-flights.py -a timetables/timetable.arrival.standard.json -b timetables/timetable.arrival.spotter.json -o timetables/timetable.arrival.special.json
python3 sort-flights.py -a timetables/timetable.departure.standard.json -b timetables/timetable.departure.spotter.json -o timetables/timetable.departure.special.json

Pretty Print a table

python3 print-table.py -i timetables/timetable.arrival.special.json -t "Zurich Airport ZRH - Arrivals (special)"

Example Cronjob

Todo


Output Format

The output format is a json file. The structure is taken from the old ZRH website API.

Example:

{
	"timetable":[{
		"airportinformation": {
			"airport_city": "DUBLIN"
		},
		"flightcode": "EI349",
		"masterflight": {
			"registration": "EIDEN"
		}, 
		"scheduled": "20:05", 
		"expected" : "20:20"
	},{
		"airportinformation": {
			"airport_city": ""
		},
		"flightcode": "",
		"masterflight": {
			"registration": ""
		}, 
		"scheduled": "", 
		"expected" : "0"
	}]
}

Requirements

If the cookie headers are not set, the script will fail with AttributeError: 'NoneType' object has no attribute 'tbody'.

Dependencies

Python 3

sudo apt install python3-bs4

About

Webcrawler and filter scripts for ZRH arrivals and departures

Resources

Releases

No releases published

Packages

No packages published