From 172479882449acf597cbe1e0b6ae0d44dc76cba9 Mon Sep 17 00:00:00 2001 From: Anas Rashid Date: Thu, 8 Oct 2026 19:46:59 +0200 Subject: [PATCH] Rename Diwan -> Divan (Roman script): divan.db, export_divan.py, divan_ids, repo links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ids unchanged (export identical). Urdu دیوان unchanged. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/sync.yml | 6 +++--- README.md | 12 ++++++------ build_index.py | 4 ++-- diwan.db => divan.db | Bin 53850112 -> 53850112 bytes export_diwan.py => export_divan.py | 12 ++++++------ manifest.json | 2 +- update.sh | 4 ++-- wikisource.py | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) rename diwan.db => divan.db (99%) rename export_diwan.py => export_divan.py (95%) diff --git a/.gitea/workflows/sync.yml b/.gitea/workflows/sync.yml index 7836d457a..5d21a7635 100644 --- a/.gitea/workflows/sync.yml +++ b/.gitea/workflows/sync.yml @@ -3,7 +3,7 @@ on: schedule: - cron: "0 3 * * *" # daily 03:00 UTC push: # also run when the sync code changes (bot data commits don't touch these, so no loop) - paths: [wikisource.py, build_index.py, export_diwan.py, update.sh, .gitea/workflows/sync.yml] + paths: [wikisource.py, build_index.py, export_divan.py, update.sh, .gitea/workflows/sync.yml] workflow_dispatch: # "Run workflow" button, Gitea 1.23+ jobs: sync: @@ -11,6 +11,6 @@ jobs: steps: - uses: actions/checkout@v4 - run: | - git config user.name "diwan-bot" - git config user.email "diwan-bot@noreply.git.anasrashid.net" + git config user.name "divan-bot" + git config user.email "divan-bot@noreply.git.anasrashid.net" ./update.sh diff --git a/README.md b/README.md index 3c048372e..6c6d334c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# دیوان · Diwan +# دیوان · Divan A local, searchable SQLite database of **classical Urdu literature, both poetry and prose**: ghazals, nazms, marsiyas, masnavis, letters, dastans and essays by poets and writers such as Mir, Sauda, Dard, Ghalib, Momin, Zauq, Dagh, Anees, Hali, Akbar Allahabadi, Allama Iqbal, Mir Amman, Sir Syed and Nazir Ahmad. Each author entry includes a short introduction. @@ -11,7 +11,7 @@ Everything is in **Urdu script**. Everything is fetched through the official MediaWiki API. -## Database (`diwan.db`) +## Database (`divan.db`) | table | contents | |---|---| @@ -45,16 +45,16 @@ SELECT title, poet_page FROM works_fts WHERE works_fts MATCH 'خودی'; ## Site/API format (Ganjoor-compatible) -The repo root also holds the data in the [ganjoor-data](https://github.com/ganjoor/ganjoor-data) layout (`manifest.json`, `poets/`, `index/`, built by `export_diwan.py`). It works as a static API over jsDelivr with no server: +The repo root also holds the data in the [ganjoor-data](https://github.com/ganjoor/ganjoor-data) layout (`manifest.json`, `poets/`, `index/`, built by `export_divan.py`). It works as a static API over jsDelivr with no server: - https://cdn.jsdelivr.net/gh/anas-rashid/diwan-data@main/manifest.json - https://cdn.jsdelivr.net/gh/anas-rashid/diwan-data@main/poets/p238/_cat.json # Iqbal + https://cdn.jsdelivr.net/gh/anas-rashid/divan-data@main/manifest.json + https://cdn.jsdelivr.net/gh/anas-rashid/divan-data@main/poets/p238/_cat.json # Iqbal It also loads directly into [GanjoorService](https://github.com/ganjoor/GanjoorService) through its "public data import" page: give it the base URL above. Poets are `/p{id}`, categories are a genre slug (`ghazal`, `nazm`, …) or `c{id}`, and poems are `sh{id}`. Ids stay stable across syncs. Poet years are converted to approximate Hijri, following Ganjoor's convention. ## License - **Code:** [MIT](LICENSE). -- **Data** (`diwan.db`, `export/`): the literary works are in the public domain. The compilation is derived from Wikisource and Wikipedia and is shared under **[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)**. When reusing it, credit *"Urdu Wikisource and Wikipedia contributors"* and share alike. Every record keeps its source `url`. +- **Data** (`divan.db`, `export/`): the literary works are in the public domain. The compilation is derived from Wikisource and Wikipedia and is shared under **[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)**. When reusing it, credit *"Urdu Wikisource and Wikipedia contributors"* and share alike. Every record keeps its source `url`. Corrections belong upstream: fix the text on Wikisource and re-run the script. diff --git a/build_index.py b/build_index.py index c16380c48..1ff9aa2f0 100644 --- a/build_index.py +++ b/build_index.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -"""Build FTS5 full-text search over diwan.db and export JSONL. Safe to re-run.""" +"""Build FTS5 full-text search over divan.db and export JSONL. Safe to re-run.""" import json, os, sqlite3 d = os.path.dirname(os.path.abspath(__file__)) -db = sqlite3.connect(f"{d}/diwan.db") +db = sqlite3.connect(f"{d}/divan.db") db.executescript(""" DROP TABLE IF EXISTS works_fts; CREATE VIRTUAL TABLE works_fts USING fts5(title, poet_page UNINDEXED, kind UNINDEXED, section, text_ur, diff --git a/diwan.db b/divan.db similarity index 99% rename from diwan.db rename to divan.db index 600ae828e843150c4ce6ab32d50a25b5966f4d09..4e109f5dfce2923463d9f9194e6764fdeb3e2ad8 100644 GIT binary patch delta 3941 zcmYM!cT|XN7{_syG-MP>i!@QGls%Iul9d@MGBPqEo6Kw_d&}N3Gqd*|*<|m%_xt-g z&Uv46zMpfQ`#I0`-*YGBWZNdG6no3?T)F%sbN&B>rh54sgl9ybv~W(0iI0klO^A*A zH<$)B2@Z@1c8UnB6&CE|tn;+6e9;#F-bVT9U{q$lN@>XS(kMdQ1s;u%?0jiuTuPUgDs*4UiDPHRBzQsC8)ltpGs8y)c`e64N`;E5H(Z{Q^Qq~8lgt2QEIdr zqsFRaHBOCJ6VyaCNljK$)KrzCQq?q-rlzYIYNnc{W~(`Bu9~Ojs|9MITBH`MB`RGl zRm;?JwL+~_tJG?>My*xr)Oxi+ZB(07hT5#QsI6+7+OBq}Otn+(QoGe2wO8#^S!%yJ zpbn}->aaSZj;dqoxH_Rus#EH;I-}02bLzahpf0LQ>ax0`vei{}OVWBKN zeyQK;&qV$EQxzD35#$DA$O9%|3T9vqdBFnyF38VR01AR7SV18u4AxKtY@jIEf*sg{ z12{r4C=O0g0-V7GT)_?8!2?P{DJTt|;04}L27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