- Update, install, and upgrade pip:
sudo apt update sudo apt install python3-pip pip3 --version sudo pip3 install --upgrade pip
- Set up the .env file:
sudo cp src/.env.example src/.env
- Create a new virtual environment:
python3 -m venv .venv
- Activate the virtual environment:
source .venv/bin/activate - Install requirements in the virtual environment:
pip3 install -r requirements.txt
- Run the
db.pymodule with the initialize argument:python3 src/db.py --initialize
This creates a new local SQLite3 database in the root folder of this project.

- Run the
db.pymodule again with the test argument:python3 src/db.py --test
This will create two test entries in the newly created database in the
measurementstable.
You can delete them after verifying that it works.

Coming soon...
Now, if you run any of the PySpectrometer2 scripts, it should, based on the DB_TYPE (sqlite3, postgresql) from the .env file, select the correct database and write data to the database whenever a new .csv file is generated.