bart api wrapper in python, using json (small bug fix)
Project description
BART API Wrapper for Python 3+ (w/ JSON)
Bart API Documentation: https://api.bart.gov/docs/overview/index.aspx
Every amenity from the Bay Area Rapid Transit (BART) API is implemented in some way. The methods sections below shows the available methods. The majority of these methods will print something to terminal instead of returning values.
Use the help class methods to see what the syntax is for invoking a bart command.
For example, the general help function:
Input
bart = Bart() # note that key defaults to BART API's universal key
bart.help()
Output
Commands: help, routes, routeinfo
route_help(), routes(), route_info()
Commands: bsa, count, elev, help
bsa(), train_count(), elev(), elev_help()
Commands: etd, help
etd(), etd_help()
Commands: help, stns, stninfo
stn_help(), stninfo(), stnaccess(), stns()
Commands: arrive, depart, fare, help, holiday, routesched, scheds, special, stnsched
arrive(), depart(), fare(), sched_help(), holiday(), routesched(), scheds(), special(), stnsched()
Also, there is thorough documentation. The following...
help(classname.methodname)
help(classname)
...will give you all of the necessary details about a method or class.
Methods
----- Bart API -----
bart = Bart(key) # key is optional, defaults to universal BART API key
Advisories
-----------
bsa(orig)
train_count()
elev()
elev_help()
Real-Time Estimates
-------------------
etd(orig, plat, direction)
etd_help()
Route Information
-----------------
routeinfo(route_num, sched_num, date)
routes(sched_num, date)
route_help()
Schedule Information
--------------------
arrive(orig, dest time, b, a)
depart(orig, dest, time, b, a)
fare(orig, dest, date, sched)
holiday()
routesched(route, date, time, sched)
scheds()
special()
stnsched(orig, date)
sched_help()
Station Information
-------------------
stn_help()
stninfo(orig)
stnaccess(orig)
stns()
Version Information
-------------------
version()
Installing
There's a package on PyPI.
pip3 install bart-api-ulloa
Just make sure you have python3 and the requests library (don't even need an API key, since BART has a universal key and it's built into this wrapper).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bart_api_ulloa-0.0.1.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a2a48f47e627c882bf5531e4c0141d60d68150142e01b0216bc0578832fe6ce |
|
MD5 | 80fe8cffd86b743c60a2fafce698a528 |
|
BLAKE2b-256 | 587768c2f605e8d8a5462183acfee7e04f658256319ec9837fc0cd07fbb9306f |
Hashes for bart_api_ulloa-0.0.1.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c007f461f2f3d8afab0a463205a5c5d866ffde19e7a5802cd5db3b6244fe60b |
|
MD5 | b5316b52bc9bd836cc815d374d1b3369 |
|
BLAKE2b-256 | 1c13d485068ad2aa421bcdb1b984bfc56c73f0a78a2ac15c28a918b54caf8bd7 |