python sdk for plyr.fm - music streaming on AT Protocol
Project description
plyrfm
python sdk for plyr.fm - music streaming on AT Protocol
installation
uv add plyrfm
# or
pip install plyrfm
authentication
some operations (listing public tracks, getting a track by ID) work without auth.
for authenticated operations (upload, download, delete, my-tracks):
- go to plyr.fm/portal -> "your data" -> "developer tokens"
- create a token (you'll authorize via your PDS)
- set it in your environment:
export PLYR_TOKEN="your_token_here"
quick start
CLI
# install
uvx plyrfm --help
# or: uv tool install plyrfm
# public (no auth required)
plyrfm list # list all tracks
# authenticated (requires PLYR_TOKEN)
plyrfm my-tracks # list your tracks
plyrfm upload track.mp3 "My Song" # upload
plyrfm download 42 -o song.mp3 # download
plyrfm delete 42 -y # delete
plyrfm me # check auth
sync client
from plyrfm import PlyrClient
# public operations (no auth)
client = PlyrClient()
tracks = client.list_tracks()
track = client.get_track(42)
# authenticated operations
client = PlyrClient(token="your_token") # or set PLYR_TOKEN
my_tracks = client.my_tracks()
result = client.upload("song.mp3", "My Song")
client.delete(result.track_id)
async client
import asyncio
from plyrfm import AsyncPlyrClient
async def main():
# public (no auth)
async with AsyncPlyrClient() as client:
tracks = await client.list_tracks()
# authenticated
async with AsyncPlyrClient(token="your_token") as client:
await client.upload("song.mp3", "My Song")
asyncio.run(main())
explicit configuration
from plyrfm import PlyrClient
# pass token directly
client = PlyrClient(token="your_token")
# use staging API
client = PlyrClient(api_url="https://api-stg.plyr.fm")
# both
client = PlyrClient(
token="your_token",
api_url="https://api-stg.plyr.fm",
)
API reference
| method | auth | description |
|---|---|---|
list_tracks(limit=50) |
no | list all public tracks |
get_track(track_id) |
no | get track by ID |
my_tracks(limit=50) |
yes | list your tracks |
upload(file, title, album=None) |
yes | upload a track |
update_track(track_id, title=None, album=None, image=None) |
yes | update track metadata |
download(track_id, output=None) |
yes | download track audio |
delete(track_id) |
yes | delete a track |
me() |
yes | get current user info |
environment variables
| variable | default | description |
|---|---|---|
PLYR_TOKEN |
- | developer token (for authenticated operations) |
PLYR_API_URL |
https://api.plyr.fm |
API base URL |
requirements
- python 3.10+
- developer token from plyr.fm
license
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plyrfm-0.0.1a5.tar.gz
(13.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
plyrfm-0.0.1a5-py3-none-any.whl
(14.4 kB
view details)
File details
Details for the file plyrfm-0.0.1a5.tar.gz.
File metadata
- Download URL: plyrfm-0.0.1a5.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81139d7439174df07b65fa3ec4e4af29408a270ea03ad3b755dda862df867b2c
|
|
| MD5 |
fcb5450a7e53f2fbc071deb7e07c278c
|
|
| BLAKE2b-256 |
7c391a49e9c23b580ddf2fbd68321d972f37f0e9566456d492f8f3846253e4e7
|
File details
Details for the file plyrfm-0.0.1a5-py3-none-any.whl.
File metadata
- Download URL: plyrfm-0.0.1a5-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a8e77166689d339aa0d5806263b0a73017ae3cc883d9a67db00e937d54d253f
|
|
| MD5 |
4c74c8257411e057d9e6b61cc02db04a
|
|
| BLAKE2b-256 |
7867ca02b4a75ac7faf5d042bd74eedceb4ea4d77f0c341958de6fcdcb770227
|