Fire diamonds now generated with new, PGF-based nfpa_704 LaTeX package.
[chemdb.git] / README
1 Web, python, and command-line interfaces for managing a chemical inventory.
2
3 Commands
4 ========
5
6 The web interface (:file:`bin/chem_web.py`) is a web-daemon using
7 CherryPy.  Standard command for starting the daemon::
8
9     $ bin/chem_web.py -a 192.168.1.2 -p 55555
10
11 Standard command for stopping the daemon::
12
13     $ bin/chem_web.py --stop
14
15 From the command line, you can validate CAS#s (and possibly other fields) with::
16
17     $ bin/chem_db.py -f example/inventory.db -V
18
19
20 Database format
21 ===============
22
23 :mod:`chemdb.db.text` provides the python interface to this format.
24 The basic idea was to produce and use files which were
25 M$-Excel-compatible, since future users might not want to maintain the
26 ChemDB interface.  A brief example :file:`inventory.db` file is
27 included in the examples directory.
28
29 * Tab-delimited ('\t') fields
30 * Endline-delimited ('\n') records
31 * The first line is the header (starts with a pound sign '#').
32 * The header should be a tab-delimited list of short field names.
33 * If the second line also begins with a pound sign,
34   it contains a tab-delimiteded list of long field names.
35 * Blank lines are ignored.
36
37 The fields H, F, R, and S are the NFPA Health, Fire, Reactivity, and
38 Special Hazards (NFPA diamond).
39
40 * Blue: Health Hazard
41    0  Hazard no greater than ordinary material
42    1  May cause irritation; minimal residual injury
43    2  Intense or prolonged exposure may cause incapacitation;
44       Residual injury may occur if not treated
45    3  Exposure could cause serious injury even if treated
46    4  Exposure may cause death
47 * Red: Fire Hazard
48    0  Will not burn
49    1  Must be preheated for ignition; flashpoint above 200°F (93°C)
50    2  Must be moderately heated for ignition, flashpoint above 100°F (38°C)
51    3  Ignition may occur under most ambient conditions,
52       Flashpoint below 100°F (38°C)
53    4  Extremely flammable and will readily disperse through air under standard
54       conditions, flashpoint below 73°F (23°C)
55 * Reactivity hazards:
56    0  Stable
57    1  May become unstable at elevated temperatures and pressures.
58       May be mildly water reactive
59    2  Unstable; may undergo violent decomposition, but will not detonate.
60       May form explosive mixtures with water
61    3  Detonates with strong ignition source
62    4  Readily detonates
63 * Special Hazards have the following codes:
64    * OX   strong oxidizer
65    * -W-  water reactive
66    * SA   simple ascphyxiants
67           (The only gases for which this symbol is permitted are nitrogen, helium,
68            neon, argon, krypton, and xenon..)
69 * Unofficial Special Hazard codes:
70    * ACID  acid
71    * ALK   base
72    * COR   corrosive
73    * BIO   Biohazard
74    * POI   Poison
75    * CRY   Cyrogenic
76
77
78 Contents
79 ========
80
81     bin                   (executibles)
82     |-- chem_db.py        (command line interface)
83     `-- chem_web.py       (web interface)
84     chemdb                (python package)
85     contrib               (useful but non-critical utilities)
86     `-- ssl               (SSL key/certificate generation)
87     COPYING               (GNU GPLv3 license)
88     DEPENDENCIES          (description of software dependencies)
89     example               (example data for demonstrations and testing)
90     |-- inventory.db      (example inventory database)
91     `-- static            (example directory for statically served content)
92         `-- MSDS          (example MSDS storage location)
93             `-- 0.html    (dummy MSDS for acetic acid)
94     README                (this file)
95     template
96     |-- doc               (LaTeX source for PDF generation)
97     `-- web               (Jinja2 templates for HTML generation)
98     update_copyright.py   (script automating copyright blurb maintenance)
99
100
101 Generated files and directories
102 -------------------------------
103
104 ============  =======================================================================
105 backup        store database file snapshots from every change
106 chem_web.pid  store the Process ID (PID) for a daemonized chem_web.py process
107 chem_web.log  log chem_web activity (maintained between runs, so remove periodically)
108 ============  =======================================================================
109
110 TODO
111 ====
112
113 Security
114 --------
115 I can create my own self-signed certificate.
116 Protects against eavesdropping, but not man-in-the-middle attacks.
117 Solution for now: hide from external world, trust everyone inside, backup before any change.
118
119
120 History
121 =======
122
123 The original web fron-end was based on Adam Bachman's simplewiki.py_.
124
125 .. simplewiki.py: http://bachman.infogami.com/another_simple_wiki
126
127
128 License
129 =======
130
131 ChemDB is released under the GNU General Public License version 3.
132 See :file:`COPYING` for details.