Skip to main content

PlexMusicRatingsSync

This tool bridges the gap between Plex Media Server and your audio files, ensuring your carefully curated ratings are preserved and synchronized between Plex and your preferred music player. Supports various rating schemes including those used by MusicBee, MediaMonkey, Picard, and other popular players or tools.

Features

  • Bidirectional sync between Plex and audio files
  • Import and export ratings between Plex and audio files
  • Support for both half-star and full-star ratings
  • Supports MP3 (ID3v2), FLAC, M4A (AAC/ALAC), OGG, Opus, and AIFF formats
  • Support for multiple Plex music libraries
  • Compatible with rating schemes from multiple applications
  • Dry-run mode to preview changes without applying them
  • Detailed logging with customizable verbosity levels

User Guide

CLI

Installation (pipx)

Start by installing the latest version:

pipx install PlexMusicRatingsSync

Or, install specific a version:

pipx install PlexMusicRatingsSync==x.y.z --force

And, to upgrade to the latest version:

pipx upgrade PlexMusicRatingsSync

Usage

Start by checking your system information and locating your config file:

plex-music-ratings-sync info
  • This command creates a configuration file (the path is shown in the output) with placeholders and some initial settings. You’ll need to edit that file to add your own values before the script can run properly.

Now you’re ready to run any of the available commands, that you can view with:

plex-music-ratings-sync --help
  • For detailed information about any specific command, use:

    plex-music-ratings-sync COMMAND --help
    
    • Replace COMMAND with the command (e.g., sync, import, export) you want to learn more about.

Lastly, synchronize ratings between Plex and your audio files with:

plex-music-ratings-sync sync
  • Or import ratings from audio files into Plex with:

    plex-music-ratings-sync import
    
  • Or export ratings from Plex to audio files with:

    plex-music-ratings-sync export
    

Docker Compose

Start by setting up your docker-compose.yml like this:

services:
  plex-music-ratings-sync:
    image: ghcr.io/rfgamaral/plex-music-ratings-sync
    container_name: plex-music-ratings-sync
    network_mode: bridge
    restart: on-failure:2
    volumes:
      - /host/app/data:/app/data
      - /host/plex/music:/plex/music
  • For a specific version (e.g., 1.2.3):
    • ghcr.io/rfgamaral/plex-music-ratings-sync:1.2.3
  • For the latest patch of a minor version (e.g., 1.2):
    • ghcr.io/rfgamaral/plex-music-ratings-sync:1.2
  • For the latest patch of a major version (e.g., 1):
    • ghcr.io/rfgamaral/plex-music-ratings-sync:1

Then run the following Docker Compose command:

docker compose run --rm plex-music-ratings-sync info
  • This creates a config file with placeholders and initial settings; which you must edit before the script can run. Thanks to the volume mount, it’s saved on your host path (though the container output will show an internal path).

Now you’re ready to run any of the available commands, that you can view with:

docker compose run --rm plex-music-ratings-sync --help
  • For detailed information about any specific command, use:

    docker compose run --rm plex-music-ratings-sync COMMAND --help
    
    • Replace COMMAND with the command (e.g., sync, import, export) you want to learn more about.

Lastly, synchronize ratings between Plex and your audio files with:

docker compose run --rm plex-music-ratings-sync sync
  • Or import ratings from audio files into Plex with:

    docker compose run --rm plex-music-ratings-sync import
    
  • Or export ratings from Plex to audio files with:

    docker compose run --rm plex-music-ratings-sync export
    

Environment Variables

You can override YAML configuration values using environment variables. This is useful for container orchestrators (Kubernetes, Docker Swarm), CI/CD pipelines, or any environment where managing config files is impractical.

Variable Description Example
PMRS_PLEX_URL Plex server URL http://192.168.1.100:32400
PMRS_PLEX_TOKEN Plex authentication token your-plex-token
PMRS_PLEX_LIBRARIES Comma-separated library names Music,Audiobooks

Precedence: The YAML config file is always loaded first. Environment variables, when set, override the corresponding YAML values. A log message is emitted when overrides are active.

Example usage with Docker Compose:

services:
  plex-music-ratings-sync:
    image: ghcr.io/rfgamaral/plex-music-ratings-sync
    container_name: plex-music-ratings-sync
    network_mode: bridge
    restart: on-failure:2
    environment:
      - PMRS_PLEX_URL=http://192.168.1.100:32400
      - PMRS_PLEX_TOKEN=your-plex-token
      - PMRS_PLEX_LIBRARIES=Music,Audiobooks
    volumes:
      - /host/app/data:/app/data
      - /host/plex/music:/plex/music

Automated Synchronization

You can automate the synchronization process to run periodically using different methods depending on your installation.

Linux (Cron)

If you installed the app via pipx, add a cron job to run the sync command:

# Edit your crontab
crontab -e

# Add one of these lines:

