Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

A python wrapper around the PubliBike API

Project description

⚡️🚲 pypublibike - A python wrapper round the PubliBike API

Upload Python Package

PyPI version

DeepSource

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

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page