All Projects → bachya → Pytile

bachya / Pytile

Licence: mit
📡 A simple Python API for Tile® Bluetooth trackers

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Pytile

IoT-iBeacon
An Ionic app for indoor localization and navigation using BLE iBeacons.
Stars: ✭ 39 (-30.36%)
Mutual labels:  bluetooth, ble
Rubble
(going to be a) BLE stack for embedded Rust
Stars: ✭ 292 (+421.43%)
Mutual labels:  ble, bluetooth
JDY-08
JDY-08 Bluetooth transparent transmission module, with resource for KiCAD
Stars: ✭ 48 (-14.29%)
Mutual labels:  bluetooth, ble
ble-utilities-unreal
This is Unreal Engine plugin that allows to scan for BLE devices with Cycling Power service running, connect to one of them and subscribe for its notifications.
Stars: ✭ 48 (-14.29%)
Mutual labels:  bluetooth, ble
Internalblue
Bluetooth experimentation framework for Broadcom and Cypress chips.
Stars: ✭ 373 (+566.07%)
Mutual labels:  ble, bluetooth
ruuvitag-demo
Demo of reading Bluetooth Low Energy sensor measurements of RuuviTag environmental sensors and feeding them to MQTT, a database and dashboards
Stars: ✭ 14 (-75%)
Mutual labels:  bluetooth, ble
Ble examples
Additional examples to compliment TI's Bluetooth Low Energy Stack offerings.
Stars: ✭ 289 (+416.07%)
Mutual labels:  ble, bluetooth
wx-ant-ble
微信、支付宝小程序BLE蓝牙SDK
Stars: ✭ 75 (+33.93%)
Mutual labels:  bluetooth, ble
Ios Pods Dfu Library
OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
Stars: ✭ 349 (+523.21%)
Mutual labels:  ble, bluetooth
Sweetblue
BLE on Android, the easy way. THIS IS NOW DEPRECATED. Please visit website for info on new versions.
Stars: ✭ 339 (+505.36%)
Mutual labels:  ble, bluetooth
android-ble-made-easy
An Android Library for handling Bluetooth Low Energy on Android Easy
Stars: ✭ 34 (-39.29%)
Mutual labels:  bluetooth, ble
Fastble
Android Bluetooth Low Energy (BLE) Fast Development Framework. It uses simple ways to filter, scan, connect, read ,write, notify, readRssi, setMTU, and multiConnection.
Stars: ✭ 4,409 (+7773.21%)
Mutual labels:  ble, bluetooth
bluetooth-manager
Java Bluetooth Manager. A library/framework for managing bluetooth adapters, bluetooth devices, GATT services and characteristics
Stars: ✭ 75 (+33.93%)
Mutual labels:  bluetooth, ble
IOS-DFU-Library
OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
Stars: ✭ 400 (+614.29%)
Mutual labels:  bluetooth, ble
bluetooth
Android Bluetooth examples
Stars: ✭ 80 (+42.86%)
Mutual labels:  bluetooth, ble
Easybluetooth
一款iOS BLE蓝牙调试工具,非常简单容易,也可以作为一个蓝牙库,快速集成和开发。 可以两步搞定蓝牙开发操作。 第一步连接设备,第二步特征读写数据。
Stars: ✭ 282 (+403.57%)
Mutual labels:  ble, bluetooth
IOsonata
IOsonata multi-platform multi-architecture power & performance optimized software library for fast and easy IoT MCU firmware development. Object Oriented design, no board package to define, just pure plug & play any boards
Stars: ✭ 40 (-28.57%)
Mutual labels:  bluetooth, ble
bluetooth-gatt-parser
Bluetooth GATT service and characteristic parser
Stars: ✭ 61 (+8.93%)
Mutual labels:  bluetooth, ble
Esp32 Ble2mqtt
A BLE to MQTT bridge running on an ESP32
Stars: ✭ 301 (+437.5%)
Mutual labels:  ble, bluetooth
Xamarin Bluetooth Le
Bluetooth LE plugin for Xamarin
Stars: ✭ 419 (+648.21%)
Mutual labels:  ble, bluetooth

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

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.

NOTE: Version 5.0.0

Version 5.0.0 is a complete re-architecture of pytile – as such, the API has changed. Please read the documentation carefully!

Python Versions

pytile is currently supported on:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9

Installation

pip install pytile

Usage

Getting an API Object

pytile usage starts with an aiohttp ClientSession – note that this ClientSession is required to properly authenticate the library:

import asyncio

from aiohttp import ClientSession

from pytile import async_login


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        api = await async_login("<EMAIL>", "<PASSWORD>", session)


asyncio.run(main())

If for some reason you need to use a specific client UUID (to, say, ensure that the Tile API sees you as a client it's seen before) or a specific locale, you can do so easily:

import asyncio

from aiohttp import ClientSession

from pytile import async_login


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        api = await async_login(
            "<EMAIL>", "<PASSWORD>", session, client_uuid="MY_UUID", locale="en-GB"
        )


asyncio.run(main())

Getting Tiles

import asyncio

from aiohttp import ClientSession

from pytile import async_login


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        api = await async_login("<EMAIL>", "<PASSWORD>", session)

        tiles = await api.async_get_tiles()


asyncio.run(main())

The async_get_tiles coroutine returns a dict with Tile UUIDs as the keys and Tile objects as the values.

The Tile Object

The Tile object comes with several properties:

  • accuracy: the location accuracy of the Tile
  • altitude: the altitude of the Tile
  • archetype: the internal reference string that describes the Tile's "family"
  • dead: whether the Tile is inactive
  • firmware_version: the Tile's firmware version
  • hardware_version: the Tile's hardware version
  • kind: the kind of Tile (e.g., TILE, PHONE)
  • last_timestamp: the timestamp at which the current attributes were received
  • latitude: the latitude of the Tile
  • longitude: the latitude of the Tile
  • lost: whether the Tile has been marked as "lost"
  • lost_timestamp: the timestamp at which the Tile was last marked as "lost"
  • name: the name of the Tile
  • uuid: the Tile UUID
  • visible: whether the Tile is visible in the mobile app
import asyncio

from aiohttp import ClientSession

from pytile import async_login


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        api = await async_login("<EMAIL>", "<PASSWORD>", session)

        tiles = await api.async_get_tiles()

        for tile_uuid, tile in tiles.items():
            print(f"The Tile's name is {tile.name}")
            # ...


asyncio.run(main())

In addition to these properties, the Tile object comes with an async_update coroutine which requests new data from the Tile cloud API for this Tile:

import asyncio

from aiohttp import ClientSession

from pytile import async_login


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        api = await async_login("<EMAIL>", "<PASSWORD>", session)

        tiles = await api.async_get_tiles()

        for tile_uuid, tile in tiles.items():
            await tile.async_update()


asyncio.run(main())

Contributing

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. (optional, but highly recommended) Create a virtual environment: python3 -m venv .venv
  4. (optional, but highly recommended) Enter the virtual environment: source ./.venv/bin/activate
  5. Install the dev environment: script/setup
  6. Code your new feature or bug fix.
  7. Write tests that cover your new functionality.
  8. Run tests and ensure 100% code coverage: script/test
  9. Update README.md with any new documentation.
  10. Add yourself to AUTHORS.md.
  11. Submit a pull request!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].