Skip to content

max-github110331/bushk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quickstart

What does BusHK do?

Remember to install BusHK

pip install bushk

Get data of the bus stop

How can I get data of the bus stop?

  1. Copy or reference code
  2. Run your Python file

Example Code

import bushk


@bushk.runner
async def _stop():
	stop=await bushk.Stops.get("ID OF STOP")
	print(f"{stop.id}: {stop.name['en']}")

Get data of the route

How can I get data of the bus stop?

  1. Copy or reference code
  2. Run your Python file

Example Code

import bushk


@bushk.runner
async def _route():
	route=await bushk.Routes.get("NUMBER OF THE ROUTE", "direction OF THE ROUTE(O, I, OUTBOUND, INBOUND, OB OR IB)(OPTIONAL)", "SERVICE TYPE OF THE ROUTE(1 OR 2)(OPTIONAL)")
	print(f"Route: {route.route}\nNormal: {route.normal}\nBound: {route.bound}")

Check ETA of Bus

How can I get ETA of bus?

  1. Copy or reference code
  2. Run your Python file

Example Code

import bushk


@bushk.runner
async def _eta():
	route=await bushk.Routes.get("NUMBER OF ROUTE WHICH YOU WANT TO CHECK THE ETA OF THE BUS")
	for eta in await bushk.ETA.get_route(route):
		stop=await bushk.Stops.get(route.stops_id[eta.seq])
		print(f"{stop.name['en']}: {eta.arrive_at}({eta.rmk})")

About

取得香港巴士的數據!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages