aiobiketrax


Nameaiobiketrax JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://github.com/basilfx/aiobiketrax
SummaryPython library for interacting with the PowUnity BikeTrax GPS tracker.
upload_time2024-01-01 21:47:44
maintainer
docs_urlNone
authorBas Stottelaar
requires_python>=3.9,<4.0
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": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "biketrax,powunity,asyncio,iot,gps",
    "author": "Bas Stottelaar",
    "author_email": "basstottelaar@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d7/f2/9a9ad538081da5fad4c833384ff793557ec9b6200f8210a07be9fc091bcd/aiobiketrax-1.1.2.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.1.2",
    "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": "2d5ea1f5edcb3d3023d091caf1f4d10961266939153feb3742e72253a127589a",
                "md5": "ba7cd77b077ec8b6ef65b684cc30f17c",
                "sha256": "70dc659af815f032b6eaae72f0b33747ea9081611a8d3fd91c8697239f9db78a"
            },
            "downloads": -1,
            "filename": "aiobiketrax-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba7cd77b077ec8b6ef65b684cc30f17c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 19159,
            "upload_time": "2024-01-01T21:47:43",
            "upload_time_iso_8601": "2024-01-01T21:47:43.278259Z",
            "url": "https://files.pythonhosted.org/packages/2d/5e/a1f5edcb3d3023d091caf1f4d10961266939153feb3742e72253a127589a/aiobiketrax-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7f29a9ad538081da5fad4c833384ff793557ec9b6200f8210a07be9fc091bcd",
                "md5": "c13310ea9d50fb4668ea6273f18c4c51",
                "sha256": "acc8e2f6e96bf49fb9bbde4462e12cd71287e6e0e7c64b55218c6dee065aa7ad"
            },
            "downloads": -1,
            "filename": "aiobiketrax-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c13310ea9d50fb4668ea6273f18c4c51",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 17759,
            "upload_time": "2024-01-01T21:47:44",
            "upload_time_iso_8601": "2024-01-01T21:47:44.439090Z",
            "url": "https://files.pythonhosted.org/packages/d7/f2/9a9ad538081da5fad4c833384ff793557ec9b6200f8210a07be9fc091bcd/aiobiketrax-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 21:47:44",
    "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: 0.18383s