{"id":32431143,"url":"https://github.com/ryshaal/spotify-track-counter","last_synced_at":"2026-07-08T19:31:51.867Z","repository":{"id":318893415,"uuid":"1076815713","full_name":"ryshaal/spotify-track-counter","owner":"ryshaal","description":"A Python CLI tool to fetch, analyze, and export an artist's full Spotify discography with interactive stats, tracklist, and CSV export.","archived":false,"fork":false,"pushed_at":"2025-10-24T00:44:10.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-24T02:49:37.567Z","etag":null,"topics":["counter","discography","python","script","spotify","spotify-api","spotipy","spotipy-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryshaal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-15T11:38:40.000Z","updated_at":"2025-10-24T00:44:13.000Z","dependencies_parsed_at":"2025-10-17T03:50:32.526Z","dependency_job_id":"49e09520-5ee1-4dd9-a812-6118bb2360eb","html_url":"https://github.com/ryshaal/spotify-track-counter","commit_stats":null,"previous_names":["ryshaal/spotify-track-counter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ryshaal/spotify-track-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryshaal%2Fspotify-track-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryshaal%2Fspotify-track-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryshaal%2Fspotify-track-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryshaal%2Fspotify-track-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryshaal","download_url":"https://codeload.github.com/ryshaal/spotify-track-counter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryshaal%2Fspotify-track-counter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35276649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["counter","discography","python","script","spotify","spotify-api","spotipy","spotipy-api"],"created_at":"2025-10-25T21:56:33.337Z","updated_at":"2026-07-08T19:31:51.862Z","avatar_url":"https://github.com/ryshaal.png","language":"Python","funding_links":["https://ko-fi.com/riyhsal/5'"],"categories":[],"sub_categories":[],"readme":"# Spotify Artist Discography Fetcher\n\nA command-line Python application that fetches and analyzes an artist’s full discography using the **Spotify Web API** via **Spotipy**.\nDisplays formatted statistics, release summaries, and tracklists in a colorful console interface — and optionally exports the results to a CSV file.\n\n **Features:**\n\n* Fetch artist information directly by **name** or **Spotify URL**\n* Retrieve complete **discography** (albums, singles, compilations, and appearances)\n* Display:\n\n  * Total song count\n  * Active year range\n  * Release type distribution\n  * Top productive years\n* Interactive **tracklist table**\n* Export data to **CSV**\n* Built-in **song search**\n* Clean terminal output using **Rich** and **Colorama**\n* Progress bar with **tqdm**\n\n\u003ca href='https://ko-fi.com/riyhsal/5' target='_blank'\u003e\u003cimg height='40' style='border:0px;height:40px;' src='https://storage.ko-fi.com/cdn/kofi2.png?v=6' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n---\n### Clone Repository\n```bash\ngit clone https://github.com/ryshaal/spotify-track-counter.git\ncd spotify-track-counter\n```\n### Install Dependencies\n\nThis project uses the following Python packages:\n\n```txt\ncertifi==2023.11.17\ncharset-normalizer==3.3.2\ncolorama==0.4.6\nidna==3.6\nmarkdown-it-py==4.0.0\nmdurl==0.1.2\nPygments==2.19.2\npython-dotenv==1.0.1\nredis==6.4.0\nrequests==2.31.0\nrich==13.7.1\nsix==1.17.0\nspotipy==2.23.0\ntqdm==4.66.4\nurllib3==2.0.7\n```\n\nInstall all dependencies with:\n\n```bash\npip install -r requirements.txt\n```\n\n\n### Setting Up Spotify API\n\nThis application uses **Spotify Web API** through the **Spotipy** library.\n\n#### 1. Create a Spotify Developer Account\n\nGo to [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) and **log in** with your Spotify account.\n\n#### 2. Create a New App\n\nClick **\"Create App\"** and fill in:\n\n* **App name:** `Spotify Discography Fetcher`\n* **Redirect URI:** `https://localhost:8888/callback`\n\nAfter creation, you will get:\n\n* **Client ID**\n* **Client Secret**\n\n#### 3. Set Up Environment Variables\n\nYou must store your **Spotify API credentials** as environment variables so the app can authenticate.\n\nCreate a file named `.env` in your project root and add the following:\n\n```env\n# Spotify API Credentials\n\nSPOTIFY_CLIENT_ID=your_spotify_client_id\nSPOTIFY_CLIENT_SECRET=your_spotify_client_secret\n```\n### Structure\n\n```\nspotify-track-counter/\n│\n├── .env\n├── .gitignore\n├── LICENSE\n├── main.py\n├── utils/\n│   ├── spotify_client.py\n│   └── helpers.py\n│\n├── requirements.txt\n└── README.md\n```\n\n### How to Run\n\n1. Open your terminal in the project directory\n2. Run the main script:\n\n```bash\npython main.py\n```\n\n3. When prompted, enter:\n\n* The **artist name** (e.g. `The Weeknd`)\n* Or paste the **Spotify artist URL**, e.g.:\n\n```text\nhttps://open.spotify.com/artist/1Xyo4u8uXC1ZmMpatF05PJ\n```\n\n4. Follow the interactive prompts to:\n\n* Choose the correct artist (if multiple found)\n* Export discography to CSV (optional)\n* Search songs by keyword (optional)\n\n\n\n### Example Output\n\n```text\nWelcome — Spotify Artist Discography Fetcher\nCreated by https://github.com/ryshaal — powered by Spotipy API\n\nEnter artist name or Spotify artist URL: The Weeknd\n\n✅ Artist selected: The Weeknd\n• Followers: 97,812,410\n• Genres: canadian contemporary r\u0026b, pop, dance pop\n\nFetching artist's discography...\nRetrieved 154 releases in total.\nProcessing 154 albums/singles...\nFetching tracks: 100%|█████████████████████████████████████|\n\n✅ Data successfully fetched!\n\n📊 DISCOGRAPHY STATISTICS\n• Total Songs: 792\n• Year Range: 2011 - 2025\n• Total Duration: 2526 minutes\n\n📈 Top 5 Most Productive Years:\n2020: 102 songs\n2022: 84 songs\n2018: 66 songs\n2015: 60 songs\n2023: 54 songs\n\n💿 Release Type Distribution:\nAlbum: 401 songs\nSingle: 254 songs\nCompilation: 87 songs\n\n🎵 FULL TRACKLIST\n... (Table displayed in console)\n\n💾 EXPORT DATA\nExport data to CSV? (y/n): y\n✅ Data saved successfully!\n📁 File location: discography/The_Weeknd_discography.csv\n```\n\n### CSV Output Example\n\n| artist     | track           | album       | year | type  | duration | url                                                                   |\n| ---------- | --------------- | ----------- | ---- | ----- | -------- | --------------------------------------------------------------------- |\n| The Weeknd | Blinding Lights | After Hours | 2020 | album | 3:20     | [https://open.spotify.com/track/](https://open.spotify.com/track/)... |\n| The Weeknd | Save Your Tears | After Hours | 2020 | album | 3:36     | [https://open.spotify.com/track/](https://open.spotify.com/track/)... |\n\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE). Feel free to use, modify, and distribute with attribution.\n\n\n\n## Support\n\nIf you find this project useful, please give it a ⭐ on GitHub to support the development.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryshaal%2Fspotify-track-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryshaal%2Fspotify-track-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryshaal%2Fspotify-track-counter/lists"}