feat: add dictionary CSV export tools (Jastrow, BDB, Klein)#68
feat: add dictionary CSV export tools (Jastrow, BDB, Klein)#68smargolis wants to merge 1 commit into
Conversation
Add CLI script and browser-based explorer for exporting Sefaria's dictionary/lexicon data as CSV files. The problem: Dictionary entries (Jastrow, BDB, Klein) use a DictionaryNode schema and aren't included in the standard GCS text export. This PR adds tools that crawl Sefaria's /api/words/ endpoint, following next_hw linked-list pointers to enumerate every entry in a given lexicon. New files: - scripts/export_dictionaries_csv.py — CLI for bulk CSV export with resume/checkpoint support, rate limiting, HTML stripping - examples/dictionary-explorer/index.html — zero-dependency browser app with search, letter navigation, and CSV download - examples/export_dictionary_example.py — quick demo script - tests/test_export_dictionaries_csv.py — 30 unit tests Updated: README.md, CLAUDE.md with dictionary export documentation.
Code reviewFound 2 issues:
Sefaria-Export/examples/export_dictionary_example.py Lines 135 to 139 in 262e5f3
Sefaria-Export/examples/export_dictionary_example.py Lines 104 to 120 in 262e5f3 On the linked gist ( 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
yodem
left a comment
There was a problem hiding this comment.
@smargolis Thanks for the PR!
I added some notes using Claude.
2 things from my side:
- there is a small problem with the html - Since its under our repo we might want it to be under our own design system and might go under product/ux teams. I think we should keep the html out of this scope and preserve only the cli tool/scripts. we can create a "powered-by" project for this html, you can have it on vercel for free and I would be happy to help with it.
- I didnt quite get why is there an export_dictionary_example.py? I mean isnt the example is the actual script? we can perhaps get rid of the example suffix.
I will also say that i didnt really get into the 2000+ lines but it is important for me to get this tool inside the repo.
Adds CLI script and browser-based explorer for exporting Sefaria's dictionary/lexicon data (Jastrow, BDB, Klein) as structured CSV files.
Dictionary entries use a DictionaryNode schema and aren't included in the standard GCS text export. These tools crawl /api/words/ following next_hw linked-list pointers to enumerate every entry.
New files: