Tutorial

Python Structured JSON Extraction with OpenAI

Build a Python command-line tool that loads travel-journal files, requests JSON-shaped extraction from an OpenAI chat model, validates every response with Pydantic, and writes a reusable report.

What You Will Build

This tutorial builds travel_journal_analyzer, a small but production-minded Python application. It accepts a text, Markdown, CSV file, or a directory containing those formats. It converts each source into a consistent JournalEntry, sends the entry to an OpenAI chat model, validates the returned JSON locally, and writes one JSON report for downstream software.