Skip to content

docs: add a playlist-to-CSV recipe - #163

Open
musabustun wants to merge 1 commit into
AliAkhtari78:masterfrom
musabustun:docs/144-playlist-to-csv
Open

musabustun wants to merge 1 commit into
AliAkhtari78:masterfrom
musabustun:docs/144-playlist-to-csv

Conversation

@musabustun

Copy link
Copy Markdown

What

Closes #144. Adds a short recipe (docs/guides/playlist-to-csv.md) showing how to dump a playlist's tracks to a CSV file — a common ask with no existing doc coverage.

  • ~15-line snippet using only the public SpotifyClient API and the stdlib csv module.
  • Reuses the example playlist ID (37i9dQZF1DXcBWIGoYBM5M, Spotify's own "Today's Top Hits") already used elsewhere in these docs, for consistency.
  • Handles track.album being None (a tier-1-only field per entities.md) by falling back to "" instead of raising, and links to the existing docs explaining why playlist.tracks holds PlaylistTrack wrappers rather than bare Tracks.
  • Added to the nav in mkdocs.yml (right after "Entities", since it directly extends the playlists section there).

Testing

  • Ran the exact snippet from the doc against the live playlist to confirm it produces correct output (verified rows for name/artist/album/duration_ms, including tracks with a None album field).
  • uv run mkdocs build --strict — passes with the new page included, no broken links or warnings from it.
  • pre-commit run --files docs/guides/playlist-to-csv.md mkdocs.yml — codespell, trailing-whitespace, end-of-file-fixer all pass. (check-yaml fails on mkdocs.yml, but that's pre-existing — it fails identically on master before this change, due to a custom Python-object YAML tag mkdocs-material's emoji extension uses that the generic pre-commit YAML parser doesn't understand.)

No library code changed.

🤖 Generated with Claude Code

Dumping a playlist to a spreadsheet is a common ask with no existing
recipe in the docs. Adds a ~15-line snippet using only the public API
and the stdlib csv module, following the same SpotifyClient pattern as
the other guides.

Verified: the exact snippet in the doc runs against a real playlist
(Spotify's own "Today's Top Hits", already used as the example ID
elsewhere in these docs) and produces correct rows, including the
tier-1-only album field falling back to "" instead of raising when
absent. `mkdocs build --strict` passes with the new page in the nav.

Closes AliAkhtari78#144

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: add a 'Spotify playlist → CSV' recipe

1 participant