Loading the Database¶
To load the database you must ingest (create the course JSON), validate (make sure the data makes sense), and digest (load the JSON into the database). You can do so using the following commands:
You will often have to run commands within the Docker containers. To access
containers, open the Docker explorer on the left pane. There should be three
postgres:12.1. Right clicking any of these should give you the option
Shell, which will open a terminal into the corresponding container. For this
section, attach the shell to the
To parse JHU data, you will need to acquire an API access key from SIS. Add the key to
dev_credentials.py in the
semesterly/ directory. Also, note that the [SCHOOLCODE] is
python manage.py ingest [SCHOOLCODE] --years [YEARS] --terms [TERMS]
For example, use
python manage.py ingest jhu --years 2022 --terms Spring to parse
Spring 2022 courses. You may also leave out the school code to parse all schools. This
will run for a substantial amount of time and is not recommended.
If you have ingested before and still have the JSON file on your device, you may skip ingesting and simply digest the old data. This is useful if you are resetting your database during development and wish to quickly reload course data.
python manage.py digest [SCHOOLCODE]
You may leave out the school code to digest all schools.
Learn More & Advanced Usage¶
There are advanced methods for using these tools. Detailed options can be viewed by running
python manage.py [command] --help
You may need to run Postgres commands beyond what running queries through the
Postgres extension is capable of. In this case, attach a shell to the postgres
container and run
psql -U postgres. You should now be in the postgres shell. You
\q to leave it.