pyalexatodo
An unofficial Python library (and optional CLI) for Alexa to-do and shopping lists. API reverse-engineered by intercepting the Alexa mobile app's HTTP traffic.
Disclaimer: This is an unofficial integration and is not created, endorsed, or supported by Amazon.
Features
- Fetch lists and items (To-Do, Shopping, Custom)
- Add, remove, rename, and toggle items
- Optional CLI interface
- Asynchronous API for integration into other applications
Installation
Install from PyPI:
pip install pyalexatodo
For CLI usage with additional dependencies:
pip install "pyalexatodo[cli]"
CLI Usage
Setup
First, set up your Amazon credentials:
pyalexatodo setup
Commands
pyalexatodo --help
Usage: pyalexatodo [OPTIONS] COMMAND [ARGS]...
╭─ Commands ─────────────────────────────────────────────────────────────────────────────╮
│ setup Command to set up the Alexa Lists CLI with user credentials and preferences. │
│ list Fetch and display all items from a specified Alexa list. │
│ check Toggle the checked status of an item in a specified Alexa list. │
│ add Add a new item to a specified Alexa list. │
│ remove Remove an item from a specified Alexa list. │
│ lists Fetch and display all available Alexa lists. │
╰────────────────────────────────────────────────────────────────────────────────────────╯
Library Usage & API Documentation
See the API documentation for detailed method descriptions.
For are in-depth example including storing of the session information have a look on the cli.py.
Minmal example
import asyncio
from aiohttp import ClientSession
from aioamazondevices.api import AmazonEchoApi
from pyalexatodo.api import AlexaToDoAPI
async def main():
async with ClientSession() as session:
# Authenticate with Amazon
amazon_api = AmazonEchoApi(
client_session=session,
login_email="your-email@example.com",
login_password=input("Enter Password: ")
)
await amazon_api.login.login_mode_interactive(input("Enter 2FA code: "))
# Create To-Do API client
todo_api = AlexaToDoAPI(amazon_api)
# Get lists
lists = await todo_api.get_lists()
print(f"Available lists: {[list.name for list in lists]}")
# Add an item
await todo_api.add_item(lists[0].id, "Buy boba")
# Get items
items = await todo_api.get_list_items(lists[0].id)
print(f"Items: {[i.name for i in items]}")
# Get items in batches (necessary for lists with more than 100 items)
async for batch in todo_api.get_list_items_batched(lists[0].id):
print(f"Batch: {[i.name for i in batch]}")
asyncio.run(main())
Development
Setup
git clone https://github.com/lonlazer/pyalexatodo.git
cd pyalexatodo
uv sync
Testing
uv run pytest
Building
uv build
Contributing
Contributions are welcome! Please follow the conventional commit format prepended by a Gitmoji for commit messages. Make sure everything is formatted using ruff and pytest, ty, ruff checks are passing.
You can use them as command-line tools or via their VS Code extensions. These checks will be enforced by CI/CD as well.
uv run ruff check
uv run ty check
Credits
- aioamazondevices: This library is used for logging in and making authentified API calls to Amazon.
License
This project is licenced under GNU GENERAL PUBLIC LICENSE Version 3.
Metadata
Release files for pyalexatodo 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyalexatodo-0.2.0.tar.gz | 131.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyalexatodo-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 157.2 kB
Release files / pyalexatodo-0.2.0.tar.gz
| Download URL | pyalexatodo-0.2.0.tar.gz |
|---|---|
| Size | 131.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b99858e6f35ca79dbf84dc260051ae44a32ffd34230055419e1311652ae83f11
|
|
BLAKE2b-256 checksum How to use checksums |
edc1c454c9dfcf9f90b9b779f95f588a9d76db51b7e1a5950cea790b5f05b439
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pyalexatodo-0.2.0-py3-none-any.whl
| Download URL | pyalexatodo-0.2.0-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89fddb813eb27074ea1385f8bee007abba350c17a717e7a2ca4d3bba0ee522bb
|
|
BLAKE2b-256 checksum How to use checksums |
f374b6caa15dc126321d19f741a64f1ac4fec24602d5726421ec8e44cdd13945
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|