Summary
Add an AudiblePlugin source plugin that loads a user's audiobook listening history from their Amazon/Audible data export. This is the audio companion to the Goodreads and StoryGraph plugins, completing book-format coverage across physical, digital, and audio reading.
Architecture
This plugin follows the project-wide source plugin contract:
-
Download-then-display — the plugin reads only from a previously downloaded local export file. No outbound network or API calls are made at Streamlit runtime. If the data file is absent, fetch() raises FileNotFoundError with a message directing the user to obtain and place the export file.
-
Data sovereignty — the plugin has no knowledge of other sources. fetch() returns only this source's canonical DataFrame. No filtering, joining, or merging with other sources is performed here; that is the exclusive responsibility of DataBroker.
Data export
How to get: amazon.com/hz/privacy-central → "Request your data" → select "Audible" → submit (email notification when ready, typically 2–5 days)
Format: ZIP containing CSV files, including:
Audible.Library.csv — full purchase/library list with acquisition dates
Audible.Listening.csv (if available) — per-session listening activity with timestamps and progress
Key fields in Audible.Library.csv:
| Field |
Maps to |
PurchaseDate (YYYY-MM-DD) |
timestamp (acquisition date) |
Title |
sublabel |
Author |
label |
Narrated |
preserve as narrator |
RuntimeSeconds |
preserve as duration_s |
ASIN |
preserve |
Key fields in Audible.Listening.csv (richer but not always present):
| Field |
Maps to |
EventDate |
timestamp (actual listen date — prefer over purchase date) |
Title |
sublabel |
AuthorName |
label |
ProgressPercent |
preserve |
ListeningLengthSeconds |
preserve as session_s |
Plugin spec
PLUGIN_TYPE: what-when
PLUGIN_ID: audible
DISPLAY_NAME: Audible Audiobooks
- Config fields:
export_dir (path to the unzipped Audible export directory)
- Prefer
Audible.Listening.csv when present (actual listen dates); fall back to Audible.Library.csv (purchase dates)
- Parse date strings to Unix timestamps (midnight UTC)
category → "audiobook"
Normalized output schema
timestamp int Unix timestamp (listen date if available, else purchase date)
label str Author name
sublabel str Book title
category str "audiobook"
source_id str "audible"
duration_s int Total runtime in seconds (NaN if unknown)
narrator str Narrator name (preserved from library export)
Acceptance criteria
Summary
Add an
AudiblePluginsource plugin that loads a user's audiobook listening history from their Amazon/Audible data export. This is the audio companion to the Goodreads and StoryGraph plugins, completing book-format coverage across physical, digital, and audio reading.Architecture
This plugin follows the project-wide source plugin contract:
Download-then-display — the plugin reads only from a previously downloaded local export file. No outbound network or API calls are made at Streamlit runtime. If the data file is absent,
fetch()raisesFileNotFoundErrorwith a message directing the user to obtain and place the export file.Data sovereignty — the plugin has no knowledge of other sources.
fetch()returns only this source's canonical DataFrame. No filtering, joining, or merging with other sources is performed here; that is the exclusive responsibility ofDataBroker.Data export
How to get: amazon.com/hz/privacy-central → "Request your data" → select "Audible" → submit (email notification when ready, typically 2–5 days)
Format: ZIP containing CSV files, including:
Audible.Library.csv— full purchase/library list with acquisition datesAudible.Listening.csv(if available) — per-session listening activity with timestamps and progressKey fields in
Audible.Library.csv:PurchaseDate(YYYY-MM-DD)timestamp(acquisition date)TitlesublabelAuthorlabelNarratednarratorRuntimeSecondsduration_sASINKey fields in
Audible.Listening.csv(richer but not always present):EventDatetimestamp(actual listen date — prefer over purchase date)TitlesublabelAuthorNamelabelProgressPercentListeningLengthSecondssession_sPlugin spec
PLUGIN_TYPE:what-whenPLUGIN_ID:audibleDISPLAY_NAME:Audible Audiobooksexport_dir(path to the unzipped Audible export directory)Audible.Listening.csvwhen present (actual listen dates); fall back toAudible.Library.csv(purchase dates)category→"audiobook"Normalized output schema
Acceptance criteria
AudiblePluginregistered via@registerand added toload_builtin_plugins()Audible.Listening.csvwhen present, falls back toAudible.Library.csvvalidate_schema()passes on output