This program is designed specifically for Open Enventory to fix issue with molecule missing sds (could not be extracted through "Read data from supplier") This programs does:
This programs does:
- Connect into mysql database and find molecule in 'molecule' table of specific database and find those molecule with missing sds
- Try to download sds files into a folder in
/var/lib/mysql/missing_sds
(For Linux environment with LAMP stack) - Update those SQL entries with new downloaded sds files
- Python 3.6+
- Linux machine root access to the server hosting Open Enventory (to create a download folder if not existed). If user does not have root account (or sudo), you can:
- Change the
download_path
to a different location that you have read and write permission. - Comment out
exit(1)
infind_sds.py
file
- Change the
-
Clone this repository:
git clone https://github.com/khoivan88/oe_find_sds-public.git #if you have git # if you don't have git, you can download the zip file then unzip
-
Change into the directory of the program:
cd oe_find_sds-public
NOTE
- This file is made for Linux environment, you should be able to used it on other OS by changing the location of the "download_path"
- Make sure you use an absolute path
- For Windows:
Use of either forward slashes (
/
) or backward slashes (\
) should be ok!If you use XAMPP (or similar PHP, Apache, SQL package), you can try this path:
download_path = r'C:/xampp/mysql/data/missing_sds'
-
(Optional): create virtual environment for python to install dependency: Note: you can change
oe_find_sds_venv
to another name if desired.python -m venv oe_find_sds_venv # Create virtual environment source oe_find_sds_venv/bin/activate # Activate the virtual environment on Linux # oe_find_sds_venv\Scripts\activate # Activate the virtual environment on Windows
-
Install python dependencies:
pip install -r requirements.txt
-
Run the program:
python oe_find_sds/find_sds.py
- Answer questions for:
- confirming running under root
- mySQL root password (typing password will not be shown on screen)
- the name of the database you want to update (twice to confirm)
- Answer questions for:
See here for the most up-to-date