与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使用McClickListener单击了什么元素   Java时间戳在Oracle时间戳中不同情况下存储12 PM的奇怪行为   java无法使用事件总线对运行在不同机器上的垂直体进行通信   java Mockserver:收到请求后进行回调   java无法将Json字符串转换为Map<string,Object>   java如何按升序排列输出?   java视图行,带有oracle键。jbo。在SrCategoryParentIterator中找不到键[300100120394155]   javafxmysql连接示例   java正在等待加载完成   java是否可以将同一个有状态会话bean实例注入多个其他会话bean?   java无法让万向节检测离开或进入区域   使用JavaCV和OpenCV的java提供了dyld:lazy符号绑定失败:找不到符号:__sincos_stret   xml解析无法使用Java读取xml文档   java无法更改工具栏的颜色   javaapachesshd和JSCH   java无法在firebase存储中检索图像url   java问题与executeUpdate   同一应用程序中不同活动之间的java SharedReference