A python wrapper around the PubliBike API
Project description
⚡️🚲 pypublibike - A python wrapper round the PubliBike API
pypublibike makes it easy to access the PubliBike API in your own Python projects.
Quick Start
$ pip install pypublibike
Examples
Getting a list of all PubliBike stations
from pypublibike import publibike, station
pb = publibike.PubliBike()
for station in pb.getStations():
station.refresh() # refresh load data of station
ebike = station.ebikes[0] # access the bikes/ebikes of the station
ebike.batteryLevel # access information about a bike
Finding the nearest PubliBike station
from pypublibike import publibike, location
pb = publibike.PubliBike()
ourLocation = location.Location(latitude=46.950043, longitude=7.443169)
nearestStation = pb.findNearestStationTo(ourLocation)
nearestStation.refresh()
print(nearestStation.name)
Getting Help
-
Open a issue on GitHub if you run into any problems
-
Contact me on Twitter
Todo
- API documentation
- Error handling
- Add unittests
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
pypublibike-2.1.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for pypublibike-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f03316dbeee6f2bb1fff9281d6acfccec06be4855e0a8c9f4742be5414c85386 |
|
MD5 | 4f5663d5f8ec250c1463628e40ebe809 |
|
BLAKE2b-256 | a4e7b4d7cf507c6dbcacfb54c06e17463031be7fd42bc67f634b26c9b18e6723 |