Reaction-network

8.3.0 · active · verified Fri Apr 17

Reaction-network is a Python package (version 8.3.0) for synthesis planning and predicting chemical reaction pathways in inorganic materials synthesis. It focuses on representing and analyzing chemical reactions, materials, and their relationships within a network structure. The library has a regular release cadence, with major versions introducing significant architectural changes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to define basic chemical reactions from strings, combine them into a ReactionNetwork, and inspect its properties. It also includes commented-out code for plotting, highlighting the need for the optional Graphviz dependency.

from reaction_network import Reaction, ReactionNetwork

# Define reactions
r1 = Reaction.from_string("A + B -> C")
r2 = Reaction.from_string("C + D -> E")
r3 = Reaction.from_string("A + D -> F") # A side reaction

# Create a network
rn = ReactionNetwork([r1, r2, r3])

# Print materials and reactions
print(f"Materials: {rn.materials}")
print(f"Reactions: {rn.reactions}")

# To plot the network (requires graphviz Python package and system executable)
# rn.plot(filename="reaction_network.png", fmt="png")

view raw JSON →