Building a Book Distribution System in One Session
200 lines of Python. $0/month. One command.
The problem
Bill wrote a memoir and wanted to give it away for free. Not sell it. Give it. To anyone who asked, through any channel — email, Teams, LinkedIn, text message, word of mouth.
The constraints:
- No platform. No Mailchimp, no Substack, no Gumroad. Zero monthly cost.
- Track who has the book — not for marketing, for knowing. "I'd like to meet the people my book meets."
- Handle the real world: people change jobs, change emails, use multiple addresses, have names that don't fit Anglo naming conventions.
- Generate expiring download links so the file isn't just sitting on a public URL forever.
- Send personalized emails, not blasts.
The design decision: person-centric, not email-centric
Most systems track email addresses. This one tracks people.
The identity ledger is a markdown file where each person is a node with a canonical ID, known email addresses, aliases, company history, and delivery status. When someone changes jobs (common in advertising — companies merge constantly), their node gets a new email, not a new entry.
## eng_seng_ang - **Emails:** engseng.ang@kinesso.com - **Aliases:** Eng Seng Ang - **Status:** Sent 2026-04-10 - **Company:** Kinesso (APAC) - **Notes:** Requested via Teams
The ledger also tracks forwarding chains — who passed the book to whom. Lindsay gave it to Karlene. Tom got it from a dinner conversation. The graph grows organically because the license asks recipients to tell Bill who they're passing it to.
The factory
One Python script: book_factory.py. Four commands:
python3 book_factory.py send
Generates a temporary download link (technically called a presigned S3 URL) that expires in 24 hours, sends personalized emails to all pending recipients via Gmail, updates each recipient's status and timestamp. One command, all pending deliveries.
python3 book_factory.py dry-run
Same as send, but prints the emails instead of sending them. For checking before you fire.
python3 book_factory.py add
Add a new recipient with automatic duplicate detection. Won't add someone who's already in the list.
python3 book_factory.py list
Display all recipients with status, dates, and summary counts.
How the pieces connect
Presigned URLs
The book PDF lives in an S3 bucket. It's not public. Each distribution run generates a fresh presigned URL — a temporary, authenticated download link with a built-in access key that expires after 24 hours. After expiration, the link is dead. No permanent public file.
aws s3 presign s3://bucket/book.pdf --expires-in 86400
SMTP via Gmail
Emails go through Gmail using a special access token (not the main account password), over an encrypted connection. Each email is individually composed with the recipient's name — not a mail merge, not a BCC blast.
The email itself
From: Bill Berger. Subject: "My book — free copy for you." Body: a personal message explaining the book, a 24-hour download link, and the propagation request — if you pass it along, tell me who it's for and why.
That propagation request is the distribution engine. It's not tracking. It's not analytics. It's a human asking other humans to close the loop. WinRAR rules: honor system, no enforcement.
The human/AI split
The human decided
- The book is free. Period.
- Track people, not emails.
- WinRAR license — honor system, no DRM.
- Every recipient is individually approved. No batch imports, no scraping, no "add everyone in my contacts."
- The propagation model — ask, don't track.
The AI built
- The factory script — presigned URL generation, SMTP integration, recipient management, duplicate detection.
- The identity ledger format — person-centric schema with forwarding chains.
- The skill command (
/book-distro) that scans email for requests and runs the factory. - The whole thing in one session. Tested, debugged, deployed.
What you can steal from this
- Presigned URLs are free distribution infrastructure. S3 costs pennies. Presigned URLs cost nothing. You don't need a platform to give away a file securely.
- Track people, not addresses. If your system breaks when someone changes jobs, your data model is wrong.
- Honor systems work. The WinRAR model — free to use, pay if you want, no enforcement — has distributed more software than most commercial licensing schemes. It works for books too.
- Personalization beats scale. Thirty individually addressed emails create more engagement than 3,000 BCC blasts. The factory makes personalization cheap, not unnecessary.
- The whole thing is 200 lines. No framework. No dependencies beyond two standard libraries (one for Amazon cloud storage, one for email). If the AI disappears tomorrow, any junior developer can maintain this. That's the point.
← Back to case studies · Get the book
Disclosure: This page was generated by Claude (Anthropic) under Bill's direction. The distribution system described here is real and in production use.