Every agency hits the same wall. A potential client fills out an intake form. What comes back is a block of unstructured text. Someone has to read it, extract the budget buried in the prose, assess urgency, and manually create a CRM record.
For five clients a week that's an annoyance. For fifty it becomes a part-time job. For a hundred it breaks the business.
So I automated it.
What I Built
A Python script that:
- Reads raw intake text exactly as a client types it
- Sends it to Claude with a structured extraction prompt
- Receives a clean JSON object back
- Validates every field with Pydantic
- Saves the complete record to Airtable automatically
No human reads the intake. No human creates the CRM entry. A clean lead appears in Airtable ready for follow-up — in seconds.
New Skills This Introduced
Structured extraction prompting
Telling Claude to return only JSON with specific fields, making AI output predictable and parseable.
Pydantic field validation
Catching bad AI output before it corrupts your data, defining exactly what shape the data must be.
@field_validator
Custom rules that fix or reject individual fields e.g. if urgency is not Low/Medium/High, default to Medium.
pyairtable
Writing records to Airtable via API from Python — your CRM integration layer.
glob()
Looping over all files matching a pattern, process 2 intakes or 200 with the same code.
What I Learned
The most valuable thing today wasn't the code, it was the pattern. Unstructured text in. Validated structured data out. Saved to a system of record.
This same pattern applies to support ticket classification, lead qualification, invoice extraction, contract review, and survey analysis. Once you understand it, you can deliver one of the highest-value automations in the market.
🔗 Full project on GitHub → https://github.com/mbuguacessy-glitch
49 more to go.
Top comments (0)