Skip to main content

A simple Python API for Tile® Bluetooth trackers

Project description

📡 pytile: A simple Python API for Tile® Bluetooth trackers

Travis CI PyPi Version License Code Coverage Maintainability Say Thanks

pytile is a simple Python library for retrieving information on Tile® Bluetooth trackers (including last location and more).

This library is built on an unpublished, unofficial Tile API; it may alter or cease operation at any point.

PLEASE READ: Version 2.0.0 and Beyond

Version 2.0.0 of pytile makes several breaking, but necessary changes:

  • Moves the underlying library from Requests to aiohttp
  • Changes the entire library to use asyncio
  • Makes 3.6 the minimum version of Python required

If you wish to continue using the previous, synchronous version of pytile, make sure to pin version 1.1.0.

Python Versions

pytile is currently supported on:

  • Python 3.6
  • Python 3.7

Installation

pip install pytile

Usage

pytile starts within an aiohttp ClientSession (if you are receiving SSL errors, use ClientSession(connector=TCPConnector(verify_ssl=False)) instead):

import asyncio

from aiohttp import ClientSession

from pytile import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
      # YOUR CODE HERE


asyncio.get_event_loop().run_until_complete(main())

Create a client, initialize it, and get to work:

import asyncio

from aiohttp import ClientSession

from pytile import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
    client = Client("<EMAIL>", "<PASSWORD>", websession)
    await client.async_init()

    # Get all Tiles associated with an account:
    await client.tiles.all()


asyncio.get_event_loop().run_until_complete(main())

Contributing

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. Install the dev environment: make init.
  4. Enter the virtual environment: pipenv shell
  5. Code your new feature or bug fix.
  6. Write a test that covers your new functionality.
  7. Run tests and ensure 100% code coverage: make coverage
  8. Add yourself to AUTHORS.md.
  9. Submit a pull request!

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

pytile-2.0.8.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

pytile-2.0.8-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page