Skip to content
python interfaces to the nuclear reaction rate databases
Fortran Python Perl Makefile TeX Yacc Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status DOI DOI Binder

Python interfaces to the nuclear reaction rate databases, including the JINA Reaclib nuclear reactions database. This project has 2 goals:

  • allow for an exploration of rates and collection of rates (networks) in Jupyter notebooks

  • allow for the easy creation of the righthand side routines for reaction network integration (the ODEs)

To do this, pynucastro provides a parser for the Reaclib format to produce either a callable python function for a rate or output the python code for a function that can be incorporated into a rate module.

pynucastro does not yet support nuclear partition functions for Reaclib reverse rates, as the implementation is currently under development. We recommend you consider what problem you wish to study using pynucastro to determine whether reverse rates and partition function corrections are significant at the temperatures of interest.


Documentation for pynucastro is available here:


import pynucastro

r = pynucastro.Rate("c13-pg-n14-nacr")

# evaluate this rate at T = 1.e9 K

Also see the Jupyter notebooks:


To install the package, you can run:

python install

for a systemwide install, or

python install --user

for a single-user install. This will put the pynucastro modules and library in the default location python searches for packages.


This package requires Python 3 (release 3.4 or later) and the following Python packages:

  • numpy

  • sympy

  • scipy

  • matplotlib

  • networkx

  • ipywidgets

To build the documentation or run the unit tests, sphinx and pytest are additionally required along with some supporting packages. See the included requirements.txt file for a list of these packages and versions. To install the packages from the requirements file, do:

pip install -r requirements.txt

unit tests

We use py.test to do unit tests. In pynucastro/, do:

py.test -v .

to see coverage, do:

py.test --cov=pynucastro .

to test the notebooks, do:

py.test --nbval examples

If your OS has both Python 2 and Python 3 installed you may need to invoke pytest as py.test-3 when running the unit tests.

You can’t perform that action at this time.