Skip to main content

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):

  1. go to plyr.fm/portal -> "your data" -> "developer tokens"
  2. create a token (you'll authorize via your PDS)
  3. set it in your environment:
export PLYR_TOKEN="your_token_here"

quick start

CLI

# public (no auth required)
plyr list                        # list all tracks

# authenticated (requires PLYR_TOKEN)
plyr my-tracks                   # list your tracks
plyr upload track.mp3 "My Song"  # upload
plyr download 42 -o song.mp3     # download
plyr delete 42 -y                # delete
plyr 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 (with liked state)
upload(file, title, album=None) yes upload a track
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


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.1a0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plyrfm-0.0.1a0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file plyrfm-0.0.1a0.tar.gz.

File metadata

  • Download URL: plyrfm-0.0.1a0.tar.gz
  • Upload date:
  • Size: 8.2 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

Hashes for plyrfm-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 a33e78ffe89d6db31100b8eab1927d13eadae43cfd7c12954289ce1ed70bb900
MD5 ed8be84e3297c8b389cdd400dd020963
BLAKE2b-256 a64708b9c00b950d698ec83451d697bd410941fcc53e157d8b30cc3db95afb77

See more details on using hashes here.

File details

Details for the file plyrfm-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: plyrfm-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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

Hashes for plyrfm-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3843b09f76d1fba098cfc0edb66418ab31c21faaebb6d2bc2c422bd27e37ffd
MD5 85d259e74f4f64b02844a93d595cf1bc
BLAKE2b-256 527ee24a612839dbc917fc936fa48f6173f39de01ec048cbdef45e4d830b9aa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page