Skip to main content

Unofficial Python client for the Bay Wheels bike-share API

Project description

bay-wheels

An unofficial Python client for the Bay Wheels bike-share API. Supports authentication, station lookup, bike availability, and reservations. Mostly vibe coded; use at your own risk.

Installation

uv add bay-wheels

Usage

import asyncio
from bay_wheels import BayWheelsClient

async def main():
    async with BayWheelsClient() as client:
        # Authenticate via SMS
        await client.request_code("+14155551234")
        code = input("Enter code: ")
        await client.login("+14155551234", code)

        # List stations
        stations = await client.list_stations()
        for station in stations[:5]:
            print(f"{station.name}: {station.ebikes_available} e-bikes")

        # Get bikes at a station
        bikes = await client.get_station_bikes(stations[0].id)
        for bike in bikes:
            print(f"  Bike {bike.bike_id}: {bike.estimated_range_miles} mi")

        # Reserve a bike
        reservation = await client.create_reservation(stations[0].id)
        print(f"Reserved: {reservation.ride_id}")

        # Cancel reservation
        await client.cancel_reservation(reservation.ride_id)

asyncio.run(main())

License

MIT

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

bay_wheels-0.1.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

bay_wheels-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file bay_wheels-0.1.0.tar.gz.

File metadata

  • Download URL: bay_wheels-0.1.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.29

File hashes

Hashes for bay_wheels-0.1.0.tar.gz
Algorithm Hash digest
SHA256 166d7070ae11a4a2f6457a0b700f7357d719c56f9715bcbc83a397cb5739421c
MD5 3856d934dcaeb41be7d616c181810c79
BLAKE2b-256 996bc02b4c672a3d67e490b4a602abc0c9691e8b5838025f24cc2c12036dbca3

See more details on using hashes here.

File details

Details for the file bay_wheels-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bay_wheels-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.29

File hashes

Hashes for bay_wheels-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faead7c8ee61da8a0d323d9e997bfe8038a941f65bfe98eb491f2c33a8c7fd12
MD5 c64cf57cd7ab82476ce3c08af8697beb
BLAKE2b-256 e15f721ce88ea5620f931b23bc2c16882bf48d01eb9417c31ecad8df5d8bc5b3

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