Capstone 2 · Levels II to III

The Archive Keeper

You are building the data layer for a community history archive. The records arrive from volunteers, which means they are inconsistent: years as text, missing fields, duplicate entries, and stray whitespace. Build a system that ingests messy JSON, cleans it honestly (recording what it had to reject rather than hiding it), supports searching and filtering, and exports the clean archive back to JSON. Missing information must be represented as genuinely missing, never faked with a zero.

Concepts used

JSONData conversionError handlingCollectionsFunctionsDeduplicationNone and null

Your dataset

A JSON string of at least twelve records, of which at least four are deliberately broken.

Milestones

1Parse the incoming JSON inside a try block and survive malformed input.
2Clean each record: trim whitespace, convert years, and mark genuinely missing fields as None or null.
3Keep a rejection log naming every record you could not use and why.
4Deduplicate by title, preserving the first occurrence.
5Search by keyword and filter by decade.
6Export the cleaned archive back to JSON and prove the round trip works.

The graded core

The rest of this project is yours to shape. This one function is the piece everything else depends on, so it runs against hidden tests to prove it is right before you build outward.

◈ Graded Challenge

The heart of the archive. Write a function that takes a JSON string of records and returns how many have a valid numeric founded year. Records with non-numeric or missing years are not counted. If the JSON is malformed, return 0.

Name it exactly: def count_dated(text):

3 visible + 3 hidden
loading editor…

Your workspace

Build the full project here. Work through the milestones in order, in both languages.

SANKOFA SANDBOX
loading editor…
Your turn → Build it in Python first, then rebuild it in JavaScript. The logic transfers, only the syntax changes.
← All projectsNext: The Classroom Gradebook