Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5aa5558
Updated README to include the cli more. Softened Is this for you sect…
semohr Sep 15, 2026
0d45a99
Reworked structure a bit now cli and python are a bit more separated.
semohr Sep 22, 2026
f93c4e9
Moved docs into folders relative to the new sections.
semohr Sep 22, 2026
23ad3b5
Added sphinx directive to simplify showing config values.
semohr Oct 1, 2026
99c55c2
Updated getting started guides to include tool install instructions.
semohr Oct 1, 2026
e349123
Added user friendly core concepts guide.
semohr Oct 12, 2026
5d18357
A big iteration over the docs. Might need some more live but we are
semohr Oct 12, 2026
8e56c0f
Enhanced config directive. Adds an from file option to configuration
semohr Oct 12, 2026
b5cf760
Added an directive to simplify install instructions.
semohr Oct 12, 2026
01046da
Added integration tests to replace notebooks. For now just spotify
Oct 15, 2026
20a3f98
Removed notebooks.
Oct 15, 2026
ea2b86f
Improved service guides.
Oct 15, 2026
3ba41f1
added playlist guide.
Oct 15, 2026
138a58e
fixed ruff and mypy
Oct 15, 2026
e5d242e
potential fixes for spotify and tidal integration tests.
Oct 15, 2026
7b38982
spotify does not truely delete playlists.
Oct 15, 2026
857411f
Omit test_integration from coverage reports
Oct 15, 2026
9e25ab8
docs: restructure around services
semohr Nov 9, 2026
dfcaead
Use tidal in CLI gettings started to avoid spotify API Token nagging
pSpitzner Nov 15, 2026
323e7d4
More detailed library authentication, how to persist tokens.
pSpitzner Nov 15, 2026
ea0ccba
tweaks to library playlist editing
pSpitzner Nov 15, 2026
c5074e0
tweaks to logging and matching
pSpitzner Nov 20, 2026
b98d4cd
added download link to notebooks
pSpitzner Nov 20, 2026
7bee6dd
fix sidebar position during page navigation
pSpitzner Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on:
pull_request:
branches: ["main"]
schedule:
# Nightly run. GitHub emails failures of scheduled workflows to the user who
# last modified this cron line.
- cron: "27 4 * * *" # 4:27 every night
env:
PSYNC_CONFIG_DIR: ${{ github.workspace }}/tests/data/integration_config
# In CI we never skip: missing credentials or tracks fail the run.
PLISTSYNC_INTEGRATION_STRICT: "1"

jobs:
test-notebooks:
integration-tests:
runs-on: [self-hosted, linux]
environment: integration_tests # only scope where our secrets are defined
strategy:
Expand All @@ -31,15 +35,15 @@ jobs:
INTEGRATION_CONFIG_YAML: ${{ secrets.INTEGRATION_CONFIG_YAML }}
run: |
mkdir -p $PSYNC_CONFIG_DIR
f="$PSYNC_CONFIG_DIR/config.yml"
f="$PSYNC_CONFIG_DIR/config.yaml"
echo "$INTEGRATION_CONFIG_YAML" > "$f"
echo "bytes=$(wc -c < "$f" | tr -d ' ')"
sha256sum "$f" | awk '{print "sha256="$1}'

uv run python - <<'PY'
import os, yaml, pathlib, collections.abc

p = pathlib.Path(os.environ["PSYNC_CONFIG_DIR"]) / "config.yml"
p = pathlib.Path(os.environ["PSYNC_CONFIG_DIR"]) / "config.yaml"
data = yaml.safe_load(p.read_text(encoding="utf-8"))

def mask(v):
Expand Down Expand Up @@ -109,19 +113,9 @@ jobs:
echo "token_sha=$SHA" >> "$GITHUB_OUTPUT"
echo "Token Checksum: $SHA"

