Web, python, and command-line interfaces for managing a chemical inventory. Commands ======== The web interface (:file:`bin/chem_web.py`) is a web-daemon using CherryPy. Standard command for starting the daemon:: $ bin/chem_web.py -a 192.168.1.2 -p 55555 Standard command for stopping the daemon:: $ bin/chem_web.py --stop From the command line, you can validate CAS#s (and possibly other fields) with:: $ bin/chem_db.py -f example/inventory.db -V Database format =============== :mod:`chemdb.db.text` provides the python interface to this format. The basic idea was to produce and use files which were M$-Excel-compatible, since future users might not want to maintain the ChemDB interface. A brief example :file:`inventory.db` file is included in the examples directory. * Tab-delimited ('\t') fields * Endline-delimited ('\n') records * The first line is the header (starts with a pound sign '#'). * The header should be a tab-delimited list of short field names. * If the second line also begins with a pound sign, it contains a tab-delimiteded list of long field names. * Blank lines are ignored. The fields H, F, R, and S are the NFPA Health, Fire, Reactivity, and Special Hazards (NFPA diamond). * Blue: Health Hazard 0 Hazard no greater than ordinary material 1 May cause irritation; minimal residual injury 2 Intense or prolonged exposure may cause incapacitation; Residual injury may occur if not treated 3 Exposure could cause serious injury even if treated 4 Exposure may cause death * Red: Fire Hazard 0 Will not burn 1 Must be preheated for ignition; flashpoint above 200°F (93°C) 2 Must be moderately heated for ignition, flashpoint above 100°F (38°C) 3 Ignition may occur under most ambient conditions, Flashpoint below 100°F (38°C) 4 Extremely flammable and will readily disperse through air under standard conditions, flashpoint below 73°F (23°C) * Reactivity hazards: 0 Stable 1 May become unstable at elevated temperatures and pressures. May be mildly water reactive 2 Unstable; may undergo violent decomposition, but will not detonate. May form explosive mixtures with water 3 Detonates with strong ignition source 4 Readily detonates * Special Hazards have the following codes: * OX strong oxidizer * -W- water reactive * SA simple ascphyxiants (The only gases for which this symbol is permitted are nitrogen, helium, neon, argon, krypton, and xenon..) * Unofficial Special Hazard codes: * ACID acid * ALK base * COR corrosive * BIO Biohazard * POI Poison * CRY Cyrogenic Contents ======== AUTHORS (list of authors contributing code to ChemDB) bin (executibles) |-- chem_db.py (command line interface) `-- chem_web.py (web interface) chemdb (python package) contrib (useful but non-critical utilities) `-- ssl (SSL key/certificate generation) COPYING (GNU GPLv3 license) DEPENDENCIES (description of software dependencies) example (example data for demonstrations and testing) |-- inventory.db (example inventory database) `-- static (example directory for statically served content) `-- MSDS (example MSDS storage location) `-- 0.html (dummy MSDS for acetic acid) README (this file) template |-- doc (LaTeX source for PDF generation) `-- web (Jinja2 templates for HTML generation) update_copyright.py (script automating copyright blurb maintenance) Generated files and directories ------------------------------- ============ ======================================================================= backup store database file snapshots from every change chem_web.pid store the Process ID (PID) for a daemonized chem_web.py process chem_web.log log chem_web activity (maintained between runs, so remove periodically) ============ ======================================================================= TODO ==== Security -------- I can create my own self-signed certificate. Protects against eavesdropping, but not man-in-the-middle attacks. Solution for now: hide from external world, trust everyone inside, backup before any change. History ======= The original web fron-end was based on Adam Bachman's simplewiki.py_. .. simplewiki.py: http://bachman.infogami.com/another_simple_wiki License ======= ChemDB is released under the GNU General Public License version 3. See :file:`COPYING` for details.