GHS Hazard Calculator¶
The GHS Hazard Calculator application provides a way to easily determine the hazards of a product, specified by the Globally Harmonized System of Classification and Labelling of Chemicals (GHS).
Configuration¶
Download the GHS django project.
cd to the root directory and run the following command to install ghs-hazard-calculator:
python setup.py install
Add hazard_calculator to INSTALLED_APPS.
The hazard_calculator app should now be installed.
Usage¶
A user can find the hazards of a flavor in a few steps:
- Import the GHS label document (contains cas numbers and hazards for raw materials).
- Find the CAS numbers and weights of all ingredients in the product’s formula.
- Input that data into calculate_flavor_hazards to get the product’s calculated hazards.
Main Functions¶
- hazard_calculator.tasks.import_GHS_ingredients_from_document(path_to_document)¶
This function is used to import GHS Ingredient hazard information from a document. This function will delete ALL existing GHS Ingredient information in the database and replace it with the hazard information from the given document.
- There are two options for doing this:
- Call this function from a shell.
- Use the management command ‘import_hazards’ from the project directory
In either case, pass the path to the hazard document as an argument.
- hazard_calculator.tasks.calculate_flavor_hazards(formula_list)¶
The main function of this app; generates hazards given the formula of a flavor.
In your main application, import hazard_calculator.models and hazard_calculator.tasks.
- Instantiate a list of FormulaLineItem objects with cas numbers and flavors corresponding
to the formula of a flavor/product.
Call this function with the FormulaLineItem list as an argument.
Your output will be a dictionary containing the hazards of the product.