# Run daily at 03:00
0 3 * * * $HOME/.local/bin/plex-music-ratings-sync sync

# Run weekly on Sunday at 03:00
0 3 * * 0 $HOME/.local/bin/plex-music-ratings-sync sync

# Run monthly on the 1st at 03:00
0 3 1 * * $HOME/.local/bin/plex-music-ratings-sync sync

Windows (Task Scheduler)

If you installed the app via pipx on Windows, create a scheduled task:

  1. Open Task Scheduler
  2. Click "Create Basic Task"
  3. Set a name and description
  4. Choose your trigger (Daily, Weekly, etc.)
  5. For the action, select "Start a program"
  6. Program/script: %USERPROFILE%\.local\bin\plex-music-ratings-sync.exe
  7. Arguments: sync

Docker (Ofelia Scheduler)

If you’re using Docker, you can use set up your docker-compose.yml with Ofelia as a job scheduler. Here’s an example to synchronize ratings between Plex and your audio files every 6 hours:

services:
  plex-music-ratings-sync:
    image: ghcr.io/rfgamaral/plex-music-ratings-sync
    container_name: plex-music-ratings-sync
    network_mode: bridge
    command: sync
    restart: on-failure:2
    volumes:
      - /host/app/data:/app/data
      - /host/plex/music:/plex/music
  ofelia-scheduler:
    image: mcuadros/ofelia
    container_name: ofelia-scheduler
    command: daemon --docker
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      ofelia.job-run.plex-music-ratings-sync.schedule: '@every 6h'
      ofelia.job-run.plex-music-ratings-sync.container: 'plex-music-ratings-sync'

First, create both services without starting them:

docker compose up --no-start

Next, start only the ofelia-scheduler service:

docker compose up ofelia-scheduler

Frequently Asked Questions

How do I ensure file paths match between Plex and PlexMusicRatingsSync?

You can verify the correct path in Plex by opening any track in your library, clicking the ⋮ (three dots) menu, selecting "Get Info", and looking at the file path shown. If you have multiple music libraries in different locations, you'll need to define multiple volume mappings.

For Docker users, this path must match the container's /plex/music mount point. For CLI users running on a different machine than Plex, ensure the paths are identical through network shares or mapped drives.

How are ratings synchronized between Plex and audio files?

Plex is treated as the primary source of truth due to technical limitations - neither Plex nor audio files maintain reliable timestamps for rating changes, making it impossible to determine which rating was set most recently.

The synchronization follows these rules:

  1. If ratings match: No action needed
  2. If ratings differ: Plex’s rating always wins
  3. If only one has a rating:
    • Plex rating exists → Update file
    • File rating exists → Update Plex

This ensures your ratings stay consistent while working within the technical constraints of both systems.

How does the file rating cache work?

To speed up repeated runs, PlexMusicRatingsSync caches file ratings in a local JSON file. On each run, it checks whether each audio file's modification time and size match the cached values. If they match, the cached rating is used instead of re-reading the file — this significantly reduces I/O, especially for large libraries on network storage (NAS).

The cache is automatically managed and requires no configuration. If you need to bypass or reset it:

  • --no-cache: Skip the cache entirely and read all files from disk
  • --clear-cache: Delete the cached data before processing

The cache file location is shown in the output of plex-music-ratings-sync info.

Can I use environment variables instead of the config file?

Yes. You can set PMRS_PLEX_URL, PMRS_PLEX_TOKEN, and PMRS_PLEX_LIBRARIES to override the corresponding values from the YAML config file. The YAML file is still loaded (and created from template if it doesn't exist), but environment variables take precedence when set. A log message confirms when overrides are active.

This is especially useful for Docker, Kubernetes, or any deployment where injecting environment variables is easier than mounting config files.

License

The use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Metadata

Release files for PlexMusicRatingsSync 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PlexMusicRatingsSync 2.2.0
File Size Uploaded
plexmusicratingssync-2.2.0.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PlexMusicRatingsSync 2.2.0
File Interpreter ABI Platform
plexmusicratingssync-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.0 kB

Release files / plexmusicratingssync-2.2.0.tar.gz

Download URL plexmusicratingssync-2.2.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
29894917389181dd8d07851b2a7bc64ba239fe9e701a04edb233fa240e638da0
BLAKE2b-256 checksum
How to use checksums
19d410a49fe924e8aa5ad9a1f364bfd32fdd7c1298b2e27871b6ee4507faa0a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 14, 2026.

Transparency log

Release files / plexmusicratingssync-2.2.0-py3-none-any.whl

Download URL plexmusicratingssync-2.2.0-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01f92a08cf6fab423c9cadfa24e1e836bde3791f44828e337c2d687fce573a97
BLAKE2b-256 checksum
How to use checksums
447f0bbc0cd3650c3e6925414e9499d16f49e7efd9d7df6b8a6427a409f27c90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page