{"id":35164266,"url":"https://github.com/saniyaacharya04/spotify_audio_analyzer","last_synced_at":"2026-04-29T07:32:16.720Z","repository":{"id":320003461,"uuid":"1080421016","full_name":"saniyaacharya04/spotify_audio_analyzer","owner":"saniyaacharya04","description":"Interactive Streamlit dashboard for analyzing Spotify playlists using audio features, clustering, and dynamic visualizations—built with Spotipy, Plotly, and scikit-learn","archived":false,"fork":false,"pushed_at":"2025-12-21T13:23:31.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T04:42:43.891Z","etag":null,"topics":["audio-analysis","clustering","dashboard","kmeans","music-analytics","python","spotify","spotipy","streamlit"],"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/saniyaacharya04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-21T10:50:04.000Z","updated_at":"2025-12-21T13:23:34.000Z","dependencies_parsed_at":"2025-10-21T12:31:44.719Z","dependency_job_id":null,"html_url":"https://github.com/saniyaacharya04/spotify_audio_analyzer","commit_stats":null,"previous_names":["saniyaacharya04/spotify_audio_analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saniyaacharya04/spotify_audio_analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saniyaacharya04%2Fspotify_audio_analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saniyaacharya04%2Fspotify_audio_analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saniyaacharya04%2Fspotify_audio_analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saniyaacharya04%2Fspotify_audio_analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saniyaacharya04","download_url":"https://codeload.github.com/saniyaacharya04/spotify_audio_analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saniyaacharya04%2Fspotify_audio_analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32416145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["audio-analysis","clustering","dashboard","kmeans","music-analytics","python","spotify","spotipy","streamlit"],"created_at":"2025-12-28T19:05:14.502Z","updated_at":"2026-04-29T07:32:16.714Z","avatar_url":"https://github.com/saniyaacharya04.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spotify Audio Analyzer\n\n[![CI](https://github.com/saniyaacharya04/spotify_audio_analyzer/actions/workflows/ci.yml/badge.svg)](https://github.com/saniyaacharya04/spotify_audio_analyzer/actions)\n\nA **backend-first, SaaS-style Spotify analysis service** built with **FastAPI**, **SQLAlchemy**, and **Spotify Web API**.\nThe system demonstrates **real API integration**, **API key authentication**, **usage-based rate limiting**, **premium feature gating**, and **end-to-end CI validation**.\n\nThis project is designed to be **recruiter-reviewable**, **interview-defendable**, and **production-realistic**.\n\n---\n\n## Key Capabilities\n\n### 1. Real Spotify Data Integration\n\n* Uses Spotify **Client Credentials Flow**\n* Fetches real track metadata from Spotify Web API\n* No mock data in production paths\n\n### 2. SaaS-Style API Authentication\n\n* API-key based access control\n* Free and Premium plans\n* Invalid key handling with proper HTTP semantics\n\n### 3. Usage-Based Rate Limiting\n\n* Daily request limits for free users\n* Persistent usage tracking via database\n* Clean error signaling when limits are exceeded\n\n### 4. Premium Feature Gating\n\n* Premium-only endpoints protected at API layer\n* Audio features endpoint intentionally gated\n* Placeholder clearly documents OAuth Authorization Code requirement\n\n### 5. Clean Architecture\n\n* Layered structure: API → Services → Integrations → Domain\n* Clear separation of concerns\n* Testable, maintainable modules\n\n### 6. Full CI Discipline\n\n* Unit tests with isolated in-memory database\n* End-to-end API tests using real HTTP calls\n* GitHub Actions pipeline with Python version matrix\n* CI badge reflecting repository health\n\n---\n\n## Tech Stack\n\n* Python 3.9 – 3.11\n* FastAPI\n* SQLAlchemy\n* SQLite\n* Spotify Web API\n* Pytest\n* GitHub Actions\n* Docker\n\n---\n\n## Project Structure\n\n```\nspotify_audio_analyzer/\n├── src/\n│   ├── app/\n│   │   ├── api/            # FastAPI routes\n│   │   ├── services/       # Business logic\n│   │   ├── integrations/   # Spotify API client\n│   │   ├── core/           # Config, DB, errors\n│   │   └── domain/         # Domain logic\n│   └── main.py             # App entrypoint\n├── tests/\n│   ├── unit/               # Fast unit tests (in-memory DB)\n│   └── e2e/                # API-level integration tests\n├── scripts/\n│   └── e2e.sh              # Full end-to-end test script\n├── docker/\n│   ├── Dockerfile\n│   └── docker-compose.yml\n├── .github/workflows/ci.yml\n├── Makefile\n├── requirements.txt\n├── LICENSE\n└── README.md\n```\n\n---\n\n## API Overview\n\n### Health Check\n\n```\nGET /health\n```\n\n### Track Metadata (Free)\n\n```\nGET /analyze/{track_id}\nHeader: X-API-Key\n```\n\nReturns:\n\n* Track name\n* Artist\n* Album\n* Popularity\n* Duration\n* Explicit flag\n\n### Premium Audio Features (Gated)\n\n```\nPOST /premium/audio-features/{track_id}\nHeader: X-API-Key\n```\n\n* Free users receive `402 Payment Required`\n* Premium users receive a documented placeholder response\n* Designed for OAuth Authorization Code flow extension\n\n---\n\n## Environment Variables\n\nCreate a `.env` file (not committed):\n\n```\nSPOTIFY_CLIENT_ID=your_client_id\nSPOTIFY_CLIENT_SECRET=your_client_secret\n```\n\n---\n\n## Local Development\n\n### Setup\n\n```\nconda create -n spotify-audio-analyzer python=3.10\nconda activate spotify-audio-analyzer\npip install -r requirements.txt\n```\n\n### Run API\n\n```\nuvicorn src.main:app --reload\n```\n\n### Run Unit Tests\n\n```\npytest tests/unit -v\n```\n\n### Run Full End-to-End Tests\n\n```\nchmod +x scripts/e2e.sh\n./scripts/e2e.sh\n```\n\n---\n\n## CI Pipeline\n\nThe GitHub Actions workflow performs:\n\n1. Python syntax validation\n2. Unit tests with in-memory SQLite\n3. End-to-end API tests\n4. Multi-version Python validation (3.9, 3.10, 3.11)\n\nAll checks must pass before merge.\n\n---\n\n## Design Decisions (Intentional)\n\n* Audio features endpoint gated to reflect real Spotify OAuth constraints\n* Client Credentials used only where allowed by Spotify policy\n* In-memory DB for unit tests to ensure speed and isolation\n* File-based DB only used in runtime/E2E paths\n* Explicit SaaS-style error handling instead of silent failures\n\n---\n\n## License\n\nMIT License\n\n---\n\n## Author\n\nSaniya Acharya\nB.Tech Computer Science Engineering\nBackend / Systems / API Engineering Focus\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaniyaacharya04%2Fspotify_audio_analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaniyaacharya04%2Fspotify_audio_analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaniyaacharya04%2Fspotify_audio_analyzer/lists"}