Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

OASA Telematics API wrapper for python.

Project description

Pytelematics-oasa

Pytelematics-oasa is a simple API wrapper for python.

Installation

pip install pytelematics-oasa

Requirements: requests

Usage

from pytelematics_oasa import OasaTelematics, Line, Route, Stop

##### Line #####

# example using linecode 962 (A1 ΠΕΙΡΑΙΑΣ-ΒΟΥΛΑ)
line = Line('962')

line.ID        # Α1
line.linecode  # 962
line.name      # ΠΕΙΡΑΙΑΣ - ΒΟΥΛΑ
line.name_en   # PEIRAIAS - VOYLA

line.routes()
line.schedule_days()

##### Route #####

# example using routecode 1884 (845 ΠΕΙΡΑΙΑΣ - ΕΛΕΥΣΙΝΑ, route: ΕΛΕΥΣΙΝΑ ==> ΠΕΙΡΑΙΑΣ)
route = Route('1884')

route.name      # ΕΛΕΥΣΙΝΑ - ΠΕΙΡΑΙΑΣ
route.name_en   # ELEFSINA - PEIRAIAS
route.routecode # 1884

route.stops()
route.bus_location()
route.details()

##### Stop #####

# example using stopcode 400075 (στάση ΗΣΑΠ Ν.ΦΑΛΗΡΟΥ)
stop = Stop('400075')

stop.name     # ΗΣΑΠ Ν.ΦΑΛΗΡΟΥ
stop.name_en  # ISAP.N.FALIROY
stop.lat      # 37.9445913
stop.lng      # 23.6671421
stop.stopcode # 400075

stop.arrivals()

###### Oasa ######

# Use the get method for getting data. 
# 1st arg: action, 2nd~ arg: params
# More info at the documentation page.
# https://oasa-telematics-api.readthedocs.io/en/latest/index.html

oasa = OasaTelematics()

oasa.get('getRoutesForLine', 962)
oasa.get('getClosestStops', 37.9445913, 23.6671421)

# Custom methods
oasa.get_all_lines()
oasa.closest_stops(x, y) 
oasa.linecodes(lineID)

API Documentation

Oasa-Telematics-API

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytelematics-oasa, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size pytelematics_oasa-1.0.0-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytelematics-oasa-1.0.0.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page