From 945ee3ecd603b513df4cd7d316012ac848b7943c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Sch=C3=BCtz?= Date: Sat, 25 Jan 2025 16:39:58 +0100 Subject: [PATCH] Add initial project setup with environment example, README, and requirements --- .env.example | 4 ++++ .gitignore | 10 +++++++++- README.md | 26 ++++++++++++++++++++++++++ requirements.txt | 4 ++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .env.example create mode 100644 README.md create mode 100644 requirements.txt diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3781681 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +# .env +STUDY_MATERIAL_ROOT_DIR=YOUR_STUDY_MATERIAL_ROOT_DIRECTORY +MOODLE_USERNAME=YOUR_MOODLE_USERNAME +MOODLE_PASSWORD=YOUR_MOODLE_PASSWORD diff --git a/.gitignore b/.gitignore index 432df37..28ad1d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ # Temporary files **/*.log **/data +**/out -**/.env +**.env +**!.env.example # IDE **/.idea/ @@ -47,3 +49,9 @@ # Latex !**/out/*.pdf **/auxil/* + +# python +**/__pycache__/ +**/.pytest_cache/ +**/.mypy_cache/ +**/.coverage diff --git a/README.md b/README.md new file mode 100644 index 0000000..60831ac --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Moodle Scraper +## Installation + +### Windows +```bash +python -m venv .venv +.venv\Scripts\activate +``` + +### MacOS/Linux +```bash +python -m venv .venv +source .venv/bin/activate +``` + +```bash +pip install -r requirements.txt +``` + +## Usage +1. Make a .env file in which you specify the path to save the files and the username and password for your moodle account. + +2. Run the program with: +```bash +python main.py +``` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..bce0958 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +python-dotenv==1.0.1 +Requests==2.32.3 +selenium==4.28.1 +webdriver_manager==4.0.2