API Reference
- class bixi.bixi.Bixi(session: SyncClientSession)
Bases:
objectClient for the Bixi GraphQL API.
- GRAPHQL_URL
URL of the Bixi GraphQL endpoint.
- classmethod login(username: str, password: str) Bixi
Log into the Bixi API and return an authenticated client.
- Parameters:
username – Bixi account username.
password – Bixi account password.
- Returns:
An authenticated Bixi client.
- Raises:
BixiLoginError – If the login request fails, is rejected, or no session cookie is returned.
- rides(offset: int = 0) list[Ride]
Get the current member’s ride history.
- Parameters:
offset – Number of most-recent rides to skip, for pagination. Defaults to 0, which returns the full ride history.
- Returns:
List of rides, most recent first.
- Raises:
ValueError – If offset is negative.
BixiError – If the request to fetch rides fails.
- exception bixi.bixi.BixiError
Bases:
ExceptionRaised when a Bixi API request fails.
- exception bixi.bixi.BixiLoginError
Bases:
BixiErrorRaised when authenticating with the Bixi API fails.
- class bixi.bixi.Ride(id: str, start_time: datetime, end_time: datetime, price: float, duration: timedelta, start_station_name: str, end_station_name: str)
Bases:
objectA completed Bixi ride.
- id
Unique identifier of the ride.
- Type:
str
- start_time
Date and time the ride started.
- Type:
datetime.datetime
- end_time
Date and time the ride ended.
- Type:
datetime.datetime
- price
Price charged for the ride.
- Type:
float
- duration
Duration of the ride.
- Type:
datetime.timedelta
- start_station_name
Name of the station where the ride started.
- Type:
str
- end_station_name
Name of the station where the ride ended.
- Type:
str