| Metadata | Value |
|---|---|
| Status | Archived |
| Version | 1.0.0 |
| Last Updated | 2026-09-10 |
| Author | Sangeetha Grantha Team |
| Document Type | Archive |
[!NOTE] Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current ingestion guide.
We have a set of CSV files (Dikshitar, Syama Sastri, Thyagaraja) containing metadata for Krithis (Title, Raga, Source URL). The goal is to ingest this data into the Sangeetha Grantha platform to populate the system of record.
This is not just a database seed operation but the entry point for a comprehensive Import Pipeline. The CSVs act as the “Manifest” for ingestion. The pipeline must:
imported_krithis).WebScrapingService).Raga: Kalyani, Composer: Dikshitar).krithis table.We have three primary CSV files in database/for_import/:
Key Observation: All sources are Blogspot-based archives with similar structures. This simplifies the scraping logic (Phase 2) but requires robust handling of the initial CSV parsing (Phase 1).
We will adopt a Staged Ingestion approach using the ImportPipelineService pattern defined in the architecture docs.
Goal: Get CSV rows into imported_krithis table as “Pending” records.
import_sources table has entries for the three blogs.imported_krithis:
source_key = Hyperlink (Unique ID)raw_title = Krithi Nameraw_raga = Raga Nameimport_status = ‘pending’parsed_payload = { "original_csv_row": ... }Goal: Turn “Pending” records into fully populated drafts.
source_key (URL).WebScrapingService.imported_krithis with raw_lyrics, raw_tala, etc.We will use a Python script (tools/scripts/ingest_csv_manifest.py) to generate SQL seed files. This approach is preferred over runtime parsing for the initial seed because it’s reproducible, version-controllable, and uses our existing sangita-cli seed mechanism.
| CSV Column | Database Column (imported_krithis) |
Logic |
|---|---|---|
Hyperlink |
source_key |
Primary Identifier. Must be unique per source. |
Krithi |
raw_title |
Direct map. |
Raga |
raw_raga |
Direct map. |
| Derived | import_source_id |
Lookup based on filename (e.g., Dikshitar -> Guru Guha ID). |
| Derived | raw_composer |
Constant based on file (e.g., “Muthuswami Dikshitar”). |
import_sources)We need to define stable UUIDs for these sources to ensure idempotency.
-- database/seed_data/03_import_sources.sql
INSERT INTO import_sources (id, name, base_url, description) VALUES
('...uuid-1...', 'Guru Guha Vaibhavam', 'http://guru-guha.blogspot.com', 'Archive of Dikshitar Krithis'),
('...uuid-2...', 'Syama Krishna Vaibhavam', 'http://syamakrishnavaibhavam.blogspot.com', 'Archive of Syama Sastri Krithis'),
('...uuid-3...', 'Thyagaraja Vaibhavam', 'http://thyagaraja-vaibhavam.blogspot.com', 'Archive of Thyagaraja Krithis')
ON CONFLICT (id) DO NOTHING;
The script will:
04_initial_manifest_load.sql containing INSERT statements.import_sources table exists (Migration 04__import-pipeline.sql is already applied?).tools/scripts/ingest_csv.py.database/seed_data/.tools/sangita-cli -- db seed.imported_krithis count.Once data is in imported_krithis, the Conductor track will move to “Enrichment”. We will need to implement the KarnatikSourceHandler or BlogspotSourceHandler (as hinted in import-pipeline-technical-implementation-guide-goose.md) to parse the specific HTML structure of these blogspots.
Next Immediate Step: Confirm migration status and generate the SQL seed files.