The exams_loader.py file is used to retrieve the exams and the syllabus for a specific subject.
To run this module, use the following command
(.venv) $> python -m src/loaders/exams_loader.py --subject_dir={subject_dir}where {subject_dir} is the directory where the exams and syllabus are located with the following structure:
{subject_dir}
├── exams
│ ├── {subject}-{ISO Date}.pdf
│ ├── ...
└── syllabus.txt
To run the application, run the following command:
(.venv) $> python -m src.localYou can modify the exam and format inside the file.
In order to make sure we use the correct dependencies locally, we'll need to set up the environment. To do that, run the following command:
$> python3 -m venv .venvTo use the created environment, you'll need to run the following command:
$> source .venv/bin/activateAfter using the environment with the source command, you'll need to install the dependencies with the following command:
(.venv) $> pip install -r requirements.txtIn order to run the different python modules, you'll need to do the following steps:
- Make sure that module has an
__init__.pyfile inside of it. This file can be empty. - Run the file with the
-mflag.
Here's an example:
- The module I'd like to create is located at
src/repositories, so I'd create an__init__.pyfile running something like this:
$> touch src/repositories/__init__.py- Imagine we have a Python file called
testing_repository.pyinside thesrc/repositoriesdirectory. Then, we'd run the following command:
(.venv) $> python -m src.repositories.testing_repositoryUse docker build -t exams-generator ., tag the image and then push to ECR. After that, deploy a new image on the API lambda function.