Skip to content

for Open Enventory, this script is used to find missing SDS for molecule in your existing Open Enventory database

License

Notifications You must be signed in to change notification settings

khoivan88/oe_find_sds-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python 3 Updates codecov python version

FIND MISSING SDS FOR CHEMICALS IN OPEN ENVENTORY


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:

CONTENTS


DETAILS

This programs does:

  1. Connect into mysql database and find molecule in 'molecule' table of specific database and find those molecule with missing sds
  2. Try to download sds files into a folder in /var/lib/mysql/missing_sds (For Linux environment with LAMP stack)
  3. Update those SQL entries with new downloaded sds files

REQUIREMENTS

  • 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:
    1. Change the download_path to a different location that you have read and write permission.
    2. Comment out exit(1) in find_sds.py file

USAGE

  1. 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
  2. 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'

  1. (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
  2. Install python dependencies:

    pip install -r requirements.txt
  3. 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)

VERSIONS

See here for the most up-to-date

About

for Open Enventory, this script is used to find missing SDS for molecule in your existing Open Enventory database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages