library to push text message or sond to Google Home.
Project description
Google home push
Library for Python 3.4+ to push text message or audio file with the Google Home.
Installation
pip install googlehomepush
version: 0.0.3
Dependencies
PyChromecast depends on the Python packages gTTS, pychromecast. Make sure you have these dependencies installed using pip install -r requirements.txt
How to use
from googlehomepush import GoogleHome
GoogleHome("LivingRoom").say("test")
GoogleHome("LivingRoom").play("http://www.hubharp.com/web_sound/BachGavotteShort.mp3")
API
GoogleHome(deviceIdentifier, tts_builder = googleTTS_Builder)
Create a new Google Home instance
.
deviceIdentifier
can be the google home name, or its IP.tts_builder
the tss engine to use. Available tts are:googleTTS_Builder
import withfrom googlehomepush.googletts import googleTTS_builder
. Free TTS used by google translate. It's the default enginegooglecloudTTS_builder
import withfrom googlehomepush.googlecloudTTS import googlecloudTTS_builder
. Google cloud TTS engine. See https://cloud.google.com/text-to-speech/docs/reference/libraries to create an account.
.say(text, lang = 'en-US')
Push a message on Google home
text
is the test message to saylang
the text language, default value is 'en'
.play(url, contentType = 'audio/mp3'):
Push a sond to Google home
url
an audio file URLcontentType
the audi file content type
You can play a local file using http_server
from googlehomepush.http_server import serve_file
file_url = serve_file("/path/to/file", "audio/mp3")
GoogleHome("LivingRoom").play(file_url, "audio/mp3")
Maintainers
- Thomas Deblock (@tdeblock)
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
googlehomepush-0.0.3.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for googlehomepush-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac39f11961ca64077f623d6a5e09b1dc475ba7071a1142fa3f6818b71347a743 |
|
MD5 | 8b65c70930719817906217b9a7892499 |
|
BLAKE2b-256 | ff29e6418d1f42f783f1b46b446b33af53d63fc6d65616d86d878cf5c692053f |