aiobiketrax


Nameaiobiketrax JSON
Version 1.3.0 PyPI version JSON
download
home_pagehttps://github.com/basilfx/aiobiketrax
SummaryPython library for interacting with the PowUnity BikeTrax GPS tracker.
upload_time2024-05-14 05:59:26
maintainerNone
docs_urlNone
authorBas Stottelaar
requires_python<4.0,>=3.12
licenseMIT
keywords biketrax powunity asyncio iot gps
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aiobiketrax
Python library for interacting with the PowUnity BikeTrax GPS tracker.

[![Linting](https://github.com/basilfx/aiobiketrax/actions/workflows/lint.yml/badge.svg)](https://github.com/basilfx/aiobiketrax/actions/workflows/lint.yml)
[![PyPI version](https://badge.fury.io/py/aiobiketrax.svg)](https://badge.fury.io/py/aiobiketrax)

## Introduction
This library is mainly written to work with a custom component for
Home Assistant. You can find this custom component
[here](https://github.com/basilfx/homeassistant-biketrax).

The [PowUnity BikeTrax](https://powunity.com/) is a GPS tracker for electric
bicycles. It provides real-time updates every when the bike is in motion, using
a 2G modem. It works in Europe, and requires a subscription after a trial
period of one year.

### Features
* Multi-device support.
* Traccar and admin API support.
* Live updates using websocket.

Not implemented:

* Geofencing.
* Global configuration, such as webhooks.

### Known issues
The [schemas](contrib/generator/schema.json) of the models haven been
reversed-engineerd by observing responses for a small number of devices. It is
likely that responses of other devices do not map onto the current models. For
example, some properties are not set if they have never been configured from
the app.

Please open an issue, and provide some responses so that the schemas can be
improved. Be sure to redact sensitive information, such as locations, unique
identifiers and personal details.

### Debugging
In case of issues, it is possible to enable logging in your application for the
following loggers:

* `aiobiketrax.api` - API logging.
* `aiobiketrax.api.responses` - Additional API response logging.
* `aiobiketrax.api.client` - Client interaction logging.

## Usage

### In code
```python
from aiobiketrax import Account

import aiohttp

async with aiohttp.ClientSession() as session:
    account = Account(
        username="someone@example.org",
        password="secret",
        session=session)

    await account.update_devices()

    for device in account.devices:
        print(device.name)
```

### CLI
For demonstration and testing purposes, one can use the CLI as well. If you
have the package installed, use `biketrax --help` command to get started.

### Mock server
For development, a mock server is included in `contrib/mock/`. Simply run
`server.py` and adapt `aiobiketrax/consts.py` to use other endpoints.

```python
API_TRACCAR_ENDPOINT = "http://localhost:5555/traccar/api"
API_ADMIN_ENDPOINT = "http://localhost:5555/admin/api"
```

Do note that authentication is not mocked.

## Contributing
See the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.

## License
See the [`LICENSE.md`](LICENSE.md) file (MIT license).

## Disclaimer
Use this library at your own risk. I cannot be held responsible for any
damages.

This page and its content is not affiliated with PowUnity.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/basilfx/aiobiketrax",
    "name": "aiobiketrax",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "biketrax, powunity, asyncio, iot, gps",
    "author": "Bas Stottelaar",
    "author_email": "basstottelaar@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/58/57/7f43030ef2434d484296b09b2db7655b97b465001ce232c30c731d62d79d/aiobiketrax-1.3.0.tar.gz",
    "platform": null,
    "description": "# aiobiketrax\nPython library for interacting with the PowUnity BikeTrax GPS tracker.\n\n[![Linting](https://github.com/basilfx/aiobiketrax/actions/workflows/lint.yml/badge.svg)](https://github.com/basilfx/aiobiketrax/actions/workflows/lint.yml)\n[![PyPI version](https://badge.fury.io/py/aiobiketrax.svg)](https://badge.fury.io/py/aiobiketrax)\n\n## Introduction\nThis library is mainly written to work with a custom component for\nHome Assistant. You can find this custom component\n[here](https://github.com/basilfx/homeassistant-biketrax).\n\nThe [PowUnity BikeTrax](https://powunity.com/) is a GPS tracker for electric\nbicycles. It provides real-time updates every when the bike is in motion, using\na 2G modem. It works in Europe, and requires a subscription after a trial\nperiod of one year.\n\n### Features\n* Multi-device support.\n* Traccar and admin API support.\n* Live updates using websocket.\n\nNot implemented:\n\n* Geofencing.\n* Global configuration, such as webhooks.\n\n### Known issues\nThe [schemas](contrib/generator/schema.json) of the models haven been\nreversed-engineerd by observing responses for a small number of devices. It is\nlikely that responses of other devices do not map onto the current models. For\nexample, some properties are not set if they have never been configured from\nthe app.\n\nPlease open an issue, and provide some responses so that the schemas can be\nimproved. Be sure to redact sensitive information, such as locations, unique\nidentifiers and personal details.\n\n### Debugging\nIn case of issues, it is possible to enable logging in your application for the\nfollowing loggers:\n\n* `aiobiketrax.api` - API logging.\n* `aiobiketrax.api.responses` - Additional API response logging.\n* `aiobiketrax.api.client` - Client interaction logging.\n\n## Usage\n\n### In code\n```python\nfrom aiobiketrax import Account\n\nimport aiohttp\n\nasync with aiohttp.ClientSession() as session:\n    account = Account(\n        username=\"someone@example.org\",\n        password=\"secret\",\n        session=session)\n\n    await account.update_devices()\n\n    for device in account.devices:\n        print(device.name)\n```\n\n### CLI\nFor demonstration and testing purposes, one can use the CLI as well. If you\nhave the package installed, use `biketrax --help` command to get started.\n\n### Mock server\nFor development, a mock server is included in `contrib/mock/`. Simply run\n`server.py` and adapt `aiobiketrax/consts.py` to use other endpoints.\n\n```python\nAPI_TRACCAR_ENDPOINT = \"http://localhost:5555/traccar/api\"\nAPI_ADMIN_ENDPOINT = \"http://localhost:5555/admin/api\"\n```\n\nDo note that authentication is not mocked.\n\n## Contributing\nSee the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.\n\n## License\nSee the [`LICENSE.md`](LICENSE.md) file (MIT license).\n\n## Disclaimer\nUse this library at your own risk. I cannot be held responsible for any\ndamages.\n\nThis page and its content is not affiliated with PowUnity.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for interacting with the PowUnity BikeTrax GPS tracker.",
    "version": "1.3.0",
    "project_urls": {
        "Homepage": "https://github.com/basilfx/aiobiketrax",
        "Repository": "https://github.com/basilfx/aiobiketrax"
    },
    "split_keywords": [
        "biketrax",
        " powunity",
        " asyncio",
        " iot",
        " gps"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e61f5759ba831cffe543e94d60b8332a91ccb17bd5d5b380005d2fef9c40c6ae",
                "md5": "81e639f8e796dbb10796e6daad7783b3",
                "sha256": "79fbbba4e5469e6123d199723cac305d7eb4e2d39f1c59a2f1ed953657d991c4"
            },
            "downloads": -1,
            "filename": "aiobiketrax-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81e639f8e796dbb10796e6daad7783b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 19550,
            "upload_time": "2024-05-14T05:59:25",
            "upload_time_iso_8601": "2024-05-14T05:59:25.356727Z",
            "url": "https://files.pythonhosted.org/packages/e6/1f/5759ba831cffe543e94d60b8332a91ccb17bd5d5b380005d2fef9c40c6ae/aiobiketrax-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "58577f43030ef2434d484296b09b2db7655b97b465001ce232c30c731d62d79d",
                "md5": "c34179164280dc2159bafd30ae1623d7",
                "sha256": "58f2c2a35b55e1121739c5d1fdafbe7802a9ffddfa79aa15db7e57fc857a529b"
            },
            "downloads": -1,
            "filename": "aiobiketrax-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c34179164280dc2159bafd30ae1623d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 18130,
            "upload_time": "2024-05-14T05:59:26",
            "upload_time_iso_8601": "2024-05-14T05:59:26.764366Z",
            "url": "https://files.pythonhosted.org/packages/58/57/7f43030ef2434d484296b09b2db7655b97b465001ce232c30c731d62d79d/aiobiketrax-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-14 05:59:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "basilfx",
    "github_project": "aiobiketrax",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiobiketrax"
}
        
Elapsed time: 1.90896s