- name: Test ${{ matrix.service }} notebooks
id: nbmake_tests
- name: Run ${{ matrix.service }} integration tests
run: |
uv run pytest --nbmake --nbmake-timeout=600 -vv -s --overwrite docs/services/${{ matrix.service }}/*.ipynb

- name: Upload executed notebooks on failure (${{ matrix.service }})
if: failure() && steps.nbmake_tests.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: nbmake-notebooks-${{ matrix.service }}-${{ github.run_id }}-${{ github.run_attempt }}
path: docs/services/${{ matrix.service }}/*.ipynb
if-no-files-found: error
retention-days: 14
uv run pytest tests_integration/${{ matrix.service }} -vv -s --no-cov

- name: Compute token checksum (updated)
id: new_sha
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
python-version: "3.12"
- name: Install docs dependencies
run: |
uv sync --group docs
uv sync --all-extras --group docs
- name: Build Sphinx docs
run: |
cd docs
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ dist-ssr

# Docs
docs/build
.ipynb_checkpoints
docs/api
docs/reference/api
docs/_build
docs/jupyter_execute

htmlcov
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p align="center">
<em><b>
<!-- start intro -->
Toolbox for transferring, converting and matching music collections and playlists across services.
CLI and Library for transferring, converting, matching and inspecting music collections and playlists across services.
<!-- end intro -->
</b></em>
</p>
Expand All @@ -22,32 +22,42 @@ Toolbox for transferring, converting and matching music collections and playlist

<!-- start overview -->

**plistsync** is a Python toolbox designed to solve the common problem of fragmented music libraries across different platforms. Whether you're a DJ moving playlists between Traktor and streaming services, a music enthusiast syncing collections between Plex and Spotify, or simply organizing your music across multiple platforms, plistsync provides a unified interface to transfer, convert, and match your music data.
**plistsync** brings your playlists together across different music services. Whether you're a DJ moving playlists between DJ software and streaming services, or an enthusiast keeping collections in sync across platforms, plistsync gives you one consistent way to manage them.

The core of plistsync is its abstraction layer that normalizes tracks, collections, and playlists from various services into a common format, enabling seamless synchronization while handling the complexities of different APIs, authentication methods, and metadata formats.
At its core, plistsync provides an abstraction layer that normalizes tracks, libraries, and playlists across services. It handles the differences in APIs, authentication, and metadata formats, so you don't have to.

The CLI builds on the same abstraction: one unified syntax across services, no coding required. For developers and advanced users who prefer code, the Python library provides the same foundation for building their own scripts and tooling.

<!-- end overview -->

## Features

<!-- start features -->

- **Unified Abstraction Layer**: Normalizes tracks, collections, and playlists from various services into a common format, enabling seamless synchronization across platforms
- **Unified Abstraction Layer**: Normalizes tracks, collections, and playlists from various services into a common format and interface
- **Extensible Service Architecture**: The abstraction layer is designed to support arbitrary music services with consistent APIs
- Currently supports Spotify, Tidal, Plex, Traktor and local files
- **Collection Management**: Sync entire music libraries or specific playlists between services
- **Developer-Friendly**: Built with type hints, comprehensive error handling, and pytest for testing
- **Flexible Configuration**: Manage service credentials and preferences through config files

- Simplifies creating your own extensions for other services
- **Command Line Interface (CLI)**: Provides a user-friendly CLI for common tasks like syncing playlists, transferring tracks, and managing libraries
- **Python API**: Offers a programmatic interface for developers to integrate plistsync into scripts or own applications
<!-- end features -->

## Getting started

For detailed usage guides, API reference, and examples, see the [full documentation](https://docs.plistsync.com).

Quick start:

```bash
pip install plistsync
plistsync --help
```

## Is this for you?

**plistsync** is intended for users who are comfortable with Python and scripting. It is **not** a point-and-click app, it’s a _developer-oriented_ toolbox for automating music library and playlist workflows.
**Yes**, if you are comfortable in a terminal. The CLI is easy to pick up, and no Python knowledge is required.

If you’re comfortable with writing some code, there’s also a Python API for scripting custom workflows and integrations.

## License

Expand Down
1 change: 1 addition & 0 deletions docs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Sphinx documentation sources and extensions."""
1 change: 1 addition & 0 deletions docs/_ext/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Sphinx extensions for the plistsync documentation."""
124 changes: 124 additions & 0 deletions docs/_ext/plistsync_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
"""Generate the CLI command reference from the installed services.

The page is written to ``reference/api/cli.md`` before Sphinx reads its sources, so
the reference cannot drift from the Typer app, and adding a service needs no
documentation change.

Only services that install commands are listed: a service without a playlist
library (``local``, ``beets``) is a track source and has no CLI of its own.

Usage in ``conf.py``::

extensions = [..., "plistsync_cli"]
"""

from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING

from sphinx.util import logging

if TYPE_CHECKING:
from sphinx.application import Sphinx

logger = logging.getLogger(__name__)

#: Preferred order in the reference; unknown services are appended alphabetically.
_ORDER = ("spotify", "tidal", "plex", "traktor", "sync")

_INTRO = """\
*Generated from the installed services. `plistsync <service> --help` prints the
same information in your terminal.*

Every service is set up once, as described on its
{doc}`service page <../../services/index>`.
"""

_SYNC = """\
## Sync

The sync workflow lives under `plistsync sync`. It needs no configuration or
login of its own. See {doc}`Sync <../../services/sync/index>` for the setup of the
services you link, and {doc}`the walkthrough <../../services/sync/cli>` for what each
command does.
"""

_FALLBACK = """\
# CLI Reference

*This page is generated at build time and needs `plistsync` with all service
extras installed.*
"""


def _typer(target: str, prog: str) -> str:
"""Render one Typer directive with all nested subcommands expanded."""
return (
f"```{{typer}} {target}\n---\nprog: {prog}\nwidth: 80\nshow-nested:\n---\n```\n"
)


def _section(name: str, title: str) -> str:
if name == "sync":
return (
_SYNC
+ "\n"
+ _typer("plistsync.cli.commands.sync:sync_app", "plistsync sync")
)

playlist = _typer(
f"plistsync.cli.app:app::{name}:playlist",
f"plistsync {name} playlist",
)
search = _typer(f"plistsync.cli.app:app::{name}:search", f"plistsync {name} search")
return (
f"## {title}\n\n"
f"All {title} commands live under `plistsync {name}`. The one-time setup is\n"
f"covered in {{doc}}`{title} setup <../../services/{name}/index>`.\n\n"
f"{playlist}\n{search}"
)


def _render() -> str:
from plistsync.services import ServiceLoader

available = list(ServiceLoader.list_all())
ordered = [n for n in _ORDER if n in available]
ordered += sorted(n for n in available if n not in _ORDER)

sections = ["# CLI Reference", _INTRO.strip()]
for name in ordered:
service = ServiceLoader.get(name)
if service is None:
logger.warning("plistsync_cli: unknown service %r", name)
continue
try:
library = service.library()
except Exception as err: # sphinx runs this for every build
logger.warning("plistsync_cli: skipping service %r: %s", name, err)
continue
if name != "sync" and library is None:
continue
sections.append(_section(name, name.capitalize()))

return "\n\n".join(sections) + "\n"


def generate(app: Sphinx) -> None:
"""Write the reference page, before Sphinx reads the sources."""
target = Path(app.srcdir) / "reference" / "api" / "cli.md"
try:
content = _render()
except Exception as err: # docs must build without plistsync installed
logger.warning("plistsync_cli: cannot generate the reference: %s", err)
content = _FALLBACK

target.parent.mkdir(parents=True, exist_ok=True)
target.write_text(content, encoding="utf-8")
logger.info("plistsync_cli: wrote %s", target)


def setup(app: Sphinx) -> dict[str, object]:
app.connect("builder-inited", generate)
return {"version": "0.1", "parallel_read_safe": True, "parallel_write_safe": True}
Loading
Loading