https://github.com/eliabieri/pypublibike
⚡️🚲 A Python wrapper around the PubliBike API
https://github.com/eliabieri/pypublibike
Last synced: 4 months ago
JSON representation
⚡️🚲 A Python wrapper around the PubliBike API
- Host: GitHub
- URL: https://github.com/eliabieri/pypublibike
- Owner: eliabieri
- License: mit
- Created: 2019-10-25T14:01:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-11T10:07:34.000Z (over 4 years ago)
- Last Synced: 2026-02-14T23:42:21.997Z (4 months ago)
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
⚡️🚲 pypublibike - A python wrapper round the PubliBike API
===============================

[](https://badge.fury.io/py/pypublibike)
[](https://deepsource.io/gh/eliabieri/pypublibike/?ref=repository-badge)
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
```python
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
```python
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](https://twitter.com/eliabieri)
Todo
------------
* API documentation
* Error handling