Kanjimori Data Pipeline
The Kanjimori data pipeline processes linguistic data for the Kanjimori web application and generates the Kanjimori database, a collection of over 1,800 annotated kanji with composition and classification data. The pipeline performs computationally intensive data collation, validation, cleaning, and transformation steps, producing datasets formatted for ingestion by the Kanjimori server.
Input data includes original content developed for Kanjimori, authoritative reference datasets, and third-party datasets used under applicable licenses or permissions. The pipeline's output files serve as the source of truth for all non-user data consumed by the application. Following data preparation, the pipeline runs validation tests against the generated output files rather than relying solely on its internal processing state. This allows the tests to detect serialization, formatting, and data consistency errors in the datasets consumed by the Kanjimori server.
Unlike the Go-based Kanjimori server, the Kanjimori data pipeline is written in Python to take advantage of libraries such as pandas and built-in support for JSON and XML processing. The pipeline ingests data in TXT, CSV, XML, and JSON formats and produces JSON-serialized output files conforming to a shared data interface contract. This contract has evolved alongside the application's requirements, allowing the pipeline and server to be developed independently. Computationally expensive transformations are handled by independently invoked preprocessing routines, with results cached as persistent intermediate files. These files are regenerated only when relevant data or processing requirements change, allowing regular pipeline executions to reuse previously computed results.
The pipeline generates several datasets, including enriched kanji and vocabulary dictionaries, precompiled kanji composition trees, and lesson content. The kanji and vocabulary dictionaries serve as authoritative references within the application's data model, with other datasets referencing their entries rather than duplicating data. The pipeline also generates reports used by the server to validate imported data and display database statistics.
Modular Pipeline Architecture
As Kanjimori expanded to support kanji, vocabulary, stories, songs, and other content, the growing diversity of data sources and processing requirements motivated a modular pipeline architecture.
I organized the current pipeline around three core modules: Rokuto, responsible for kanji and lesson data; Shimasuke, responsible for vocabulary processing; and Honoka, responsible for text parsing. Each module is independently callable and exchanges intermediate data through explicit function arguments rather than direct dependencies on other pipeline modules. This separation of responsibilities allows new processing functionality to reuse existing components without introducing tightly coupled dependencies.
Data Pipeline Interface
We designed a JSON file-based interface between the Kanjimori data pipeline and the web application, allowing the two systems to operate and evolve independently. The resulting intermediate datasets serve as the authoritative source of application data, separating data generation from server-side ingestion and storage.
The file-based interface also provides an inspectable boundary between the systems. Output datasets can be examined manually or with third-party tools, making it easier to isolate errors originating from pipeline processing versus server-side ingestion.
I am primarily responsible for the architecture, development, and maintenance of the Kanjimori data pipeline. My co-founder Ed Altorfer and I collaborate closely on defining the application's data requirements and the interface contract between the pipeline and server.