{"id":15631628,"url":"https://github.com/bachya/pytile","last_synced_at":"2025-05-14T12:11:59.223Z","repository":{"id":37925349,"uuid":"109420826","full_name":"bachya/pytile","owner":"bachya","description":"📡 A simple Python API for Tile® Bluetooth trackers","archived":false,"fork":false,"pushed_at":"2025-03-31T06:41:18.000Z","size":1439,"stargazers_count":198,"open_issues_count":8,"forks_count":33,"subscribers_count":10,"default_branch":"dev","last_synced_at":"2025-04-11T20:43:45.454Z","etag":null,"topics":["asyncio","ble","bluetooth","python3","tile"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bachya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-03T16:54:23.000Z","updated_at":"2025-04-07T15:53:19.000Z","dependencies_parsed_at":"2023-02-18T07:45:18.412Z","dependency_job_id":"d9336bf9-6a9e-4f9c-b4f5-cb65a0c455c2","html_url":"https://github.com/bachya/pytile","commit_stats":{"total_commits":235,"total_committers":6,"mean_commits":"39.166666666666664","dds":0.3021276595744681,"last_synced_commit":"4740b23670e9ae49e35d01f547e642ace3c9844a"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Fpytile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Fpytile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Fpytile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Fpytile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bachya","download_url":"https://codeload.github.com/bachya/pytile/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140768,"owners_count":22021220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","ble","bluetooth","python3","tile"],"created_at":"2024-10-03T10:41:02.826Z","updated_at":"2025-05-14T12:11:59.197Z","avatar_url":"https://github.com/bachya.png","language":"Python","funding_links":["https://www.buymeacoffee.com/bachya1208P"],"categories":[],"sub_categories":[],"readme":"# 📡 pytile: A simple Python API for Tile® Bluetooth trackers\n\n[![CI][ci-badge]][ci]\n[![PyPI][pypi-badge]][pypi]\n[![Version][version-badge]][version]\n[![License][license-badge]][license]\n[![Code Coverage][codecov-badge]][codecov]\n[![Maintainability][maintainability-badge]][maintainability]\n\n\u003ca href=\"https://www.buymeacoffee.com/bachya1208P\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n`pytile` is a simple Python library for retrieving information on\n[Tile® Bluetooth trackers][tile] (including last location and more).\n\nThis library is built on an unpublished, unofficial Tile API; it may alter or\ncease operation at any point.\n\n- [Python Versions](#python-versions)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n\n# NOTE: Version 5.0.0\n\nVersion 5.0.0 is a complete re-architecture of `pytile` – as such, the API has changed.\nPlease read the documentation carefully!\n\n# Python Versions\n\n`pytile` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# Installation\n\n```bash\npip install pytile\n```\n\n# Usage\n\n## Getting an API Object\n\n`pytile` usage starts with an [`aiohttp`][aiohttp] `ClientSession` – note that this\nClientSession is required to properly authenticate the library:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pytile import async_login\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        api = await async_login(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session)\n\n\nasyncio.run(main())\n```\n\nIf for some reason you need to use a specific client UUID (to, say, ensure that the\nTile API sees you as a client it's seen before) or a specific locale, you can do\nso easily:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pytile import async_login\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        api = await async_login(\n            \"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session, client_uuid=\"MY_UUID\", locale=\"en-GB\"\n        )\n\n\nasyncio.run(main())\n```\n\n## Getting Tiles\n\n**Tile Premium Required: No**\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pytile import async_login\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        api = await async_login(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session)\n\n        tiles = await api.async_get_tiles()\n\n\nasyncio.run(main())\n```\n\nThe `async_get_tiles` coroutine returns a dict with Tile UUIDs as the keys and `Tile`\nobjects as the values.\n\n### The `Tile` Object\n\nThe Tile object comes with several properties:\n\n- `accuracy`: the location accuracy of the Tile\n- `altitude`: the altitude of the Tile\n- `archetype`: the internal reference string that describes the Tile's \"family\"\n- `dead`: whether the Tile is inactive\n- `firmware_version`: the Tile's firmware version\n- `hardware_version`: the Tile's hardware version\n- `kind`: the kind of Tile (e.g., `TILE`, `PHONE`)\n- `last_timestamp`: the timestamp at which the current attributes were received\n- `latitude`: the latitude of the Tile\n- `longitude`: the latitude of the Tile\n- `lost`: whether the Tile has been marked as \"lost\"\n- `lost_timestamp`: the timestamp at which the Tile was last marked as \"lost\"\n- `name`: the name of the Tile\n- `uuid`: the Tile UUID\n- `visible`: whether the Tile is visible in the mobile app\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pytile import async_login\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        api = await async_login(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session)\n\n        tiles = await api.async_get_tiles()\n\n        for tile_uuid, tile in tiles.items():\n            print(f\"The Tile's name is {tile.name}\")\n            # ...\n\n\nasyncio.run(main())\n```\n\nIn addition to these properties, the `Tile` object comes with an `async_update` coroutine\nwhich requests new data from the Tile cloud API for this Tile:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pytile import async_login\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        api = await async_login(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session)\n\n        tiles = await api.async_get_tiles()\n\n        for tile_uuid, tile in tiles.items():\n            await tile.async_update()\n\n\nasyncio.run(main())\n```\n\n## Getting Premium Tile's History\n\n**Tile Premium Required: Yes**\n\nYou can retrieve a Tile's history by calling its `async_history` coroutine:\n\n```python\nimport asyncio\nfrom datetime import datetime\n\nfrom aiohttp import ClientSession\n\nfrom pytile import async_login\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        api = await async_login(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session)\n\n        tiles = await api.async_get_tiles()\n\n        for tile_uuid, tile in tiles.items():\n            # Define a start and end datetime to get history for:\n            start = datetime(2023, 1, 1, 0, 0, 0)\n            end = datetime(2023, 1, 31, 0, 0, 0)\n            history = await tile.async_history(start, end)\n            # \u003e\u003e\u003e { \"version\": 1, \"revision\": 1, ... }\n\n\nasyncio.run(main())\n```\n\n# Contributing\n\nThanks to all of [our contributors][contributors] so far!\n\n1. [Check for open features/bugs][issues] or [initiate a discussion on one][new-issue].\n2. [Fork the repository][fork].\n3. (_optional, but highly recommended_) Create a virtual environment: `python3 -m venv .venv`\n4. (_optional, but highly recommended_) Enter the virtual environment: `source ./.venv/bin/activate`\n5. Install the dev environment: `script/setup`\n6. Code your new feature or bug fix on a new branch.\n7. Write tests that cover your new functionality.\n8. Run tests and ensure 100% code coverage: `poetry run pytest --cov pytile tests`\n9. Update `README.md` with any new documentation.\n10. Submit a pull request!\n\n[aiohttp]: https://github.com/aio-libs/aiohttp\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/bachya/pytile/test.yml\n[ci]: https://github.com/bachya/pytile/actions\n[codecov-badge]: https://codecov.io/gh/bachya/pytile/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/pytile\n[contributors]: https://github.com/bachya/pytile/graphs/contributors\n[fork]: https://github.com/bachya/pytile/fork\n[issues]: https://github.com/bachya/pytile/issues\n[license-badge]: https://img.shields.io/pypi/l/pytile.svg\n[license]: https://github.com/bachya/pytile/blob/main/LICENSE\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/71eb642c735e33adcdfc/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/pytile/maintainability\n[new-issue]: https://github.com/bachya/pytile/issues/new\n[pypi-badge]: https://img.shields.io/pypi/v/pytile.svg\n[pypi]: https://pypi.python.org/pypi/pytile\n[tile]: https://www.thetileapp.com\n[version-badge]: https://img.shields.io/pypi/pyversions/pytile.svg\n[version]: https://pypi.python.org/pypi/pytile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Fpytile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbachya%2Fpytile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Fpytile/lists"}