# anamelesswolf/python-labs architecture

> Architecture diagram of the GitHub repository anamelesswolf/python-labs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anamelesswolf/python-labs
- Repository: https://github.com/anamelesswolf/python-labs

## Overview

Python Labs is a collection of independent command-line media tools, not one integrated application. Users run each lab separately: scrape, inspect, convert, analyze, or synchronize media, then receive files, reports, or updated local libraries. The graph preserves the README’s major capabilities and shows the sampled Spotify analysis and scraper flows where source evidence supports them. Other links reflect README-level workflows; unsampled implementation details and integrations are not inferred.

Main entry points: [`setlist-fm-scrapper/setlistfm_app/cli.py`](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/cli.py) (Setlist commands), [`tmdb-updates/tmdb_app/cli.py`](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/cli.py) (TMDB commands), [`nyaa-scrapper/nyaa_app/cli.py`](https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/cli.py) (NYAA commands), [`pbay-scrapper/pbay_app/cli.py`](https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/cli.py) (PBAY commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Library tools"]
  node_tmdbcli["TMDB commands<br/>[cli.py]"]
  node_tmdbscan["Library scanner<br/>[scanner.py]"]
  node_tmdbmovie["Movie data<br/>[movie.py]"]
  node_tmdbclient["TMDB client<br/>[tmdb_client.py]"]
  node_tmdbstore[("Library store<br/>[store.py]")]
  node_tmdbreport["Status reports<br/>[report.py]"]
end

subgraph group_scrapers["Web scrapers"]
  node_nyaacli["NYAA commands<br/>[cli.py]"]
  node_nyaascrape["NYAA scraper<br/>[scraper.py]"]
  node_nyaasearch["Search and selection<br/>[search.py]"]
  node_nyaareport["Search report<br/>[report.py]"]
  node_nyaaexport["JSON export<br/>[export.py]"]
  node_pbaycli["PBAY commands<br/>[cli.py]"]
  node_pbayscrape["PBAY scraper<br/>[scraper.py]"]
  node_pbaysearch["Search and selection<br/>[search.py]"]
  node_pbayreport["Search report<br/>[report.py]"]
  node_pbayexport["JSON export<br/>[export.py]"]
end

subgraph group_music["Music tools"]
  node_setlistcli["Setlist commands<br/>[cli.py]"]
  node_setlistapi["Setlist API client<br/>[api.py]"]
  node_setlistsongs["Song search<br/>[songs.py]"]
  node_setlistalbums["Album lookup<br/>[albums.py]"]
  node_setlistcache[("Setlist cache<br/>[cache.py]")]
  node_setlistreport["Setlist reports<br/>[report.py]"]
  node_setlistexport["Playlist JSON<br/>[export.py]"]
  node_ytmusic["YouTube Music sync"]
  node_spotifymain["Analysis entry point<br/>[main.py]"]
  node_spotifyauth["Spotify authentication<br/>[auth_helper.py]"]
  node_libraryservice["Library analysis"]
  node_historyservice["Listening history"]
  node_libraryhelper["Library aggregation<br/>[library_helper.py]"]
  node_trackhelper["Track aggregation<br/>[track_helper.py]"]
end

subgraph group_media["Media utilities"]
end

subgraph group_organize["File organization"]
end

node_user(("CLI user"))
node_tmdbservice{{"TMDB API"}}
node_setlistservice{{"setlist.fm API"}}
node_itunes{{"iTunes API"}}

node_user -->|"runs commands"| node_tmdbcli
node_tmdbcli -->|"scans library"| node_tmdbscan
node_tmdbcli -->|"processes titles"| node_tmdbmovie
node_tmdbcli -->|"updates library"| node_tmdbstore
node_tmdbcli -->|"renders status"| node_tmdbreport
node_tmdbmovie -->|"queries metadata"| node_tmdbclient
node_tmdbclient -->|"requests metadata"| node_tmdbservice
node_user -->|"runs searches"| node_nyaacli
node_nyaacli -->|"dispatches searches"| node_nyaasearch
node_nyaasearch -->|"fetches results"| node_nyaascrape
node_nyaasearch -->|"prompts selection"| node_nyaareport
node_nyaacli -->|"prints report"| node_nyaareport
node_nyaacli -->|"exports JSON"| node_nyaaexport
node_user -->|"runs searches"| node_pbaycli
node_pbaycli -->|"dispatches searches"| node_pbaysearch
node_pbaysearch -->|"fetches results"| node_pbayscrape
node_pbaysearch -->|"prompts selection"| node_pbayreport
node_pbaycli -->|"prints report"| node_pbayreport
node_pbaycli -->|"exports JSON"| node_pbayexport
node_user -->|"searches concerts"| node_setlistcli
node_setlistcli -->|"fetches setlists"| node_setlistapi
node_setlistapi -->|"requests setlists"| node_setlistservice
node_setlistcli -->|"reads and updates"| node_setlistcache
node_setlistcli -->|"searches songs"| node_setlistsongs
node_setlistcli -->|"looks up albums"| node_setlistalbums
node_setlistalbums -->|"finds albums"| node_itunes
node_setlistcli -->|"renders results"| node_setlistreport
node_setlistcli -->|"exports playlist"| node_setlistexport
node_user -->|"syncs playlists"| node_ytmusic
node_user -->|"runs analysis"| node_spotifymain
node_spotifymain -->|"authenticates"| node_spotifyauth
node_spotifymain -->|"generates library report"| node_libraryservice
node_spotifymain -->|"generates history report"| node_historyservice
node_libraryservice -->|"fetches and groups"| node_libraryhelper
node_historyservice -->|"groups tracks"| node_trackhelper

click node_tmdbcli "https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/cli.py"
click node_tmdbscan "https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/scanner.py"
click node_tmdbmovie "https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/movie.py"
click node_tmdbclient "https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/tmdb_client.py"
click node_tmdbstore "https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/store.py"
click node_tmdbreport "https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/report.py"
click node_nyaacli "https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/cli.py"
click node_nyaascrape "https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/scraper.py"
click node_nyaasearch "https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/search.py"
click node_nyaareport "https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/report.py"
click node_nyaaexport "https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/export.py"
click node_pbaycli "https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/cli.py"
click node_pbayscrape "https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/scraper.py"
click node_pbaysearch "https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/search.py"
click node_pbayreport "https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/report.py"
click node_pbayexport "https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/export.py"
click node_setlistcli "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/cli.py"
click node_setlistapi "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/api.py"
click node_setlistsongs "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/songs.py"
click node_setlistalbums "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/albums.py"
click node_setlistcache "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/cache.py"
click node_setlistreport "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/report.py"
click node_setlistexport "https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/export.py"
click node_ytmusic "https://github.com/anamelesswolf/python-labs/blob/main/yt-music-playlist/yt_music_playlist.py"
click node_spotifymain "https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/main.py"
click node_spotifyauth "https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/auth_helper.py"
click node_libraryservice "https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/services/user_library_analysis_service.py"
click node_historyservice "https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/services/listening_history_service.py"
click node_libraryhelper "https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/helpers/library_helper.py"
click node_trackhelper "https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/helpers/track_helper.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tmdbcli,node_tmdbscan,node_tmdbmovie,node_tmdbclient,node_tmdbstore,node_tmdbreport,node_user toneBlue
class node_nyaacli,node_nyaascrape,node_nyaasearch,node_nyaareport,node_nyaaexport,node_pbaycli,node_pbayscrape,node_pbaysearch,node_pbayreport,node_pbayexport toneAmber
class node_setlistcli,node_setlistapi,node_setlistsongs,node_setlistalbums,node_setlistcache,node_setlistreport,node_setlistexport,node_ytmusic,node_spotifymain,node_spotifyauth,node_libraryservice,node_historyservice,node_libraryhelper,node_trackhelper,node_tmdbservice,node_setlistservice,node_itunes toneMint
```

## Components

### Library tools

- [TMDB commands](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/cli.py): `tmdb-updates/tmdb_app/cli.py`
- [Library scanner](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/scanner.py): `tmdb-updates/tmdb_app/scanner.py`
- [Movie data](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/movie.py): `tmdb-updates/tmdb_app/movie.py`
- [TMDB client](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/tmdb_client.py): `tmdb-updates/tmdb_app/tmdb_client.py`
- [Library store](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/store.py): `tmdb-updates/tmdb_app/store.py`
- [Status reports](https://github.com/anamelesswolf/python-labs/blob/main/tmdb-updates/tmdb_app/report.py): `tmdb-updates/tmdb_app/report.py`

### Web scrapers

- [NYAA commands](https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/cli.py): `nyaa-scrapper/nyaa_app/cli.py`
- [NYAA scraper](https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/scraper.py): `nyaa-scrapper/nyaa_app/scraper.py`
- [Search and selection](https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/search.py): `nyaa-scrapper/nyaa_app/search.py`
- [Search report](https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/report.py): `nyaa-scrapper/nyaa_app/report.py`
- [JSON export](https://github.com/anamelesswolf/python-labs/blob/main/nyaa-scrapper/nyaa_app/export.py): `nyaa-scrapper/nyaa_app/export.py`
- [PBAY commands](https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/cli.py): `pbay-scrapper/pbay_app/cli.py`
- [PBAY scraper](https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/scraper.py): `pbay-scrapper/pbay_app/scraper.py`
- [Search and selection](https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/search.py): `pbay-scrapper/pbay_app/search.py`
- [Search report](https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/report.py): `pbay-scrapper/pbay_app/report.py`
- [JSON export](https://github.com/anamelesswolf/python-labs/blob/main/pbay-scrapper/pbay_app/export.py): `pbay-scrapper/pbay_app/export.py`

### Music tools

- [Setlist commands](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/cli.py): `setlist-fm-scrapper/setlistfm_app/cli.py`
- [Setlist API client](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/api.py): `setlist-fm-scrapper/setlistfm_app/api.py`
- [Song search](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/songs.py): `setlist-fm-scrapper/setlistfm_app/songs.py`
- [Album lookup](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/albums.py): `setlist-fm-scrapper/setlistfm_app/albums.py`
- [Setlist cache](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/cache.py): `setlist-fm-scrapper/setlistfm_app/cache.py`
- [Setlist reports](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/report.py): `setlist-fm-scrapper/setlistfm_app/report.py`
- [Playlist JSON](https://github.com/anamelesswolf/python-labs/blob/main/setlist-fm-scrapper/setlistfm_app/export.py): `setlist-fm-scrapper/setlistfm_app/export.py`
- [YouTube Music sync](https://github.com/anamelesswolf/python-labs/blob/main/yt-music-playlist/yt_music_playlist.py): `yt-music-playlist/yt_music_playlist.py`
- [Analysis entry point](https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/main.py): `spotify-analysis/main.py`
- [Spotify authentication](https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/auth_helper.py): `spotify-analysis/core/auth_helper.py`
- [Library analysis](https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/services/user_library_analysis_service.py): `spotify-analysis/core/services/user_library_analysis_service.py`
- [Listening history](https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/services/listening_history_service.py): `spotify-analysis/core/services/listening_history_service.py`
- [Library aggregation](https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/helpers/library_helper.py): `spotify-analysis/core/helpers/library_helper.py`
- [Track aggregation](https://github.com/anamelesswolf/python-labs/blob/main/spotify-analysis/core/helpers/track_helper.py): `spotify-analysis/core/helpers/track_helper.py`

### Other components

- **CLI user**
- **TMDB API**
- **setlist.fm API**
- **iTunes API**

## Connections

- CLI user → TMDB commands: runs commands
- TMDB commands → Library scanner: scans library (evidence: `tmdb-updates/tmdb_app/cli.py`)
- TMDB commands → Movie data: processes titles (evidence: `tmdb-updates/tmdb_app/cli.py`)
- TMDB commands → Library store: updates library (evidence: `tmdb-updates/tmdb_app/cli.py`)
- TMDB commands → Status reports: renders status (evidence: `tmdb-updates/tmdb_app/cli.py`)
- Movie data → TMDB client: queries metadata
- TMDB client → TMDB API: requests metadata (evidence: `tmdb-updates/tmdb_app/tmdb_client.py`)
- CLI user → NYAA commands: runs searches
- NYAA commands → Search and selection: dispatches searches (evidence: `nyaa-scrapper/nyaa_app/cli.py`)
- Search and selection → NYAA scraper: fetches results (evidence: `nyaa-scrapper/nyaa_app/search.py`)
- Search and selection → Search report: prompts selection (evidence: `nyaa-scrapper/nyaa_app/search.py`)
- NYAA commands → Search report: prints report (evidence: `nyaa-scrapper/nyaa_app/cli.py`)
- NYAA commands → JSON export: exports JSON (evidence: `nyaa-scrapper/nyaa_app/cli.py`)
- CLI user → PBAY commands: runs searches
- PBAY commands → Search and selection: dispatches searches (evidence: `pbay-scrapper/pbay_app/cli.py`)
- Search and selection → PBAY scraper: fetches results (evidence: `pbay-scrapper/pbay_app/search.py`)
- Search and selection → Search report: prompts selection (evidence: `pbay-scrapper/pbay_app/search.py`)
- PBAY commands → Search report: prints report (evidence: `pbay-scrapper/pbay_app/cli.py`)
- PBAY commands → JSON export: exports JSON (evidence: `pbay-scrapper/pbay_app/cli.py`)
- CLI user → Setlist commands: searches concerts
- Setlist commands → Setlist API client: fetches setlists (evidence: `setlist-fm-scrapper/setlistfm_app/cli.py`)
- Setlist API client → setlist.fm API: requests setlists (evidence: `setlist-fm-scrapper/setlistfm_app/api.py`)
- Setlist commands → Setlist cache: reads and updates (evidence: `setlist-fm-scrapper/setlistfm_app/cli.py`)
- Setlist commands → Song search: searches songs (evidence: `setlist-fm-scrapper/setlistfm_app/cli.py`)
- Setlist commands → Album lookup: looks up albums (evidence: `setlist-fm-scrapper/setlistfm_app/cli.py`)
- Album lookup → iTunes API: finds albums
- Setlist commands → Setlist reports: renders results (evidence: `setlist-fm-scrapper/setlistfm_app/cli.py`)
- Setlist commands → Playlist JSON: exports playlist (evidence: `setlist-fm-scrapper/setlistfm_app/cli.py`)
- CLI user → YouTube Music sync: syncs playlists
- CLI user → Analysis entry point: runs analysis
- Analysis entry point → Spotify authentication: authenticates (evidence: `spotify-analysis/main.py`)
- Analysis entry point → Library analysis: generates library report (evidence: `spotify-analysis/main.py`)
- Analysis entry point → Listening history: generates history report (evidence: `spotify-analysis/main.py`)
- Library analysis → Library aggregation: fetches and groups (evidence: `spotify-analysis/core/services/user_library_analysis_service.py`)
- Listening history → Track aggregation: groups tracks (evidence: `spotify-analysis/core/services/listening_history_service.py`)
