Git Product home page Git Product logo

zrhspottertool's Introduction

ZRHSpotterTool


(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.

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

or

pip install bs4

zrhspottertool's People

Contributors

easyspotting avatar dxmekch avatar mnemocron avatar

Stargazers

LE avatar

Watchers

James Cloos avatar

Forkers

mnemocron

zrhspottertool's Issues

Incorrect parsing of aircrafttype in some departures

Note the "e"

{
    "airportinformation": {
        "airport_city": "COLOGNE"
    },
    "expected": "",
    "flightcode": "NJE 930",
    "masterflight": {
        "aircrafttype": "e",
        "registration": "CSDUB"
    },
    "scheduled": "18:00",
    "status": ""
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.