Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypublibike-3.0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypublibike-3.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pypublibike-3.0.1.tar.gz.

File metadata

  • Download URL: pypublibike-3.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for pypublibike-3.0.1.tar.gz
Algorithm Hash digest
SHA256 310dbc72dbebe6c28fc9b9d40d6fdc52e8f7e9feca466b89c1898139593ec296
MD5 ec1b12ba75239367dfc93c9e71c47429
BLAKE2b-256 309e7c39b9aa684db6134521e213d3e8b059faa5f94893c4cc58728bd83e5e1e

See more details on using hashes here.

File details

Details for the file pypublibike-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: pypublibike-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for pypublibike-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8daf367508359bbca073369d770ac18bf8bf490e32826e897bf4665d625c3a3
MD5 fecb8e293592d1cabc04dfb35abfe01a
BLAKE2b-256 0128f98802afc2b80545d93443238d5350c7d2489957371534523f00ca51ec0e

See more details on using hashes here.

Supported by

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