music on atproto
plyr.fm
1# plyrfm
2
3python SDK and CLI for plyr.fm - available on [PyPI](https://pypi.org/project/plyrfm/) and [GitHub](https://github.com/zzstoatzz/plyr-python-client).
4
5## installation
6
7```bash
8# run directly
9uvx plyrfm --help
10
11# or install as a tool
12uv tool install plyrfm
13
14# or as a dependency (SDK + CLI)
15uv add plyrfm
16```
17
18## authentication
19
20some operations work without auth (listing public tracks, getting a track by ID).
21
22for authenticated operations:
23
241. go to [plyr.fm/portal](https://plyr.fm/portal) -> "your data" -> "developer tokens"
252. create a token
263. `export PLYR_TOKEN="your_token"`
27
28## CLI
29
30```bash
31# public (no auth)
32plyrfm list # list all tracks
33
34# authenticated
35plyrfm my-tracks # list your tracks
36plyrfm upload track.mp3 "My Song" # upload
37plyrfm download 42 -o song.mp3 # download
38plyrfm delete 42 -y # delete
39plyrfm me # check auth
40```
41
42use staging API:
43```bash
44PLYR_API_URL=https://api-stg.plyr.fm plyrfm list
45```
46
47## SDK
48
49```python
50from plyrfm import PlyrClient, AsyncPlyrClient
51
52# public operations (no auth)
53client = PlyrClient()
54tracks = client.list_tracks()
55track = client.get_track(42)
56
57# authenticated operations
58client = PlyrClient(token="your_token") # or set PLYR_TOKEN
59my_tracks = client.my_tracks()
60result = client.upload("song.mp3", "My Song")
61client.delete(result.track_id)
62```
63
64async:
65```python
66async with AsyncPlyrClient(token="your_token") as client:
67 tracks = await client.list_tracks()
68 await client.upload("song.mp3", "My Song")
69```