lastfm_monitor
Powerful real-time tracker for Last.fm that brings your music data to life with automated Spotify playback, instant activity alerts and deep scrobble analytics.
🚀 Quick Install & Run
New to Python or unsure what is installed? Follow the Python install walkthrough first.
Install from PyPI:
pip install lastfm_monitor
Run the setup wizard:
lastfm_monitor --setup
The wizard asks for the target, the Last.fm API credentials and optional notifications. Review the settings before saving them. See Setup & First Run for how to get the Last.fm API key and shared secret and the required privacy settings.
For the manual single-file method, dependencies and upgrade commands, see Installation.
Features
🔍 Listening and Profile Tracking
- Listening activity: Track songs, active and inactive periods, pauses and resumes.
- Playback detail: Show listening duration, skipped tracks and an optional progress indicator.
- Profile changes: Track followers, followed accounts, About Me bio and display name.
- Activity gaps: Detect offline listening and estimate Spotify private mode, which is not always accurate.
📊 Playback and Insights
- Spotify playback: Follow the tracked user's songs, pauses and resumes in your local Spotify client.
- Session statistics: Summarize listening time, tracks, skips, repeats and pauses.
- Last.fm Wrapped: Generate top artist, track and album statistics from CSV history.
- Music and lyrics links: Open configurable searches from console output and email.
🔔 Notifications and History
- Event alerts: Configure email, Discord and ntfy notifications for listening and profile changes.
- CSV history: Save listened tracks with timestamps.
- Saved state: Retain activity, friend lists and tracked profile fields across restarts.
⚙️ Setup and Configuration
- Guided setup: Configure the monitor with
--setupand check readiness with--doctor. - Flexible settings: Use config files, dotenv files, environment variables and command-line options.
- Runtime controls: Adjust the running monitor through supported signals.
Common Commands
Use Quick Install & Run above for first-time setup. The table uses PyPI commands. For the manual script equivalents, see Run Individual Commands.
Replace the target placeholders with a Last.fm username. Monitoring requires the Last.fm API key and shared secret described in the setup guide.
| I want to... | Run this |
|---|---|
| Configure the target, credentials and alerts | lastfm_monitor --setup |
| Start monitoring with existing authentication | lastfm_monitor <lastfm_username> |
| Check authentication, connectivity and one target | lastfm_monitor --doctor <lastfm_username> |
| Enter or replace securely the Last.fm API key and shared secret | lastfm_monitor --set-lastfm-credentials |
| Enter or replace securely the optional Spotify credentials for track details | lastfm_monitor --set-spotify-credentials |
| Configure and test webhook alerts | Use the setup wizard or follow Webhook Settings |
| Save an SMTP password for email alerts | lastfm_monitor --set-smtp-password |
| Send a test email | lastfm_monitor --send-test-email |
| Save a new webhook URL | lastfm_monitor --set-webhook-url |
| Send a test webhook | lastfm_monitor --send-test-webhook |
| List the ten most recent tracks | lastfm_monitor <lastfm_username> -l -n 10 |
| Alert on the tracks and albums listed in a file | lastfm_monitor <lastfm_username> -s tracks.txt |
| Write every scrobble to a CSV file | lastfm_monitor <lastfm_username> -b scrobbles.csv |
| Play every scrobble in your own Spotify client | lastfm_monitor <lastfm_username> -g |
| Use a specific configuration and secrets file | lastfm_monitor --config-file lastfm_monitor.conf --env-file .env <lastfm_username> |
| List every supported command-line flag | lastfm_monitor --help |
The monitored account must expose the activity described in User Privacy Settings.
Running the tool with no arguments offers the wizard if you have not saved a user. If a user is already saved, it starts monitoring that user.
The tool runs until interrupted (Ctrl+C). Use tmux or screen for persistence and run multiple copies to monitor several users.
For credentials, saved users and notification setup, see the full Setup & First Run guide.
For the Spotify metadata backends, email and webhook setup, see Configuration. For notification choices, listing commands, automatic playback and output files, see Usage.
If a run fails, start with Doctor Preflight.
Documentation
Full documentation is available at misiektoja.github.io/lastfm_monitor:
| Page | What it covers |
|---|---|
| Installation | Python walkthrough, PyPI or manual installation, upgrades |
| Setup & First Run | Setup wizard, Last.fm credentials, privacy settings, the first monitoring run |
| Configuration | Config file, Spotify metadata backends, SMTP, webhooks, storing secrets, check intervals |
| Usage | Monitoring mode, listing mode, notifications, CSV export, automatic playback, signals, terminal output |
| Troubleshooting | --doctor preflight checks, what to do when something fails, --verbose and --debug output |
| Testing | Running the offline suite, the linter and the docs build |
| About | Change log, contributing, security, license, support |
Change Log
See RELEASE_NOTES.md for details.
Contributing
Bug reports, documentation fixes and code contributions are welcome. See CONTRIBUTING.md for the development setup, the checks CI enforces and what a change needs before it is merged. Participation is covered by the Code of Conduct.
Security
Report a suspected vulnerability privately through GitHub security advisories, never as a public issue. SECURITY.md covers the reporting process, the supported versions and the security posture of stored credentials and configuration loading.
Maintainers
- misiektoja (@misiektoja)
License
Licensed under GPLv3. See LICENSE. Dependency licenses are listed in THIRD_PARTY_NOTICES.md.
Support
Questions, bug reports and vulnerability reports each have a place, listed in SUPPORT.md.
If the project is useful to you, you can support its development through GitHub Sponsors or Buy Me a Coffee.
Metadata
Release files for lastfm-monitor 2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lastfm_monitor-2.7.tar.gz | 327.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lastfm_monitor-2.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 479.1 kB
Release files / lastfm_monitor-2.7.tar.gz
| Download URL | lastfm_monitor-2.7.tar.gz |
|---|---|
| Size | 327.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0631707bfaf0a938b3769f08417a08a9571880f14c41308cffe6fbc84f207ce
|
|
BLAKE2b-256 checksum How to use checksums |
79659b99bf86d1e85e973c3dc7b925f8e561196256fa343121be152384e99fa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / lastfm_monitor-2.7-py3-none-any.whl
| Download URL | lastfm_monitor-2.7-py3-none-any.whl |
|---|---|
| Size | 151.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
346124b56ccd2ee18a120f621951875b043f61fa9465245d251fba8c27f67252
|
|
BLAKE2b-256 checksum How to use checksums |
2b3ff5a2572f211987c3a6669a258a4a2c38bb8dcf2cfc539e976f5d77698d72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency log