Skip to content

Amichai/Sefaria-Project

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

New Interfaces for Jewish Texts

Sefaria is creating interfaces, apps (like a source sheet builder) and infrastructure (like an API and a structured dataset) for Jewish texts and textual learning. Our demo is up at www.sefaria.org.

You can find outputs of our entire database in Sefaria-Data.

Interested developers should join the sefara-dev mailing list.

For general discussion about the project, please post to the Sefaria Forum.


Getting Started

Install dependencies using pip and virtualenv:

If you don't already have them, install virtualenv and pip. Then use them to install the required Python packages.

$ virtualenv venv --distribute
$ pip install -r requirements.txt
$ source venv/bin/activate

Now you should see (venv) in front of your command prompt. The third command sets your shell to use the Python virtual environment that you've just created. This is something that you have to run everytime you open a new shell and want to run the Sefaria demo. You can always tell if you're in the virtual environment by checking if (venv) is at the beginning of your command prompt. If for some reason you don't want to use virtualenv, just run the second command.

Create a local settings file:

cd sefaria
cp local_settings_example.py local_settings.py
vim/nano/subl/mate local_settings.py

Replace the placeholder values with values with those matching your enviornment. Choose a name for you local database (sefaria will be the default created by mongorestore below). You can leave SEFARIA_DB_USER ad SEFARIA_DB_PASSWORD blank if you don't need to run authentication on mongo.

Get mongod running:

If you don't already have it, install MongoDB. Then get it running:

monogod

Put some texts in your database:

A MongoDB dump of our database is included in the separate Sefaria-Data repo. Once you've cloned this repo you can:

cd Sefaria-Data
mongorestore

This will create (or overwrite) a mongo database called sefaria.

Set up Django's local server

If you plan to work on any of the account features, you'll need to run:

 python manage.py syncdb

to set up Django's authentication system.

Run the development server:

python manage.py runserver

Exploring the Code

Some of the most important code is found in:

  • static/js/reader.js - JS for reader app
  • static/js/sheets.js - JS for source sheet builder
  • static/js/util.js - JS shared across apps
  • sefaria/texts.py - backend core for manipulating texts
  • sefaria/sheets.py - backend for source sheets
  • sefaria/history.py - revision history for texts

texts.py can be used as a standalone interface to texts or for testing:

cd sefaria
python -i texts.py
>>> get_text("Kohelet 4:9")

License

GPL

About

New Interfaces for Jewish Texts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published