Skip to content

Lperreau/doctolib-data-gouv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to run the project

Initial requirements

  1. Run command python3 -m venv venv
  2. Run command . venv/bin/activate to activate the virtual environment
  3. Run pip install --upgrade pip
  4. Run sudo apt install python3-dev libpq-dev
  5. Run command pip install -r requirements.txt to install packages installed in the virtual environment

Install all requirements

Run command pip install -r requirements.txt

Log in to the PostgreSQL database server using psql

  1. Run command sudo -i -u postgres
  2. Run psql to start the database server

Create a new database, a user and grant accesses

  1. Run create database doctolib_data;
  2. Run create user louis with encrypted password 'doctolib';
  3. Make sure the user name is the same as your linux user name
  4. If you don't you might get the following error: "psycopg.OperationalError: connection failed: FATAL: Peer authentication failed for user "robot" "
  5. Run grant all privileges on database doctolib_data to robot;

CSVs files encoding

  1. run command file -bi raw_data/allocations-vs-rdv.csv . In our case, allocations-vs-rdv has encoding charset=unknown-8bit which breaks our function reader to read the csv.
  2. to solve all encoding issues, we force encoding to windows-1252.

CSVs files delimiter

  1. We use function Sniffer() to detect delimiter, in case it doesn't work we manually define the delimiter using try: except.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages