🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

aioweenect

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aioweenect

Asynchronous Python client for the weenect API

1.1.5
PyPI
Maintainers
1

aioweenect

Asynchronous Python client for the weenect API

GitHub Actions PyPi PyPi codecov Downloads

Installation

$ pip install aioweenect

Usage

from aioweenect import AioWeenect

import asyncio

USER = "<YOUR_USER>"
PASSWORD = "<YOUR_PASSWORD>"


async def main():
    """Show example how to get location of your tracker."""
    async with AioWeenect(username=USER, password=PASSWORD) as aioweenect:
        trackers_response = await aioweenect.get_trackers()
        tracker_id = trackers_response["items"][0]["id"]
        tracker_name = trackers_response["items"][0]["name"]

        position_response = await aioweenect.get_position(tracker_id=tracker_id)
        lat = position_response[0]["latitude"]
        lon = position_response[0]["longitude"]
        last_message = position_response[0]["last_message"]
        print(
            f"Location for {tracker_name}: lat: {lat}, lon: {lon}. Last message received: {last_message}"
        )


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts