Repository navigation
Releases
BKChem-portable for Windows, Linux and macOS
Fork release 14 — 2026-11-22
Added
-
OpenBabel / InChI can be bundled: the
BKChem-portable-w-ob-inchi.ziparchive includesOpenBabel 3.1.1andinchi-1.exe, so Read SMILES / Read InChI and Generate InChI work without installing anything. -
OpenBabel and the InChI program can now be bundled with the portable build: when an
openbabelfolder (a copy of the installed OpenBabel 3.1.1 program folder, about 14.5 MB including itsdatafolder) and aninchifolder containinginchi-1.exesit besideBKChem.exe(or besidestart_bkchem.pyin a source copy), Read SMILES / Read InChI use the bundled OpenBabel and Generate InChI uses the bundled inchi-1, with no path settings needed. The resolution order is the configured program path (when the file exists), then the bundled copy, then the built-in oasa path; the Generate InChI menu is also enabled when a bundled inchi-1 exists. Verified on Windows, including a PyInstaller build with both folders beside the executable. (bkchem/oasa_bridge.py,bkchem/main.py)
Fixed
- Generate SMILES now works for salts: a salt read through OpenBabel arrives as one molecule with disconnected components, and the SMILES writer failed on it with "Cannot encode disconnected compounds"; the components are now written separately and joined with ".". The stereochemistry of a chiral component is preserved (verified with sodium (S)-lactate), and the result was verified on Windows with Brilliant Blue FCF. (
bkchem/oasa_bridge.py) - Imported atoms no longer look overvalent when their listed valency is too small for their bonds: a sulfonate sulfur arrived with valency 2 against a bond-order sum of 6, so it was drawn with a spurious hydrogen ("SH") and structure generation opened with a valency warning; the import now steps such an atom up to the smallest listed valency that fits its actual bonds (sulfonate S to 6, phosphate P to 5), using the same charge correction as the existing step-up for unlisted valencies. Verified on Windows with Brilliant Blue FCF, whose sulfurs now draw as plain "S". (
bkchem/oasa_bridge.py) - A neutral nitrogen can no longer take a fourth bond through the valency guards: the shared check accepted a bond-order sum of 4 for nitrogen via its listed valency 5, which is only physical together with a +1 charge (nitro, pyridinium, ammonium, amine oxides); listed valencies above 3 are now skipped for nitrogen in the shared guard, closing the hole in template placement, bond drawing, bond-order raising, drag unification and group substitution at once. To add a fourth bond to an amine or pyridine nitrogen, set the + charge first, then the bond is allowed. Verified on Windows. (
bkchem/atom.py)
Added / Changed
- Template placement now steps the atom's valency up, like the drawing tools do: placing a template on thiophene S, selenophene Se, chlorobenzene Cl, bromobenzene Br or triphenylphosphine / triphenylarsine P / As attached with only the legacy "maximum valency exceeded" warning and a negative free valency, because the placement path never raised the atom's valency the way the drawing paths do; the focused atom (or both ends of the focused bond) is now stepped up after placement (S / Se 2 to 4, Cl / Br 1 to 3, P / As 3 to 5) and attaches with no warning, while pyridine N and furan O are still refused with an error. Verified on Windows. (
bkchem/modes.py)
BKChem-portable for Windows, Linux and macOS
Fork release 13 — 2026-11-17
Fixed
- Valency violations are now refused with an error instead of being silently accepted: four operations could push an atom past its maximum valency with no error (at most an after-the-fact warning, and in one case a half-finished fusion). Unifying atoms by dragging is now judged per connected cluster of overlapping atoms, so a fusion either fully fits or is fully refused and never happens half-way; raising a bond order, drawing a new bond, and placing or fusing a template are checked before anything changes and refuse with an error, leaving the drawing unchanged. Charged atoms are counted by their actual bond-order sum, so legitimate structures still work: an oxonium O+ keeps three bonds (anthocyanin / flavylium), and NH4+ takes exactly three added bonds. Verified on Windows. (
bkchem/atom.py,bkchem/bond.py,bkchem/modes.py,bkchem/molecule.py,bkchem/paper.py) - Oxonium structures read from SMILES no longer arrive with a negative free valency: for the [OH+] spelling of e.g. flavylium, oasa raises the oxygen's valency to a value BKChem cannot use, leaving free valency -1; the imported atom now takes the smallest listed valency that fits its actual bonds. (
bkchem/oasa_bridge.py) - Aromatic SMILES with a pyrylium oxygen now draws correctly on the built-in (oasa) reading path: cyanidin's [o+] oxygen was depicted as "OH+" with two single bonds, because the aromatic-bond localization scored the charged oxygen as unable to take a double bond and fell back to a fake localization; the oxygen now gets its three bonds, matching the OpenBabel path. (
bkchem/oasa/oasa/atom.py) - The experimental http_server modules now import under Python 3:
bkchem/http_server.pyandbkchem/http_server2.pystill contained Python 2 code and could not be imported at all. They are not used by the application; the fix only makes the files loadable again, in line with this fork's keep-and-fix policy for unused code.
BKChem-portable for Windows, Linux and macOS
Fork release 12 — 2026-11-15
Added / Changed
- The README now covers the Linux and macOS portable builds: the "Portable Version" section now lists the archives for all three operating systems (
BKChem-portable.zip,BKChem-portable-linux.tar.gz,BKChem-portable-macos.tar.gz) with their notes, instead of describing the portable build as Windows-only. (README.md,README_JP.md)
Fixed
- Two more leftover Python 2
file()calls fixed: inbkchem/oasa/oasa/name_database.py(line 57, inside the gdbm database builder; the module is not used by the application and gdbm is unavailable on Windows, so this changes nothing in practice) andbkchem/oasa/oasa/inchi_key.py(line 1352, inside a disabledif False:test block; real InChIKey generation is unaffected). No behaviour changes.
BKChem-portable for Windows, Linux and macOS
Fork release 11 — 2026-11-13
Added / Changed
- The NIST WebBook plugins work again: "Fetch from Webbook" (draw a structure from a name) and "Get Name (NIST Webbook)" (name and CAS for a selected molecule) were broken by a combination of the Python 2
urllibimport, bytes/str handling of the download, BKChem API drift (read_molfile()now returns a list,mol_to_inchi()now returns three values) and a change in NIST's page headings. Verified on Windows: Fetch drew cyclopropane with CAS 75-19-4, and Get Name returned Benzene with CAS 71-43-2. (plugins/fetch_from_webbook.py,plugins/fetch_name_from_webbook.py) - Portable builds for Linux and macOS are now provided alongside the Windows one: the release now attaches
BKChem-portable-linux.tar.gz(built on Ubuntu 22.04) andBKChem-portable-macos.tar.gz(Apple Silicon, unsigned) in addition toBKChem-portable.zip; both passed the automated build and startup checks but have not been verified on real machines yet. (.github/workflows/build-portable.yml)
Fixed
- The "show hydrogens in structural formula" preference now applies to new atoms: the preference value read from the settings was overwritten with 0 whenever an atom was created, so new atoms were always born with hydrogens hidden even with the box checked; only typing "OH", turning Hydrogens on per atom, or loading a file showed them. New atoms now keep the preference value, and substitution keeps the original atom's setting. Verified on Windows: replacing a chain-end C with O now gives OH immediately. (
bkchem/atom.py,bkchem/molecule.py) - Five leftover Python 2
file()calls fixed: inbkchem/molecule.py(584),bkchem/oasa/oasa/molecule.py(603),bkchem/oasa/oasa/graph/graph.py(1162),bkchem/oasa/oasa/cdml.py(141) andbkchem/oasa/oasa/molfile.py(404; the last two also convert amapobject to a list). All five sit in demo or unused helper code, so no menu, drawing, import or export behaviour changes; the V3000 reader inmolfile.pyis unchanged.
BKChem-portable for Windows
Fork release 10 — 2026-11-12
Added / Changed
- "Copy selection as SVG to clipboard" now pastes as a picture on Linux and macOS too: On Linux, when
xclip(X11) orwl-copy(Wayland, from the wl-clipboard package) is installed, the SVG is handed to that helper and offered asimage/svg+xml, so SVG-aware applications paste a picture instead of the SVG source text; the helper stays resident, so the content also survives BKChem exiting. On macOS, whenpyobjc-framework-Cocoais installed, the SVG is placed on the system pasteboard as bothpublic.svg-imageandpublic.utf8-plain-text, like the Windows path. Without these helpers the previous behaviour (Tk clipboard, text only) is unchanged. The X11 path is verified; the Wayland and macOS paths follow the documented interfaces of the same helpers but have not been verified on real machines yet. (bkchem/paper.py) - Modules that the application does not use are now marked as such:
http_server.py,http_server2.py,svg_out.py,structure_database.pyandname_database.pycarry a note at the top stating that the BKChem application itself does not use them, so readers no longer have to guess whether a feature exists. No behaviour change.
Fixed
- The oasa command-line converter works again:
bkchem/oasa/convert.pyused the Python 2 builtinsfile()andraw_input()under bareexceptclauses, so every conversion failed with the misleading message "cannot open file ... for reading" (and exit code 0) even when the file existed. Verified: SMILES to MOL, SMILES round-trip and MOL to SMILES, including Brilliant Blue FCF (53 atoms, 57 bonds). (bkchem/oasa/convert.py) - A Python 2 comparison builtin left in oasa's common module is fixed:
is_uniquely_sorted()fell back tocmp, which Python 3 removed, so calling it without a sorting function raisedNameError. The in-application callers (the CIP code) always pass a sorting function, so this was not reachable from the GUI. (bkchem/oasa/oasa/common.py) - oasa's standalone SVG writer works again:
mol_to_svg()insvg_out.pyusedfile()and raisedNameErrorwhenever it was called. The BKChem application itself writes SVG through its ownxml_writer, so this affected only direct users of the library function. (bkchem/oasa/oasa/svg_out.py) - oasa's subsearch data readers and generator work again:
subsearch.pyusedfile()in six places, and its data generator wrote rawmapobjects into the generatedsubsearch_data.py; both are fixed. The readers are marked deprecated in the module itself, and the live group search in Molecular Descriptors, which reads the already-generated data, is unchanged. (bkchem/oasa/oasa/subsearch.py)
BKChem-portable for Windows
Fork release 9 — 2026-11-10
Added / Changed
- The build of the portable releases is automated by GitHub Actions: (
.github/workflows/build-portable.yml)
Fixed
- The bugs in the experimental web server module are fixed: The Python 2 code in
http_server.pyandhttp_server2.pywas fixed so that they would pass the import and handler functionality tests. Note that thestart_server()function inmain.py—the only file that calls these scripts—has been commented out. (bkchem/http_server.py,bkchem/http_server2.py) - The final processing for Read SMILES / Read InChI is modified: The final processing of the structural formula generation program within BKChem is modified to use a more conservative approach: only atoms that are virtually completely overlapping (less than 5% of the bond length) are separated to 0.6 bond lengths. While the conversion of compounds that are resistant to deformation, such as Phloxine B, has improved, compounds with longer carbon chains, such as α-Tocopherol acetate, sometimes result in entangled structures when converted. In such cases, reloading helps. However, using OpenBabel is recommended instead. (
bkchem/oasa_bridge.py) - Structure database module is fixed: This is a library feature that oasa silently disabled when the import failed, as there was no place in the BKChem menu to call this module. The now-deprecated external package
pysqlite2has been replaced by the standard library’ssqlite3. Three instances within the same file (file(), opening a file in gzip text mode, and passingdict.values()tosqlite3) are also fixed. (bkchem/oasa/oasa/structure_database.py) - InChIKey generation is fixed:
get_sha256()passed astrtohashlib, which raisesTypeErroron Python 3, so the wholeinchi_keymodule was unusable and oasa silently disabled it. The digest is now computed from UTF-8 bytes and decoded back with latin-1, so the existingord()-based code sees the same characters as on Python 2. Verified against official keys for ethanol, water, benzene, acetic acid and methane (5/5 match). This is only the fallback used when the external InChI program returns no key — Generate InChI viainchi-1.exeis unaffected. (bkchem/oasa/oasa/inchi_key.py)
BKChem-portable for Windows
Fork release 8 — 2026-11-09
Added / Changed
- Chemistry → Read SMILES and Read InChI can now use OpenBabel: a new Options → OpenBabel program path setting points BKChem at
obabel.exe/obabel; when set, both readers are handled by OpenBabel (parsing plus 2D coordinates via--gen2d, imported as MOL), which generally draws more regular layouts — Toyohide's decision after comparing Phloxine B, where OpenBabel's bond lengths and angles were visibly more uniform. If the program is missing or cannot read an input, BKChem silently falls back to its own oasa reader, and leaving the path empty restores the previous behaviour exactly. One subtlety found in verification: OpenBabel's coordinates are y-up while BKChem's canvas is y-down, so the import flips y — without it every stereocentre inverted (9/48 on the stereo battery; 48/48 with the flip). Bonus on the OpenBabel path: multi-component (salt) InChI now loads (Brilliant Blue FCF, 53 atoms) and InChI stereo (/t) layers are drawn. Verified on Windows with OpenBabel 3.1.1 from the GitHub installer — thepip install openbabelpackage has no Python 3.15 wheel, so the installer, not pip, is the way to getobabel.exe(see "OpenBabel for reading SMILES and InChI" in the README). (bkchem/oasa_bridge.py,bkchem/main.py,bkchem/interactors.py)
Fixed
- Crowded molecules sometimes loaded badly distorted from SMILES: the layout score only measured atom–atom distances, so a layout with an arm draped over the middle could score well while looking collapsed, and with only 6 candidates a good layout often was not even tried (Brilliant Blue FCF came out badly distorted in 3 of 12 loads). The score now also counts crowded pairs, atom-to-bond distances and atoms lying on bonds, and the candidate count rose from 6 to 12 (SMILES) and 3 to 8 (InChI). After the fix, 12 fresh loads of Brilliant Blue FCF were all clean; the five J-GLOBAL compounds and the 48/48 stereo battery are unchanged. The single cleanest orientation is still not guaranteed every time. (
bkchem/oasa_bridge.py) - Python 3 incompatibilities left in unused legacy APIs fixed: a
raise StopIterationinside a generator inperiodic_table.py, the same pattern plus a lambda passed tosort()ingraph.py, and amap(...).sort()in a superseded function inmolecule.py. None of these are called by any current feature, so there is no behavioural change. (bkchem/oasa/oasa/periodic_table.py,bkchem/oasa/oasa/graph/graph.py,bkchem/oasa/oasa/molecule.py)
BKChem-portable for Windows
Fork release 7 — 2026-11-08
Added / Changed
- Chemistry → Generate InChI works again: it always relied on the official InChI program, but on Python 3 it failed even with the program installed (the subprocess call passed text where bytes are required), and InChI 1.07 no longer accepts the legacy STDIO option dialect — the program is now called through temporary files, and a wrong program path shows the dedicated error dialog instead of "Unknown error". Setup: download the InChI software (v1.07 or later, MIT license) from the IUPAC-InChI GitHub releases and point Options → InChI program path at
inchi-1.exe/inchi-1for your OS (see "Generate InChI" in the README). Verified against InChI 1.07.5 with ethanol, acetate, L-alanine (including its stereochemistry) and troxerutin. (bkchem/oasa/oasa/inchi.py) - CML import orientation now matches the other formats: a CML file was drawn vertically mirrored compared with the same structure imported as MOL, and CML files BKChem exported opened mirrored in other editors. Import and export now flip the y coordinates symmetrically, and the CML2 importer reads Ketcher's
<bondStereo>elements instead of silently dropping all wedge/hash bonds. Note: CML files exported by BKChem before this fix will now import mirrored. (bkchem/plugins/CML.py,bkchem/plugins/CML2.py)
Fixed
- Ketcher's MDL MOL V3000 files could not be imported: oasa's molfile reader only understood V2000 and read a V3000 file as an empty molecule, which then crashed the import plugin. A V3000 reader (atom/bond blocks, charges, bond stereo) was added, and a file the reader cannot parse at all now gets the normal import error instead of a crash. (
bkchem/oasa/oasa/molfile.py,bkchem/plugins/molfile.py) - CDXML export lost all bonds and element identity in other programs: exported bonds carried no
idattribute (ChemSketch silently drops id-less objects, so only isolated atoms appeared) and heteroatoms had noElementattribute, so other programs read every atom as carbon. The exporter now writes document-wide ids,Element/NodeType, explicit bond orders and charges; the importer also honours theElementattribute, so a flipped "HO" hydroxyl label no longer round-trips as holmium. (bkchem/plugins/CDXML.py) - Ketcher CML import crashed with
KeyError: 'name': the importer only read old CML1-style child elements while Ketcher writes CML2 attributes; the graceful error path itself referenced a nonexistent field; and CML cis/trans bond stereo became unknown bond types that crashed drawing. All three are fixed, and wedge/hash stereo is preserved. (bkchem/plugins/CML.py) - oasa's CIP priority code was dead on Python 3 (built-in
cmpand other removed idioms): the priority machinery works again — e.g. FC(Cl)(Br)I is recognised as chiral with priorities I > Br > Cl > F. No BKChem feature calls it yet; fixed as part of the Python 3 sweep. (bkchem/oasa/oasa/atom.py) - Ring SMILES writing: oasa's
is_pure_ring()compared afilter()object with a list, so on Python 3 it always answered "not a pure ring". (bkchem/oasa/oasa/smiles.py) - Two silent Python 3 leftovers: a type check in the external-data module always passed (
filter()objects are always truthy), so invalid values were accepted silently; and three dead helper functions in oasa's misc module raised NameError / TypeError if ever called. (bkchem/external_data.py,bkchem/oasa/oasa/misc.py)
v0.14.0-pre2-fork6
Fork release 6 — 2026-11-07
Fixed
- Chemistry → Read InChI now handles charged molecules: acetate, formate and hydroxide used to be drawn as the wrong ion (charge +1 with one extra hydrogen — the sign was lost); methylammonium crashed; sulfur-containing molecules crashed even when neutral. 34 of 36 strict checks pass. Remaining limits: diborane and borohydride still fail cleanly (oasa valency model), nitrate still fails with the Localization error (oasa charge allocation), stereo (/t) layers are not yet reflected in the drawing, and multi-component (salt) InChI is still unsupported. (
bkchem/oasa/oasa/inchi.py) - Large molecules drawn from SMILES / InChI overlapped and looked fused: oasa's coordinate generator never checked for collisions, so in vitamin K, troxerutin and α-tocopherol acetate whole chain segments landed exactly on top of other atoms (distance 0.0). The generator itself is now collision-aware and the cleanest of several candidate layouts is chosen, so all five test compounds on both routes now have 0 overlaps and 0 bond crossings. Streptomycin's InChI also failed for a separate reason (an integer-division leftover) and now reads (40 atoms). Remaining limits: α-tocopherol acetate and troxerutin can still have 1–2 crossings on unlucky layouts; Brilliant Blue FCF's InChI (a multi-component salt) is still unsupported by oasa. (
bkchem/oasa/oasa/coords_generator.py,bkchem/oasa_bridge.py,bkchem/oasa/oasa/misc.py) - Group substitution could place the new group on top of a neighbouring structure: replacing a troxerutin hydroxy group with phenyl left a phenyl carbon 0.53 bond lengths from an atom of the neighbouring ring. After expansion, when a severe approach (below 0.6) exists, the new fragment is now rotated rigidly to a freer direction. In the reported example this moves 0.53 → 0.61, so the severe approach is gone — but it stays snug, because rotation alone cannot do better (a layout that reorients the whole molecule, as in the reference drawing, is beyond a local rotation). Substitutions without a clash are left exactly as before. (
bkchem/group.py) - Molfile export wrote a blank line before "M END": every exported .mol file contained a stray empty line in the property block (a Python 3
filter()object is always truthy, so the "no property lines" case still wrote a line). Readers tolerate it, so no data was lost, but the file was not what the format specifies. (bkchem/oasa/oasa/molfile.py)
BKChem-portable for Windows
Added / Changed
SMILES stereochemistry (chirality) support: Chemistry → Read SMILES now reads @ / @@ and draws each tetrahedral centre with a wedge (forward) or hash (back) bond; for ring centres the wedge is placed on a bond pointing out of the ring, so rings stay flat. The reverse direction works too: Chemistry → Generate SMILES emits @ / @@ from drawn wedge/hash bonds (the oasa parser kept the stereochemistry, but the bridge code dropped it). Known limitation: for fused-ring systems such as α-Thujone, Generate SMILES can return the mirror image because of a pre-existing problem in oasa's SMILES writer. (bkchem/oasa_bridge.py)
Fixed
Generate SMILES crashed on molecules with both a stereocentre and a double bond (e.g. Pyrethrin II) with TypeError: unhashable type: 'explicit_hydrogen': the class defines eq without hash, which Python 3 makes unhashable. (bkchem/oasa/oasa/stereochemistry.py)
Molfile export crashed for molecules containing a radical: the radical atom numbers were still sorted with a Python 2 idiom. Export of ordinary molecules was unaffected. (bkchem/oasa/oasa/molfile.py)
Chemistry → Read InChI failed even for neutral molecules: the conversion loop's success condition could never become true on Python 3, so it always ended with "Localization of bonds, charges or movable hydrogens failed". Neutral molecules without stereochemistry now import (charged InChI still fails for a separate reason). (bkchem/oasa/oasa/inchi.py)
Read SMILES crashed on a single-atom string such as C or O (division by zero when a molecule has no bonds). (bkchem/oasa_bridge.py)