androidengineers.Book a session

Python 14 · Build a complete Python application

Design a document-processing CLI from requirements

articleSelf-paced

Learn the concept

Your Python capstone is a document-processing CLI that reads local JSON records, validates them, stores accepted records in SQLite, and writes a summary. It does not need a model yet. The goal is to prove that you can organize and test a real application before adding nondeterministic behavior.

Define a record with ID, title, text, and source version. Decide what constitutes a duplicate and what an update means. Keep parsing, validation, storage, and reporting in separate modules. The command should produce an explicit exit outcome when the input cannot be processed.

Use synthetic sample data and preserve provenance. A rejection report should identify the record and reason without copying unnecessary content. Write the expected behavior before implementation so the final review has something concrete to assess.

Run and inspect

sample = {"id": "d1", "title": "Setup", "text": "Create a workspace.", "version": 1}
required = {"id", "title", "text", "version"}
assert required <= sample.keys()

Your exercise

Write the CLI contract, record schema, duplicate/update policy, and module layout. Create five valid and five invalid input fixtures.

Check your understanding

The specification covers empty input, malformed JSON, duplicate IDs, updates, and an unwritable output destination.

YOUR LEARNING JOURNEY

0 of 119 available lessons completed

Progress saved in this browser. No account needed.
Design a document-processing CLI from requirements | Forward Deployed Engineer | Android Engineers