1 Web, python, and command-line interfaces for managing a chemical inventory.
5 The web interface (chem_web.py) is a web-daemon using web.py and it's build in htmlserver.
6 Standard command for starting the daemon
7 $ chem_web.py -a 192.168.1.2:55555
8 Standard command for stopping the daemon
11 From the command line, you can validate CAS#s (and possibly other fields) with
12 $ python chem_db.py -f current/inventory.db -V
17 text_db.py provides the python interface to this format. The basic
18 idea was to produce and use files which were M$-Excel-compatible,
19 since future users might not want to maintain this interface. A brief
20 example inventory.db file is included in the examples directory.
22 Tab-delimited ('\t') fields
23 Endline-delimited ('\n') records
24 The first line is the header (starts with a pound sign '#').
25 The header should be a tab-delimited list of short field names.
26 If the second line also begins with a pound sign,
27 it contains a tab-delimiteded list of long field names.
28 Blank lines are ignored.
30 The fields H, F, R, and S are the NFPA Health, Fire, Reactivity, and Special Hazards (NFPA diamond).
33 0 Hazard no greater than ordinary material
34 1 May cause irritation; minimal residual injury
35 2 Intense or prolonged exposure may cause incapacitation;
36 Residual injury may occur if not treated
37 3 Exposure could cause serious injury even if treated
38 4 Exposure may cause death
41 1 Must be preheated for ignition; flashpoint above 200°F (93°C)
42 2 Must be moderately heated for ignition, flashpoint above 100°F (38°C)
43 3 Ignition may occur under most ambient conditions,
44 Flashpoint below 100°F (38°C)
45 4 Extremely flammable and will readily disperse through air under standard
46 conditions, flashpoint below 73°F (23°C)
49 1 May become unstable at elevated temperatures and pressures.
50 May be mildly water reactive
51 2 Unstable; may undergo violent decomposition, but will not detonate.
52 May form explosive mixtures with water
53 3 Detonates with strong ignition source
55 Special Hazards have the following codes:
58 SA simple ascphyxiants
59 (The only gases for which this symbol is permitted are nitrogen, helium,
60 neon, argon, krypton, and xenon..)
61 Non-official Special Hazard codes:
73 text_db.py python interface to the above db format
74 chem_db.py chem-inventory specific functionality such as
76 * a Material Saftey Data Sheet (MSDS) manager,
77 * document-generation drivers, and
78 * a simple command line interface.
79 current store the current database file.
80 backup store previous (timestamped) database files.
81 You may want to clean this out occasionally.
82 MSDS store Material Saftey Data Sheets by database index number
83 docs latex (and metapost) sources for document generation.
84 chem_web.py daemonized web bindings to chem_web.py
85 ssl Secure Socket Layer (SSL) key and certificate generation tests.
88 GENERATED FILES AND DIRECTORIES
90 templates quasi-HTML templates for pages generated chem_web.py
91 chem_web.pid store the Process ID (PID) for a daemonized chem_web.py process
92 chem_web.log log chem_web activity (maintained between runs, so remove periodically)
98 I can create my own self-signed certificate.
99 Protects against eavesdropping, but not man-in-the-middle attacks.
100 Solution for now: hide from external world, trust everyone inside, backup before any change.
103 Print columns in a particular order from the database with
104 $ awk -F ' ' '{print $1, "\t", $9, "\t", , "\t", $2}' current/inventory.db | less