一个简单的ListenBrainz Python客户端库
项目描述
liblistenbrainz
liblistenbrainz 是一个用于 ListenBrainz Web API 的简单的Python库。
liblistenbrainz 将帮助您快速从 ListenBrainz 获取数据并向其提交数据。
以下是一个获取ListenBrainz用户收听历史的示例:
import liblistenbrainz
client = liblistenbrainz.ListenBrainz()
listens = client.get_listens(username='iliekcomputers')
for listen in listens:
print("Track name:", listen.track_name)
print("Artist name:", listen.artist_name)
以下是一个如何向ListenBrainz提交收听的快速示例:
import liblistenbrainz
import time
auth_token = input('Please enter your auth token: ')
listen = liblistenbrainz.Listen(
track_name="Fade",
artist_name="Kanye West",
release_name="The Life of Pablo",
listened_at=int(time.time()),
)
client = liblistenbrainz.ListenBrainz()
client.set_auth_token(auth_token)
response = client.submit_single_listen(listen)
更详细的文档可在 Read The Docs 上找到。
特性
liblistenbrainz 提供了对所有 ListenBrainz 端点的便捷访问,自动处理速率限制并支持 ListenBrainz 授权流程。
有关通过 liblistenbrainz 可以使用的 API 端点的详细信息,请参阅 ListenBrainz API 文档。
安装
使用以下命令安装或升级 liblistenbrainz
pip install liblistenbrainz --upgrade
支持
您可以在 freenode #metabrainz 的 IRC 上提问有关如何使用 liblistenbrainz。您也可以通过 iliekcomputers [at] gmail [dot] com
发送电子邮件给我。
如果您发现了错误或有功能请求,请通过创建一个 issue(或 pull request)来告知我。
许可协议
liblistenbrainz - A simple client library for ListenBrainz
Copyright (C) 2020 Param Singh <iliekcomputers@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://gnu.ac.cn/licenses/>.
项目详情
下载文件
下载您平台对应的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。
源代码发行版
liblistenbrainz-0.5.5.tar.gz (33.4 kB 查看哈希值)
构建发行版
liblistenbrainz-0.5.5-py3-none-any.whl (24.3 kB 查看哈希值)
关闭
liblistenbrainz-0.5.5.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 56eb564d0b0dab1b1bf77c01ec95c255fee3d84d51744b31851f2772ac95f41c |
|
MD5 | 5ddeeff69bbbac750a782e31fa69b8b3 |
|
BLAKE2b-256 | 0f4717ba7ad7a8e7c5b2b42d99fbf56c776ab41e1b9feb49e4e271436b2d5c13 |
关闭
liblistenbrainz-0.5.5-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6ffd5ed013c3a4b341a880136ccd5eb683e0a7a8983305f423aaf1b7adbad366 |
|
MD5 | 2bba2225c5b7b428d7eded566793cbde |
|
BLAKE2b-256 | 7915d42d8f28f6f2e4059285d6440c6f6186e5b1b162df96bfff3a985e9804f1 |