Skip to main content

No project description provided

Project description

alexa_api

PyPI - Version PyPI - Python Version License


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 speak to let Alexa speak out the text.
    • Use textcommand to send a text-based command to Alexa.
  • command_message: the message content of the command.
    • If using speak command: command_message is the text that will be read out by Alexa.
    • If using textcommand command: command_message is the command context that will be sent to Alexa.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alexa_api-1.0.4.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alexa_api-1.0.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file alexa_api-1.0.4.tar.gz.

File metadata

  • Download URL: alexa_api-1.0.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for alexa_api-1.0.4.tar.gz
Algorithm Hash digest
SHA256 59aeaf551394c46a90e66e8c01b81d1462bf471a4bd7e05e8dde0152856b2e52
MD5 c41280c7bf4a739f6fb5522d794e4922
BLAKE2b-256 abc53ce6671bd474ff55c458ec92c3d32c54ef956f31fce189fda53cb0c555d6

See more details on using hashes here.

File details

Details for the file alexa_api-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: alexa_api-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for alexa_api-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eaeabb7472750398b2eebea9be64eb33156776fd37f693427d28aa97ec239cc9
MD5 20ef8509109a2da570e300e5bf7b5c4a
BLAKE2b-256 8650d237f2364fa925e1e0c81e7c9e8c7215283ca73fbdcc5ab6ecdebfdd35b1

See more details on using hashes here.

Supported by

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