Metadata-Version: 2.5
Name: songsrc
Version: 0.0.2
Summary: Lean song acquisition: Genius lyrics and annotations, LRCLIB line timings (httpx + beautifulsoup4 only)
Project-URL: Homepage, https://github.com/thorwhalen/songsrc
Project-URL: Repository, https://github.com/thorwhalen/songsrc
Author: Thor Whalen
License-Expression: MIT
License-File: LICENSE
Keywords: annotations,genius,lrc,lrclib,lyrics
Requires-Python: >=3.10
Requires-Dist: beautifulsoup4>=4.11
Requires-Dist: httpx>=0.24
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# songsrc

Lean song acquisition from Genius and LRCLIB. Dependencies: `httpx` and `beautifulsoup4`, nothing else.

```python
from songsrc import GeniusClient, acquire_song, fetch_synced_lyrics, parse_lrc

with GeniusClient() as client:  # GENIUS_ACCESS_TOKEN switches to the official API
    song = acquire_song(
        client, {"id": 12345}
    )  # metadata, lyrics, referents with annotations

rows = parse_lrc(fetch_synced_lyrics(track="Burn", artist="Hamilton")["syncedLyrics"])
rows[0].start_s, rows[0].end_s, rows[0].text  # one [start, end) window per line
```

`acquire_song` returns the record Hamilton's `data/songs/*.json` is made of, so its keys are stable. The Genius client throttles (0.34 s) and retries 429/5xx with backoff. Genius's tokenless path is behind Cloudflare for non-browsers: set `GENIUS_ACCESS_TOKEN` for the official API.

Used by [griot](https://github.com/thorwhalen/griot) (research adapters) and Hamilton (`hamilton_genius`).
