Skip to main content

Linux-first terminal Last.fm client

Project description

legato v1.0.2

A minimal terminal client for Last.fm.

Install (recommended)

python3 -m pip install --user pipx
pipx install legato-fm

Setup

Legato uses the Last.fm desktop/web auth flow: it opens a browser to approve access, then polls for a session key. Session keys are long-lived unless the user revokes your app in Last.fm settings.

legato setup

Output style

No bordered tables. Plain text. Links are terminal hyperlinks (OSC 8) where supported.

YouTube

legato yt prints a YouTube search link for the current track and notes that a smarter matcher is coming soon.

App credentials (important)

Last.fm requires an API key + shared secret for your application (not the user). You must set these before release.

Edit:

  • src/legato/lastfm.py -> APP_API_KEY and APP_API_SECRET

Commands

  • legato --version
  • legato current (now playing / last scrobble)
  • legato fm (FMbot-style alias for current)
  • legato disconnect (remove saved session + username from local config)
  • legato recent [-n N] [--user USER]
  • legato top artist|album|track [-p day|week|month|quarter|year|overall|alltime|all] [--year YYYY] [-n N]
  • legato artist|album|track [--name ...] [--artist ...]
  • legato artist "ARTIST"
  • legato album "ARTIST | ALBUM"
  • legato track "ARTIST | TRACK"
  • legato album [--query "ARTIST | ALBUM"] [--user USER]
  • legato plays [--target artist|album|track] [--query "..."] [--name ...] [--artist ...] [--user USER]
  • legato np ARTIST TRACK [--album ...] (update now playing)
  • legato scrobble ARTIST TRACK [--album ...] [--ts now|UNIX]
  • legato scrobble "ARTIST | TRACK[ | ALBUM]" [--album ...] [--ts now|UNIX]
  • legato first [--query "ARTIST[ | TRACK]"] [--artist ...] [--track ...] [--user USER]
  • legato taste OTHER_USER [--user USER] [-p period] [-n N]
  • legato love [ARTIST] [TRACK] (defaults to current)
  • legato unlove [ARTIST] [TRACK]
  • legato profile [--user USER]
  • legato friends [--user USER] [-n N]
  • legato pace [-i 5000] [-p month|week|year|day]
  • legato yt [ARTIST] [TRACK] [--open]
  • legato theme set <color> (accent color; default bright red)
  • legato theme show
  • legato doctor
  • legato api METHOD [key=value ...] (power-user escape hatch; read methods only unless --write)

Notes

Legato aims to cover the core Last.fm functionality exposed by the official API (recent, now playing, scrobble, top, info, love/unlove, profile, friends). Discord-server-only features are intentionally omitted.

Publish to PyPI (GitHub Actions)

This repo includes publish workflow that:

  • builds package artifacts,
  • runs twine check,
  • publishes to PyPI when you push a tag like v0.5.0.

One-time setup

  1. Create a PyPI API token (scope it to this project).
  2. In GitHub: Settings → Secrets and variables → Actions → New repository secret.
  3. Add secret name: PYPI_API_TOKEN, value: your token.

Release flow

  1. Bump version in pyproject.toml.
  2. Commit and push.
  3. Create and push a tag:
git tag v0.5.0
git push origin v0.5.0
  1. Watch Actions run; after success users can install/update with:
pipx install legato
# or
pipx upgrade legato

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

legato_fm-1.0.3.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

legato_fm-1.0.3-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file legato_fm-1.0.3.tar.gz.

File metadata

  • Download URL: legato_fm-1.0.3.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for legato_fm-1.0.3.tar.gz
Algorithm Hash digest
SHA256 27f009aa8537e08271f123f06c8ce667c6b26f15f6270776e7f6e62962c3ee6f
MD5 38a1f328e15b1235d772c483fc4796bf
BLAKE2b-256 cbd937df988a69ff62636d32696fb2646dc2bc14e9a21ab26fe5c2285f6a9216

See more details on using hashes here.

Provenance

The following attestation bundles were made for legato_fm-1.0.3.tar.gz:

Publisher: publish-pypi.yml on vista747/legato

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file legato_fm-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: legato_fm-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for legato_fm-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1b4b942bb331c6a907eae0e564d91194772f00511ea0c90dca3ef5be7bbe2c18
MD5 5ca3f353df482aa7df3750dfbe09665f
BLAKE2b-256 85eadd0d9b93d7a4f1acb02a5ab8c088de3a4b49a6da70ed64baa9d97f9d9348

See more details on using hashes here.

Provenance

The following attestation bundles were made for legato_fm-1.0.3-py3-none-any.whl:

Publisher: publish-pypi.yml on vista747/legato

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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