molbuilder 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. molbuilder-1.0.0/LICENSE +21 -0
  2. molbuilder-1.0.0/PKG-INFO +360 -0
  3. molbuilder-1.0.0/README.md +327 -0
  4. molbuilder-1.0.0/molbuilder/__init__.py +8 -0
  5. molbuilder-1.0.0/molbuilder/__main__.py +6 -0
  6. molbuilder-1.0.0/molbuilder/atomic/__init__.py +4 -0
  7. molbuilder-1.0.0/molbuilder/atomic/bohr.py +235 -0
  8. molbuilder-1.0.0/molbuilder/atomic/quantum_atom.py +334 -0
  9. molbuilder-1.0.0/molbuilder/atomic/quantum_numbers.py +196 -0
  10. molbuilder-1.0.0/molbuilder/atomic/wavefunctions.py +297 -0
  11. molbuilder-1.0.0/molbuilder/bonding/__init__.py +4 -0
  12. molbuilder-1.0.0/molbuilder/bonding/covalent.py +442 -0
  13. molbuilder-1.0.0/molbuilder/bonding/lewis.py +347 -0
  14. molbuilder-1.0.0/molbuilder/bonding/vsepr.py +433 -0
  15. molbuilder-1.0.0/molbuilder/cli/__init__.py +1 -0
  16. molbuilder-1.0.0/molbuilder/cli/demos.py +516 -0
  17. molbuilder-1.0.0/molbuilder/cli/menu.py +127 -0
  18. molbuilder-1.0.0/molbuilder/cli/wizard.py +831 -0
  19. molbuilder-1.0.0/molbuilder/core/__init__.py +6 -0
  20. molbuilder-1.0.0/molbuilder/core/bond_data.py +170 -0
  21. molbuilder-1.0.0/molbuilder/core/constants.py +51 -0
  22. molbuilder-1.0.0/molbuilder/core/element_properties.py +183 -0
  23. molbuilder-1.0.0/molbuilder/core/elements.py +181 -0
  24. molbuilder-1.0.0/molbuilder/core/geometry.py +232 -0
  25. molbuilder-1.0.0/molbuilder/gui/__init__.py +2 -0
  26. molbuilder-1.0.0/molbuilder/gui/app.py +286 -0
  27. molbuilder-1.0.0/molbuilder/gui/canvas3d.py +115 -0
  28. molbuilder-1.0.0/molbuilder/gui/dialogs.py +117 -0
  29. molbuilder-1.0.0/molbuilder/gui/event_handler.py +118 -0
  30. molbuilder-1.0.0/molbuilder/gui/sidebar.py +105 -0
  31. molbuilder-1.0.0/molbuilder/gui/toolbar.py +71 -0
  32. molbuilder-1.0.0/molbuilder/io/__init__.py +1 -0
  33. molbuilder-1.0.0/molbuilder/io/json_io.py +146 -0
  34. molbuilder-1.0.0/molbuilder/io/mol_sdf.py +169 -0
  35. molbuilder-1.0.0/molbuilder/io/pdb.py +184 -0
  36. molbuilder-1.0.0/molbuilder/io/smiles_io.py +47 -0
  37. molbuilder-1.0.0/molbuilder/io/xyz.py +103 -0
  38. molbuilder-1.0.0/molbuilder/molecule/__init__.py +2 -0
  39. molbuilder-1.0.0/molbuilder/molecule/amino_acids.py +919 -0
  40. molbuilder-1.0.0/molbuilder/molecule/builders.py +257 -0
  41. molbuilder-1.0.0/molbuilder/molecule/conformations.py +70 -0
  42. molbuilder-1.0.0/molbuilder/molecule/functional_groups.py +484 -0
  43. molbuilder-1.0.0/molbuilder/molecule/graph.py +712 -0
  44. molbuilder-1.0.0/molbuilder/molecule/peptides.py +13 -0
  45. molbuilder-1.0.0/molbuilder/molecule/stereochemistry.py +6 -0
  46. molbuilder-1.0.0/molbuilder/process/__init__.py +3 -0
  47. molbuilder-1.0.0/molbuilder/process/conditions.py +260 -0
  48. molbuilder-1.0.0/molbuilder/process/costing.py +316 -0
  49. molbuilder-1.0.0/molbuilder/process/purification.py +285 -0
  50. molbuilder-1.0.0/molbuilder/process/reactor.py +297 -0
  51. molbuilder-1.0.0/molbuilder/process/safety.py +476 -0
  52. molbuilder-1.0.0/molbuilder/process/scale_up.py +427 -0
  53. molbuilder-1.0.0/molbuilder/process/solvent_systems.py +204 -0
  54. molbuilder-1.0.0/molbuilder/reactions/__init__.py +3 -0
  55. molbuilder-1.0.0/molbuilder/reactions/functional_group_detect.py +728 -0
  56. molbuilder-1.0.0/molbuilder/reactions/knowledge_base.py +1716 -0
  57. molbuilder-1.0.0/molbuilder/reactions/reaction_types.py +102 -0
  58. molbuilder-1.0.0/molbuilder/reactions/reagent_data.py +1248 -0
  59. molbuilder-1.0.0/molbuilder/reactions/retrosynthesis.py +1430 -0
  60. molbuilder-1.0.0/molbuilder/reactions/synthesis_route.py +377 -0
  61. molbuilder-1.0.0/molbuilder/reports/__init__.py +158 -0
  62. molbuilder-1.0.0/molbuilder/reports/cost_report.py +206 -0
  63. molbuilder-1.0.0/molbuilder/reports/molecule_report.py +279 -0
  64. molbuilder-1.0.0/molbuilder/reports/safety_report.py +296 -0
  65. molbuilder-1.0.0/molbuilder/reports/synthesis_report.py +283 -0
  66. molbuilder-1.0.0/molbuilder/reports/text_formatter.py +170 -0
  67. molbuilder-1.0.0/molbuilder/smiles/__init__.py +4 -0
  68. molbuilder-1.0.0/molbuilder/smiles/parser.py +487 -0
  69. molbuilder-1.0.0/molbuilder/smiles/tokenizer.py +291 -0
  70. molbuilder-1.0.0/molbuilder/smiles/writer.py +375 -0
  71. molbuilder-1.0.0/molbuilder/visualization/__init__.py +1 -0
  72. molbuilder-1.0.0/molbuilder/visualization/bohr_viz.py +166 -0
  73. molbuilder-1.0.0/molbuilder/visualization/molecule_viz.py +368 -0
  74. molbuilder-1.0.0/molbuilder/visualization/quantum_viz.py +434 -0
  75. molbuilder-1.0.0/molbuilder/visualization/theme.py +12 -0
  76. molbuilder-1.0.0/molbuilder.egg-info/PKG-INFO +360 -0
  77. molbuilder-1.0.0/molbuilder.egg-info/SOURCES.txt +90 -0
  78. molbuilder-1.0.0/molbuilder.egg-info/dependency_links.txt +1 -0
  79. molbuilder-1.0.0/molbuilder.egg-info/entry_points.txt +2 -0
  80. molbuilder-1.0.0/molbuilder.egg-info/requires.txt +8 -0
  81. molbuilder-1.0.0/molbuilder.egg-info/top_level.txt +1 -0
  82. molbuilder-1.0.0/pyproject.toml +62 -0
  83. molbuilder-1.0.0/setup.cfg +4 -0
  84. molbuilder-1.0.0/tests/test_atomic.py +760 -0
  85. molbuilder-1.0.0/tests/test_bonding.py +424 -0
  86. molbuilder-1.0.0/tests/test_core.py +602 -0
  87. molbuilder-1.0.0/tests/test_edge_cases.py +730 -0
  88. molbuilder-1.0.0/tests/test_io.py +146 -0
  89. molbuilder-1.0.0/tests/test_molecule.py +463 -0
  90. molbuilder-1.0.0/tests/test_process.py +474 -0
  91. molbuilder-1.0.0/tests/test_reactions.py +237 -0
  92. molbuilder-1.0.0/tests/test_smiles.py +251 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Taylor C. Powell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,360 @@
