- Run command
python3 -m venv venv
- Run command
. venv/bin/activate
to activate the virtual environment - Run
pip install --upgrade pip
- Run
sudo apt install python3-dev libpq-dev
- Run command
pip install -r requirements.txt
to install packages installed in the virtual environment
Run command pip install -r requirements.txt
- Run command
sudo -i -u postgres
- Run
psql
to start the database server
- Run
create database doctolib_data;
- Run
create user louis with encrypted password 'doctolib';
- Make sure the user name is the same as your linux user name
- If you don't you might get the following error: "psycopg.OperationalError: connection failed: FATAL: Peer authentication failed for user "robot" "
- Run
grant all privileges on database doctolib_data to robot;
- run command
file -bi raw_data/allocations-vs-rdv.csv
. In our case, allocations-vs-rdv has encodingcharset=unknown-8bit
which breaks our function reader to read the csv. - to solve all encoding issues, we force encoding to
windows-1252
.
- We use function
Sniffer()
to detect delimiter, in case it doesn't work we manually define the delimiter usingtry:
except
.