Sefaria-SQL
Sefaria-SQL copied to clipboard
Converts Sefaria-Export to SQL database
Sefaria-SQL
Converts Sefaria-Export to SQLite database.
Where to get database
How to use
- git clone https://github.com/Sefaria/Sefaria-SQL.git
- git clone https://github.com/Sefaria/Sefaria-Export.git (into the same dir that Sefaria-SQL is in)
- Go to scripts/links and run: pytyhon2 createLinks.py
- Go to scripts/fileList and run: pytyhon2 createFileList.py
- (Not really needed b/c headers are part of clone) go to Sefaria-SQL/scripts/headers and run: pytyhon2 createHeaders.py
- Open Sefaria-SQL in Eclipse for Java (File -> import -> Existing Projects into Workspace)
- In src/SQLite.java, you can change variables
- Run project
- The exported database is in testDBs/ and word counts are saved in wordCounts/
Exploring the Code
The java code is in src/
SQLite.java is the highest level code (it run at startup). Book.java contains methods for inputing the data about each book into the database. Simularly, Header, Link, Searching, and Text are responsible for putting their respective items into the database (in their own table). Node.java is responsible for putting in Nodes for complex texts and/or alternate structures.
There are some preprocessing python srcipts in scripts/
scripts/fileList/createFileList.py creates a list of files to be upload based on the index and exported files.
scripts/links/createLinks.py converts Sefaria-Export/links/links.csv to scripts/links/links0.csv which has divided level numbers and is easier to upload.