1
+ Metadata-Version: 2.4
2
+ Name: molbuilder
3
+ Version: 1.0.0
4
+ Summary: Professional-grade molecular engineering toolkit: atoms to retrosynthesis to process engineering
5
+ Author: Taylor C. Powell
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/molbuilder/molbuilder
8
+ Project-URL: Documentation, https://molbuilder.io/docs
9
+ Project-URL: Repository, https://github.com/molbuilder/molbuilder
10
+ Project-URL: Issues, https://github.com/molbuilder/molbuilder/issues
11
+ Keywords: chemistry,molecular-modeling,retrosynthesis,cheminformatics,SMILES,VSEPR,process-engineering,drug-discovery
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: Education
15
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
16
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: numpy>=1.24
26
+ Requires-Dist: scipy>=1.10
27
+ Requires-Dist: matplotlib>=3.7
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0; extra == "dev"
30
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
31
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # MolBuilder
35
+
36
+ A professional-grade molecular engineering toolkit built from scratch in pure Python. MolBuilder spans the full pipeline from atomic theory and molecular modeling through retrosynthetic analysis, process engineering, and industrial scale-up -- without depending on RDKit, OpenBabel, or any external chemistry library.
37
+
38
+ ## What It Does
39
+
40
+ MolBuilder is a self-contained chemistry platform that covers seven layers of molecular science:
41
+
42
+ | Layer | Capabilities |
43
+ |-------|-------------|
44
+ | **Atomic Physics** | Bohr model, quantum numbers, electron configurations (with Aufbau exceptions), Slater's rules for effective nuclear charge, hydrogen-like wavefunctions, orbital probability densities |
45
+ | **Chemical Bonding** | Lewis structures with octet/expanded octet support, VSEPR geometry prediction (12+ molecular shapes), covalent bond analysis (polarity, dipole moments, BDE, sigma/pi orbitals) |
46
+ | **Molecular Modeling** | Full molecular graph with 3D coordinate generation, conformational analysis (eclipsed/staggered/gauche/anti), torsional energy profiles, Newman projections, cyclohexane chair/boat conformations, R/S and E/Z stereochemistry via CIP priority rules |
47
+ | **Biochemistry** | All 20 standard amino acids with L-chirality, peptide bond formation, phi/psi backbone angles, secondary structure templates (alpha helix, beta sheet) |
48
+ | **Cheminformatics** | SMILES parser and writer with chirality (`@`/`@@`), E/Z bond stereochemistry (`/`/`\`), bracket atoms (isotopes, charges, H counts), aromatic perception, Morgan canonical ordering |
49
+ | **Retrosynthesis** | Beam-search retrosynthetic engine with 91 curated reaction templates, 200+ purchasable starting materials database, scored disconnections, and forward route extraction |
50
+ | **Process Engineering** | Reactor selection (batch/CSTR/PFR/microreactor), condition optimization, purification strategy, GHS safety assessment (69 hazard codes, chemical incompatibility detection), cost estimation, and batch-vs-continuous scale-up analysis |
51
+
52
+ ## Installation
53
+
54
+ **Requirements:** Python >= 3.11, numpy, scipy, matplotlib
55
+
56
+ ```bash
57
+ # From the project directory
58
+ pip install -e .
59
+
60
+ # Or install dependencies manually
61
+ pip install numpy scipy matplotlib
62
+ ```
63
+
64
+ The GUI uses `tkinter`, which is included with most Python distributions. On some Linux systems you may need to install it separately (`sudo apt install python3-tk`).
65
+
66
+ ## Quick Start
67
+
68
+ ### Interactive CLI
69
+
70
+ ```bash
71
+ python -m molbuilder
72
+ ```
73
+
74
+ This launches an interactive menu with 11 options:
75
+
76
+ ```
77
+ [ 1] Bohr Atomic Model
78
+ [ 2] Quantum Mechanical Atom
79
+ [ 3] Element Data
80
+ [ 4] Lewis Structures
81
+ [ 5] VSEPR Molecular Geometry
82
+ [ 6] Covalent Bonds
83
+ [ 7] Molecular Conformations
84
+ [ 8] Amino Acids & Functional Groups
85
+ [ 9] 3D Molecule Visualization
86
+ [ 10] Quantum Orbital Visualization
87
+ [ 11] Molecule Builder Wizard
88
+ [ a] Run all text demos (1-8)
89
+ [ q] Quit
90
+ ```
91
+
92
+ Options 1-8 run educational demos covering atomic models through peptide chemistry. Option 9 renders interactive 3D ball-and-stick models. Option 10 visualizes quantum orbitals. Option 11 launches the interactive molecule builder wizard.
93
+
94
+ You can also run a specific demo directly: `python -m molbuilder 5` runs the VSEPR demo.
95
+
96
+ ### Molecule Builder Wizard
97
+
98
+ The wizard (option 11) provides five ways to build molecules:
99
+
100
+ 1. **SMILES input** -- Parse any SMILES string into a 3D molecule
101
+ 2. **Molecular formula** -- Enter formulas like `H2O`, `SF6` for VSEPR-based geometry
102
+ 3. **Atom-by-atom** -- Interactive loop to place and bond atoms manually
103
+ 4. **Preset molecules** -- 10 built-in molecules (ethane, benzene, aspirin, caffeine, etc.)
104
+ 5. **Peptide builder** -- Build peptides from amino acid sequences with secondary structure
105
+
106
+ After building, an analysis menu offers functional group detection, bond analysis, SMILES generation, file export, retrosynthesis, process engineering, and 3D visualization.
107
+
108
+ ### SMILES-to-Synthesis Pipeline
109
+
110
+ ```bash
111
+ python synthesize.py
112
+ ```
113
+
114
+ This standalone script takes a SMILES string and production scale, then runs the complete pipeline:
115
+
116
+ 1. Parses SMILES into a 3D molecule
117
+ 2. Detects functional groups
118
+ 3. Checks purchasability against a database of ~200 common chemicals
119
+ 4. Runs retrosynthetic analysis (beam search, max depth 5)
120
+ 5. Extracts the best forward synthesis route
121
+ 6. For each step: selects a reactor, optimizes conditions, plans purification
122
+ 7. Assesses safety (GHS hazards, PPE, incompatibilities, emergency procedures)
123
+ 8. Estimates costs (materials, labor, equipment, energy, waste, overhead)
124
+ 9. Analyzes scale-up (batch sizing, cycle time, annual capacity, capital costs)
125
+ 10. Generates full ASCII reports
126
+
127
+ ### 3D GUI
128
+
129
+ ```bash
130
+ python -c "from molbuilder.gui.app import launch; launch()"
131
+ ```
132
+
133
+ A tkinter-based graphical editor with:
134
+
135
+ - **Element palette** -- Click to select H, C, N, O, F, P, S, Cl, Br, I, or enter a custom element
136
+ - **Bond tools** -- Single, double, and triple bond modes
137
+ - **3D viewport** -- Embedded matplotlib canvas with CPK-colored atoms, rotatable view
138
+ - **Sidebar** -- Molecule info, analysis buttons (functional groups, stereochemistry, retrosynthesis, process engineering), file export (XYZ, MOL/SDF, PDB, JSON, SMILES)
139
+ - **File menu** -- Open and save molecules in any supported format
140
+ - **Build menu** -- Load from SMILES, formula, or preset molecules
141
+
142
+ ## Python API
143
+
144
+ ### Parse and Write SMILES
145
+
146
+ ```python
147
+ from molbuilder.smiles import parse, to_smiles
148
+
149
+ mol = parse("CC(=O)Oc1ccccc1C(=O)O") # aspirin
150
+ print(f"{len(mol.atoms)} atoms, {len(mol.bonds)} bonds")
151
+
152
+ canonical = to_smiles(mol) # canonical SMILES output
153
+ ```
154
+
155
+ ### Detect Functional Groups
156
+
157
+ ```python
158
+ from molbuilder.smiles import parse
159
+ from molbuilder.reactions.functional_group_detect import detect_functional_groups
160
+
161
+ mol = parse("CC(=O)O") # acetic acid
162
+ for fg in detect_functional_groups(mol):
163
+ print(f" {fg.name} at atoms {fg.atoms}")
164
+ # Output: carboxylic_acid at atoms [1, 2, 3]
165
+ ```
166
+
167
+ 21 functional group detectors: alcohol, aldehyde, ketone, carboxylic acid, ester, amide, amine (primary/secondary/tertiary), alkyl halide, alkene, alkyne, ether, thiol, nitrile, nitro, aromatic ring, epoxide, acid chloride, anhydride, sulfoxide, sulfone, imine.
168
+
169
+ ### Retrosynthetic Analysis
170
+
171
+ ```python
172
+ from molbuilder.smiles import parse
173
+ from molbuilder.reactions.retrosynthesis import retrosynthesis, format_tree
174
+ from molbuilder.reactions.synthesis_route import extract_best_route, format_route
175
+
176
+ mol = parse("CC(=O)OCC") # ethyl acetate
177
+ tree = retrosynthesis(mol, max_depth=5, beam_width=5)
178
+ print(format_tree(tree))
179
+
180
+ route = extract_best_route(tree)
181
+ print(format_route(route))
182
+ ```
183
+
184
+ The engine uses beam search to work backwards from the target, matching functional groups against 91 reaction templates. Each disconnection is scored (0-100) based on yield, precursor availability, complexity reduction, and strategic bond preference.
185
+
186
+ ### Process Engineering
187
+
188
+ ```python
189
+ from molbuilder.process.reactor import select_reactor
190
+ from molbuilder.process.conditions import optimize_conditions
191
+ from molbuilder.process.safety import assess_safety
192
+ from molbuilder.process.costing import estimate_cost
193
+ from molbuilder.process.scale_up import analyze_scale_up
194
+
195
+ # After obtaining a synthesis route:
196
+ for step in route.steps:
197
+ reactor = select_reactor(step.template, scale_kg=100.0)
198
+ conditions = optimize_conditions(step.template, scale_kg=100.0)
199
+
200
+ safety = assess_safety(route.steps)
201
+ cost = estimate_cost(route.steps, scale_kg=100.0)
202
+ scaleup = analyze_scale_up(route.steps, target_annual_kg=10000.0)
203
+ ```
204
+
205
+ ### VSEPR Geometry
206
+
207
+ ```python
208
+ from molbuilder.bonding.vsepr import VSEPRMolecule
209
+
210
+ water = VSEPRMolecule("H2O")
211
+ print(water.summary())
212
+ # Shows: AXE class, electron geometry, molecular geometry, bond angles, 3D coords
213
+ ```
214
+
215
+ ### Lewis Structures
216
+
217
+ ```python
218
+ from molbuilder.bonding.lewis import LewisStructure
219
+
220
+ lewis = LewisStructure("CO2")
221
+ print(lewis.summary())
222
+ # Shows: valence electrons, bonds, lone pairs, formal charges
223
+ ```
224
+
225
+ ### Quantum Atom
226
+
227
+ ```python
228
+ from molbuilder.atomic.quantum_atom import QuantumAtom
229
+
230
+ fe = QuantumAtom(26) # iron
231
+ print(fe.electron_configuration_string()) # 1s2 2s2 2p6 3s2 3p6 3d6 4s2
232
+ print(fe.noble_gas_notation()) # [Ar] 3d6 4s2
233
+ print(fe.effective_nuclear_charge(4, 0)) # Z_eff for 4s: ~3.75
234
+ ```
235
+
236
+ ### Build Peptides
237
+
238
+ ```python
239
+ from molbuilder.molecule.amino_acids import build_peptide, AminoAcidType
240
+
241
+ tripeptide = build_peptide(
242
+ [AminoAcidType.ALA, AminoAcidType.GLY, AminoAcidType.PHE],
243
+ phi=-57, psi=-47 # alpha helix
244
+ )
245
+ print(f"{len(tripeptide.atoms)} atoms")
246
+ ```
247
+
248
+ ### File I/O
249
+
250
+ ```python
251
+ from molbuilder.smiles import parse
252
+ from molbuilder.io.xyz import write_xyz, read_xyz
253
+ from molbuilder.io.mol_sdf import write_mol, read_mol
254
+ from molbuilder.io.pdb import write_pdb, read_pdb
255
+ from molbuilder.io.json_io import write_json, read_json
256
+
257
+ mol = parse("CCO")
258
+
259
+ write_xyz(mol, "ethanol.xyz")
260
+ write_mol(mol, "ethanol.mol")
261
+ write_pdb(mol, "ethanol.pdb")
262
+ write_json(mol, "ethanol.json")
263
+
264
+ mol2 = read_xyz("ethanol.xyz")
265
+ mol3 = read_mol("ethanol.mol")
266
+ ```
267
+
268
+ Supported formats: XYZ, MOL/SDF (V2000), PDB, JSON, SMILES.
269
+
270
+ ### Report Generation
271
+
272
+ ```python
273
+ from molbuilder.reports import (
274
+ generate_molecule_report,
275
+ generate_synthesis_report,
276
+ generate_safety_report,
277
+ generate_cost_report,
278
+ )
279
+
280
+ print(generate_molecule_report(mol))
281
+ print(generate_synthesis_report(route))
282
+ print(generate_safety_report(safety_assessments))
283
+ print(generate_cost_report(cost_estimate))
284
+ ```
285
+
286
+ Reports are formatted as clean ASCII tables suitable for terminal display or text file output.
287
+
288
+ ## Reaction Knowledge Base
289
+
290
+ 91 curated reaction templates across 14 categories:
291
+
292
+ | Category | Examples | Count |
293
+ |----------|---------|-------|
294
+ | Substitution | SN2 (hydroxide, cyanide, azide), SN1, Williamson ether, Mitsunobu | ~10 |
295
+ | Elimination | E2, E1 dehydration, Hofmann, Cope | ~6 |
296
+ | Addition | HBr, hydroboration-oxidation, epoxidation, dihydroxylation, ozonolysis | ~10 |
297
+ | Oxidation | PCC, Jones, Swern, Dess-Martin, KMnO4, Baeyer-Villiger, Sharpless | ~8 |
298
+ | Reduction | NaBH4, LiAlH4, DIBAL-H, Birch, Wolff-Kishner, asymmetric hydrogenation | ~10 |
299
+ | Coupling | Grignard, Suzuki, Heck, Sonogashira, Wittig, aldol, C-H activation | ~12 |
300
+ | Carbonyl | Fischer esterification, Diels-Alder, Claisen, Michael, Robinson annulation | ~10 |
301
+ | Protection | Boc, Fmoc, TBS, benzyl, acetonide (install and remove) | ~12 |
302
+ | Rearrangement | Cope, pinacol, Curtius, Beckmann | ~4 |
303
+ | Polymerization | ROMP | ~2 |
304
+ | Miscellaneous | Appel, Staudinger, olefin metathesis | ~5 |
305
+
306
+ Each template includes reagents, solvents, catalysts, temperature range, yield range, mechanism description, safety notes, and retrosynthetic transform logic.
307
+
308
+ ## Data Coverage
309
+
310
+ | Data Set | Entries | Source |
311
+ |----------|---------|--------|
312
+ | Elements | 118 | IUPAC 2021 |
313
+ | Covalent radii | 118 | Cordero et al. 2008, Pyykko & Atsumi 2009 |
314
+ | Electronegativity | 103 (Pauling) | CRC Handbook |
315
+ | Bond dissociation energies | 49 | CRC Handbook, Luo 2007 |
316
+ | Torsion barriers | 16 types | OPLS-AA (Jorgensen et al. 1996) |
317
+ | Standard bond lengths | 44 | Experimental averages |
318
+ | CPK colors | 56 | Corey-Pauling-Koltun convention |
319
+ | GHS hazard statements | 69 | GHS Revision 10 (2023) |
320
+ | Purchasable materials | ~200 | Common laboratory chemicals with pricing |
321
+ | Reagent database | ~100 reagents, ~30 solvents | CAS numbers, MW, hazards, costs |
322
+ | Aufbau exceptions | 22 | Known d-block and f-block anomalies |
323
+ | Amino acids | 20 | Standard L-amino acids with full sidechain geometry |
324
+
325
+ ## Architecture
326
+
327
+ ```
328
+ molbuilder/
329
+ core/ Constants, elements, geometry, bond data
330
+ atomic/ Bohr model, quantum numbers, wavefunctions
331
+ bonding/ Lewis structures, VSEPR, covalent bond analysis
332
+ molecule/ Molecular graph, conformations, stereochemistry,
333
+ builders, functional groups, amino acids, peptides
334
+ smiles/ SMILES tokenizer, parser, writer
335
+ io/ File I/O (XYZ, MOL/SDF, PDB, JSON, SMILES)
336
+ reactions/ Reaction templates, reagent database, FG detection,
337
+ retrosynthesis engine, synthesis route planning
338
+ process/ Reactor selection, conditions, purification, safety,
339
+ costing, scale-up analysis
340
+ reports/ ASCII report generators (molecule, synthesis, safety, cost)
341
+ visualization/ 3D molecule rendering, quantum orbital plots
342
+ gui/ Tkinter-based 3D molecule editor
343
+ cli/ Interactive menu, demos, molecule builder wizard
344
+ ```
345
+
346
+ ~19,900 lines of source code across 81 Python files in 12 subpackages. No external chemistry dependencies -- only numpy, scipy, and matplotlib.
347
+
348
+ ## Testing
349
+
350
+ ```bash
351
+ python -m pytest tests/ -q
352
+ ```
353
+
354
+ 517 tests covering core chemistry data, atomic models, bonding theory, molecular operations, SMILES round-trips, file I/O, reaction knowledge base, process engineering, and edge cases with scientific validation against known experimental values.
355
+
356
+ ## License
357
+
358
+ MIT License. See [LICENSE](LICENSE) for details.
359
+
360
+ Copyright (c) 2025 Taylor C. Powell.