No project description provided
Project description
alexa_api
Table of Contents
Installation
pip install alexa-api
Usage
To use the library, first download from https://github.com/adn77/alexa-cookie-cli/releases/tag/v5.0.1
Run the program and go to http://127.0.0.1:8080 to log in your Amazon account and obtain a refresh token.
Here is a sample usage:
import alexa_api
# Define your Alexa refresh token
refresh_token = "your_refresh_token_here"
# Retrieve the list of Alexa devices
devices = alexa_api.get_device_list(refresh_token)
print(devices)
# Make Alexa speak a custom message
alexa_api.execute_command("speak", "Hello, how can I help you?", refresh_token, "Your Echo Dot")
# Send a text command to Alexa (e.g., open a skill)
alexa_api.execute_command("textcommand", "Alexa, open my demo", refresh_token, "Your Echo Dot")
Features
- Get a list of Alexa devices: Retrieve all devices associated with an account using the refresh token.
- Make Alexa Speak: Send a message to Alexa and have it spoken aloud.
- Execute Commands: Simulate real user usage programmatically by sending text-based commands like open a skill.
API Reference
get_device_list(refresh_token)
Parameters:
refresh_token: the refresh token of your account.
execute_command(command_type, command_message, refresh_token, device)
Parameters:
command_type: the type of the command.- Use
speakto let Alexa speak out the text. - Use
textcommandto send a text-based command to Alexa.
- Use
command_message: the message content of the command.- If using
speakcommand:command_messageis the text that will be read out by Alexa. - If using
textcommandcommand:command_messageis the command context that will be sent to Alexa.
- If using
refresh_token: the refresh token of your account.device: (Optional) the device name of the device that you want the command to execute on. If not specified, the first device in the device list will be used by default.
License
alexa-api is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alexa_api-1.0.3.tar.gz.
File metadata
- Download URL: alexa_api-1.0.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63e9aa267cd58df71af9ca54ddac900b9130f9cecd8ba3034eac45cea7fdbd50
|
|
| MD5 |
42d289fe0c91b65fa85a6e05b071ae46
|
|
| BLAKE2b-256 |
13903215b62aa9f7722b02eb5aebb10753974d5a8eaf3a78500df45076bd734e
|
File details
Details for the file alexa_api-1.0.3-py3-none-any.whl.
File metadata
- Download URL: alexa_api-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40dc5bc05dc4aa3bde9816ef17c42c07dd8478bf3da48505cd219d1ce92bc96
|
|
| MD5 |
60ce3b6b84f6f80fa1600f61c8471140
|
|
| BLAKE2b-256 |
7d7c56b5c756d7a4404d62fa679f359b24579d5926d1ad7ff6643072a7f22e9a
|