How bulktornado/cbse-rdms-project works
1. Project intent
This repository is a Python data-preparation and database project for CBSE school/curriculum information. It ingests curriculum PDFs and raw school datasets, converts them into structured records, and stores them in local data files and a relational database.
2. Primary pipeline
The main flow is: reference documents and raw text data in docs/ and data/raw_datasets/ → parsing/cleanup scripts in src/ → tabular/serialized outputs in data/ and backup/ → database schema and connection layer for query/use by the application.
3. Source data boundary
docs/ contains the curriculum PDFs and the project report; these are the human/reference inputs. data/raw_datasets/ holds extracted or intermediate source material, including reference notes about filtered courses and pickled data snapshots. These are not runtime logic, but they define the input domain.
4. Parsing and normalization
src/parse_affiliated_school_data.py and src/parse_courses.py are the key transformation scripts. They appear to convert raw school/course sources into structured datasets, likely handling filtering, normalization, and mapping into consistent records for downstream storage.
5. Setup and configuration boundary
src/setup.py and src/set_configuration.py suggest a one-time or repeatable initialization phase that prepares paths, configuration, and probably database/data generation. This is separate from the parsing logic and from the runtime module layer.
6. Database schema
schemas/database_schema.sql defines the relational structure for the project. The tracked dataset names strongly indicate at least two main entities: affiliated schools and courses, with the schema serving as the contract between parsed data and the database.
7. Shared runtime modules
modules/connection_module.py centralizes database connectivity, while modules/functions.py contains reusable helpers used across scripts. This is the main internal utility layer that separates low-level I/O/DB handling from parsing/setup logic.
8. Entry point
main.py is the top-level entry point for running the project. It likely coordinates setup, data loading, and/or query operations by invoking the modules and scripts above rather than containing the business logic itself.
9. Derived data and snapshots
data/ and backup/ contain generated artifacts such as .dat and .txt files for affiliated_schools and courses. These look like persistence snapshots and interchange formats, useful for reruns, debugging, or restoring state without re-parsing the original sources.
10. One-off/manual correction path
src/forbidden_scripts/manually_update_affiliated_schools_from_tabular_data.py stands out as an exceptional maintenance script. It likely exists for manual data correction or migration and should be treated as outside the normal pipeline.
11. Execution environment
The repository is a Python project managed with pyproject.toml, requirements.txt, uv.lock, and .python-version. The architecture is local/offline and file-driven; there are no obvious external network services or web framework boundaries in the repo.
12. What to draw in an architecture diagram
A clear diagram would show:
- Reference inputs: PDFs/text/raw datasets
- Transform layer: parsing and setup scripts
- Shared services: connection/utilities
- Storage layer: schema + generated data files/backups
- Entry point: main.py
The most important boundary is between raw source material and normalized structured data.
Main entry points: parse_affiliated_school_data.py Parse schools · parse_courses.py Parse courses · setup.py Setup · main.py Main
Components 16
Source inputs
Human/reference material and raw extracted datasets that feed the preparation pipeline.
Processing layer
Scripts that parse, normalize, configure, and initialize project data.
- Parse schools · Transforms raw affiliated-school data into structured records.
src/parse_affiliated_school_data.py - Parse courses · Transforms curriculum/course sources into normalized course data.
src/parse_courses.py - Setup · Prepares the project environment and data generation workflow.
src/setup.py - Config · Centralizes path and runtime configuration.
src/set_configuration.py - Manual fix · Exceptional script for one-off correction of affiliated-school data.
src/forbidden_scripts/manually_update_affiliated_schools_from_tabular_data.py
Shared runtime
Reusable modules for database access and common helper logic.
- DB connection · Shared database connectivity and connection management.
modules/connection_module.py - Helpers · Reusable helper functions shared across scripts.
modules/functions.py
Storage layer
Generated datasets, backups, and the relational schema contract.
- Schema · Relational schema defining the database contract.
schemas/database_schema.sql - Schools data · Structured affiliated-school dataset stored for reuse.
data/affiliated_schools.dat - Courses data · Structured course dataset stored for reuse.
data/courses.dat - Schools table · Tabular affiliated-school output used for inspection or reloads.
data/tabular_data/affiliated_schools.txt - Courses table · Tabular course output used for inspection or reloads.
data/tabular_data/courses.txt - Backups · Backup snapshots for datasets and restored state.
backup/affiliated_schools.dat
Entry point
Top-level script that coordinates project execution.
- Main · Top-level program that drives the project workflow.
main.py
Connections 25
- Docs → Parse courses: curriculum source · Curriculum PDFs and notes inform course extraction.
- Docs → Parse schools: reference source · Project documentation and notes guide school-data preparation.
- Raw data → Parse schools: raw input · Raw affiliated-school material is normalized into structured records.
- Raw data → Parse courses: raw input · Raw reference datasets support course filtering and mapping.
- Config → Setup: paths · Configuration is consumed during initialization.
- Config → Parse schools: settings · Parsing relies on shared configuration values.
- Config → Parse courses: settings · Parsing relies on shared configuration values.
- Helpers → Parse schools: helpers · Reusable helpers support parsing and cleanup.
- Helpers → Parse courses: helpers · Reusable helpers support parsing and cleanup.
- Helpers → Setup: helpers · Setup uses common utility functions.
- DB connection → Setup: db access · Initialization prepares or validates database connectivity.
- DB connection → Main: db access · The entry point coordinates runtime database use.
- Schema → DB connection: contract · Database access targets the defined relational schema.
- Parse schools → Schools table: tabular output · Parsed school data is written to tabular form.
- Parse schools → Schools data: serialized output · Parsed school data is stored as a reusable dataset.
- Parse courses → Courses table: tabular output · Parsed course data is written to tabular form.
- Parse courses → Courses data: serialized output · Parsed course data is stored as a reusable dataset.
- Setup → Schools data: generates · Initialization may generate or refresh school snapshots.
- Setup → Courses data: generates · Initialization may generate or refresh course snapshots.
- Schools data → Backups: snapshot · Generated school data is mirrored in backup artifacts.
- Courses data → Backups: snapshot · Generated course data is mirrored in backup artifacts.
- Manual fix → Schools table: correction · Manual maintenance updates the school tabular dataset.
- Main → Setup: orchestrates · Main coordinates initialization before data use.
- Main → Parse schools: orchestrates · Main can invoke school-data preparation.
- Main → Parse courses: orchestrates · Main can invoke course-data preparation.