# leogcalderon/track_finder architecture

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

- Interactive diagram: https://gitdiagram.com/leogcalderon/track_finder
- Repository: https://github.com/leogcalderon/track_finder

## Overview

##### Data Flow and Relationships

- [Beatport Chart] → [Beatport Parser] → [CSV File] ↘
- [Playlist Downloader] → [Downloaded Tracks]
- [SoundCloud Playlist] ----------------------------- ↗

##### Component Details

For the Beatport Parser:
- Connection to Beatport's web interface
- CSV file output
- Utils.py and constant.py as supporting components

For the Playlist Downloader:
- Dual input sources (CSV and SoundCloud)
- Downloader.py as the core component
- Soundcloud_playlist.py integration

##### Implementation Details

a. Input Processing Layer:
- CSV file handler
- SoundCloud playlist URL parser
- Beatport chart parser

b. Processing Layer:
- Track information extraction
- Download management
- Format conversion (if any)

c. Output Layer:
- Local file system storage
- Download progress tracking

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph External
        BC[Beatport Chart]
        SC[SoundCloud Playlist]
        BS[Beatport Service]
        SS[SoundCloud Service]
    end

    subgraph BeatportParser[Beatport Parser Module]
        IP["Input Processor"]:::core
        WS["Web Scraper"]:::core
        CG["CSV Generator"]:::core
        UT["Utils"]:::support
        CN["Constants"]:::support
    end

    subgraph PlaylistDownloader[Playlist Downloader Module]
        IH["Input Handler"]:::core
        DM["Download Manager"]:::core
        SI["SoundCloud Integration"]:::core
    end

    subgraph Storage
        CSV["CSV File"]:::storage
        DT["Downloaded Tracks"]:::storage
    end

    %% Connections
    BC --> IP
    IP --> BS
    BS --> WS
    WS --> CG
    UT --> WS
    CN --> WS
    CG --> CSV
    CSV --> IH
    SC --> SI
    SI --> SS
    SS --> DM
    IH --> DM
    DM --> DT

    %% Click Events
    click IP "https://github.com/leogcalderon/track_finder/blob/main/beatport_parser/main.py"
    click UT "https://github.com/leogcalderon/track_finder/blob/main/beatport_parser/src/utils.py"
    click CN "https://github.com/leogcalderon/track_finder/blob/main/beatport_parser/src/constant.py"
    click DM "https://github.com/leogcalderon/track_finder/blob/main/playlist_downloader/src/downloader.py"
    click SI "https://github.com/leogcalderon/track_finder/blob/main/playlist_downloader/src/soundcloud_playlist.py"
    click IH "https://github.com/leogcalderon/track_finder/blob/main/playlist_downloader/main.py"
    click BeatportParser "https://github.com/leogcalderon/track_finder/tree/main/beatport_parser"
    click PlaylistDownloader "https://github.com/leogcalderon/track_finder/tree/main/playlist_downloader"

    %% Styles
    classDef external fill:#FFE5CC,stroke:#FF9933
    classDef core fill:#CCEBFF,stroke:#3399FF
    classDef support fill:#E5CCFF,stroke:#9933FF
    classDef storage fill:#CCE5CC,stroke:#339933

    class BC,SC,BS,SS external
    class IP,WS,CG,IH,DM,SI core
    class UT,CN support
    class CSV,DT storage

    %% Legend
    subgraph Legend
        E[External Service]:::external
        C[Core Component]:::core
        S[Support Component]:::support
        ST[Storage]:::storage
    end
```
