Skip to main content

Python client for Bosch eBike Connect.

Project description

ebike-connect

Python library to get rides and trips from the Bosch eBike Connect platform.

GitHub Workflow Status PyPI PyPI - License PyPI - Downloads

Installation

The package is available on PyPI. Installation is can be done with your favourite package manager. For example:

pip install ebike-connect

Usage

Initialize a client with your username and password:

from ebikeconnect.client import EBikeConnectClient


client = EBikeConnectClient.login("username", "password")

The eBike Connect api provides rides and trips, where a ride is a single uninterrupted ride, and a trip is a collection of rides (all rides on a single day?).

Rides and trips can be listed with the following methods:

def find_rides(
    self, from_datetime: datetime | None = None, to_datetime: datetime | None = None
) -> Iterable[EBikeConnectRide]

This returns an iterable of EBikeConnectRide dataclasses, which have the following fields:

    id: str
    start_time: datetime
    end_time: datetime
    driving_time: timedelta
    type: str
    status: int
    total_distance: float
    title: str
    calories: float
    avg_speed: float
    max_speed: float
def find_trips(
    self, from_datetime: datetime | None = None, to_datetime: datetime | None = None
) -> Iterable[EBikeConnectTrip]:

This returns an iterable of EBikeConnectTrip dataclasses, which have the following fields:

    id: str
    start_time: datetime
    end_time: datetime
    driving_time: timedelta
    type: str
    status: int
    total_distance: float
    ride_ids: list[str]

In addition, ride details (with many additional fields) can be obtained by calling:

def get_ride(self, id: str) -> EBikeConnectRideDetails

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

ebike_connect-0.0.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

ebike_connect-0.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file ebike_connect-0.0.2.tar.gz.

File metadata

  • Download URL: ebike_connect-0.0.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ebike_connect-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7b02648ff502f5f6baed15b1cd609976b74aae423883d2db481aa0a7ae19433e
MD5 0decbfef346f6e64cbfa9925b082b92d
BLAKE2b-256 637b788670c8e1501052445e88bd298c63419ae295ed2f9b088484402b4fac9c

See more details on using hashes here.

File details

Details for the file ebike_connect-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ebike_connect-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ebike_connect-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 caa81ce3debcb28afe089c36368a65dbc914b2f57e074c79fc8c1df3099d8449
MD5 46848960ce8dc35766af78da9ca6187a
BLAKE2b-256 cfa6d51f5742b94017f2c7a19e6822ef14171b869408807a8cf2a6b1770c1117

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