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.2.0.tar.gz (30.5 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.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bay_wheels-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f0eb8151707e50328fa7d068ee33241e1c3f1aa3dcfb9356b4cd77bff461db08
MD5 e19ce5795eab5f615c1cd0bf4fcfa9f8
BLAKE2b-256 8dcc0945d2d47303117747cefe7acfbf12221cfa2b1de4e8e8d78bb68a566274

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bay_wheels-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 015b3c26b721acd22045be778a9547be32201359a0fbfb72eda49e76fa197271
MD5 d69c0f76b4c5a4070f0b184130e8f230
BLAKE2b-256 ddfc55be49172b70ecc88d46fb41a684411b1619530134b32af9fddf60786190

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