与Bose Soundtouch设备通信的库和CLI

boos的Python项目详细描述


用于Bose SoundTouch (R) API的python库和cli。

能够从命令行使用我的bose soundtouch 10。

并能将其用作家庭助理的库https://home-assistant.io/

成为“我的第一个PIP”套餐:—)

安装

要安装boos python库,只需:

pip install boos

boos需要python>;=3.4。

快速启动

连接到Bose SoundTouch(R)设备并启动预设3

在python中工作:

fromboosimportBoosbooz=Boos("http://boos.fritz.box:8090")booz.preset(3)booz.vol()booz.vol(30)

或者如果您可以在Linux上运行Python3代码:

# create a symbolic link to the cli.py
# and (for now) be sure in cli.py you have the right url defined
sudo ln -s ./boos/cli.py /usr/local/bin/boos
# run
boos
boos set3
boos vol
boos vol 30
或者创建一个virtualenv并创建一些bash文件:

绿脓杆菌 CD Boos pip安装boos

#还有一个bash文件,比如:

#啊!/垃圾箱/垃圾桶

source/home/richard/venv/boos/bin/激活 /home/richard/dev/boos/boos/cli.py“$@”

包装

全部来自https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/#source-distributions

# source dist
python3 setup.py sdist
# creating a universal wheel?
python3 setup.py bdist_wheel

# now setup a local webserver to test
cd dist
python -m SimpleHTTPServer 9000# and in another terminal
# create a python 3 virtual environment venv (all as usual)
virtualenv -p python3 venv
cd venv
source bin/activate
# now in python
python3
>>> from boos import Boos
>>> booz= Boos("http://boos.fritz.box:8090")
>>> booz.preset(3)# setting to preset 3
>>> print(booz.now_playing())# should show current playing song/source
# https://packaging.python.org/en/latest/distributing/#uploading-your-project-to-pypi
#
# create a .pypirc file in home dir
[distutils]
index-servers=
    pypi
    testpypi

[testpypi]repository= https://testpypi.python.org/pypi
username= <your user name goes here>
password= <your password goes here>

[pypi]repository= https://pypi.python.org/pypi
username= <your user name goes here>
password= <your password goes here>
#
# to upload it to testpypi (https://wiki.python.org/moin/TestPyPI)
# first register the project
python setup.py register -r https://testpypi.python.org/pypi
# preferred (given you have username and testpypi as key in .pypirc:
twine upload -r testpypi dist/*
# or
python setup.py sdist upload -r https://testpypi.python.org/pypi
# after upload install via
# search
pip search --index https://testpypi.python.org/pypi boos
# install
pip install -i https://testpypi.python.org/pypi boos

# or to pypi
# preferred:
# first register project
python setup.py register
# preferred (given you have username and testpypi as key in .pypirc:
twine upload -r pypi dist/*
# or
python setup.py sdist upload -r https://pypi.python.org/pypi
# and install
pip install boos

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何拆分字符串(基于各种分隔符),但不保留空格?   解析。Json格式的txt文件和knime中的java   java Spring rest api为什么在rest api调用的响应中更改了数据类型   升华文本3抛出java。lang.ClassNotFoundException,而记事本++不存在   java Android指纹扫描仪在尝试5次后停止工作?   java Android如何设置精确的重复报警?   java如何使用HTTPGET connect为access API输入用户名和密码   java当测试报告显示没有测试失败时,Gradle为什么说“有失败的测试”?   用Gson实现java获取响应   MapReduce程序中函数错误的java不可映射参数   java spring安全性不符合自动代理的条件   java GWT使用异步回调进行同步/阻塞调用   java奇怪的类数组问题无法在jsp中显示   如何在java中使用PrinterJob使用epl打印条形码   java如何在JTable中居中单元格   将Java Mockito测试转换为Kotlin   html Java正则表达式模式匹配到多个相同标记   testCompile中缺少java Gradle(Android)多项目依赖项   在输入提示后输入字符串时发生java FileNotFoundException