Skip to main content

Organize YouTube Music likes into playlists with guided bootstrap and weekly sync

Project description

ytmusic-organizer

Organize your YouTube Music likes into practical playlists with a guided first-time setup and weekly incremental sync.

Features

  • Guided onboarding: ytmo setup
  • Initial setup build is non-destructive (create/populate only)
  • Colorful setup wizard UI (Rich when available)
  • Setup resume after interruption/failure
  • Weekly incremental sync
  • Explicit destructive reset with confirmation
  • Manual mode (copy/paste prompt workflow) and optional OpenAI API mode

Install

Recommended (PyPI)

pipx install ytmusic-organizer

From GitHub (if you prefer source install)

pipx install git+https://github.com/<org-or-user>/ytmusic-organizer.git

Quickstart

  1. Run guided setup:
ytmo setup

The wizard handles auth setup and writes auth to <workspace>/browser.json by default. If you already have an auth file, pass it explicitly:

ytmo setup --auth-file /absolute/path/to/browser.json
  1. For weekly updates:
ytmo sync
  1. For full destructive rebuild:
ytmo reset --yes

Commands

  • ytmo setup [--mode manual|api] [--auth-file PATH] [--non-interactive] [--plan-from-stdin] [--restart]
  • ytmo sync [--mode manual|api] [--non-interactive] [--plan-from-stdin]
  • ytmo reset [--yes] [--mode manual|api] [--non-interactive] [--plan-from-stdin]
  • ytmo cleanup [--yes] [--local-only]
  • ytmo preview [--plan PATH]

Common option:

  • --workspace (default ~/.ytmusic-organizer)
  • --json (machine-readable output; keeps default Rich output unchanged when omitted)

Modes

Manual mode (default)

The CLI exports song JSON and waits for your model response JSON on stdin:

  • full flows write prompt to ~/.ytmusic-organizer/data/full_reset_prompt_filled.txt
  • weekly sync writes prompt to ~/.ytmusic-organizer/data/new_songs_prompt_filled.txt
  • provide model JSON by piping/pasting into stdin (Ctrl-D to submit)
  • default workspace path is ~/.ytmusic-organizer (override with --workspace)

Prompt templates are packaged in ytmusic_organizer/prompts/.

API mode

Requires:

  • OPENAI_API_KEY

Run with --mode api to auto-generate plan JSON.

Safety and state

  • ytmo setup is create-only (non-destructive).
  • ytmo reset is destructive and requires confirmation unless --yes is passed.
  • ytmo sync requires completed setup and will instruct if missing.
  • ytmo cleanup deletes playlists managed by this tool and removes local managed artifacts.

Local workspace files

~/.ytmusic-organizer/ contains local mutable files by default:

  • config.toml
  • bootstrap.json
  • setup_state.json
  • state.json
  • managed_playlists.json
  • data/*.json

These are intentionally ignored from git.

managed_playlists.json now stores managed playlist IDs (schema v2) for safe deletion targeting.

Troubleshooting

  • Auth file not found:
  • Setup has not been completed: run ytmo setup.
  • Setup interrupted: run ytmo setup to resume, or ytmo setup --restart to restart.
  • API mode key error: set OPENAI_API_KEY or switch to --mode manual.

Development

Development install

python -m venv .venv
source .venv/bin/activate
pip install -e .

Local repo install (maintainers/testing)

pipx install .

Run tests:

python -m unittest discover -s tests -v

Agent Automation

For AI/automation integration details (install, auth requirements, command contracts, and JSON output examples), see:

Release Automation

PyPI publishing is automated via GitHub Actions:

  • .github/workflows/release-pypi.yml: publishes on v* tags
  • .github/workflows/release-testpypi.yml: manual TestPyPI publish

Publishing auth model:

  • Uses PyPI/TestPyPI Trusted Publishing (OIDC) from GitHub Actions.
  • No PYPI_API_TOKEN/TEST_PYPI_API_TOKEN repository secrets are required.
  • PyPI/TestPyPI project must have matching trusted publisher configuration for this repository/workflow.

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

ytmusic_organizer-0.1.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

ytmusic_organizer-0.1.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file ytmusic_organizer-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for ytmusic_organizer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0edc753da7c08e3cdf58b2d79baeeee9afb498e9ae5329b72116ca3f1c46fcc
MD5 fcf482a4142c41221d4614438d9a3b78
BLAKE2b-256 40d9bd84b6d6f540771552f669b9056628ab89d024847043a409185c0ebfb5e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusic_organizer-0.1.0.tar.gz:

Publisher: release-pypi.yml on feffel/ytmusic-organizer

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

File details

Details for the file ytmusic_organizer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ytmusic_organizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0f797fc46a10c30058c272350157da8084f7cd196d73fd640c74a56628f9e5d
MD5 32d832e34dadce377e419d6a537ae069
BLAKE2b-256 b7242a8b7f767214d53d160aad4634dcdac67de85f6f7912b213b89fd6986046

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusic_organizer-0.1.0-py3-none-any.whl:

Publisher: release-pypi.yml on feffel/ytmusic-organizer

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