DOI PyPI version Downloads License: MIT

Travis-CI Appveyor Codecov is a lean persistent homology package for Python. Building on the blazing fast C++ Ripser package as the core computational engine, provides an intuitive interface for

  • computing persistence cohomology of sparse and dense data sets,

  • visualizing persistence diagrams,

  • computing lowerstar filtrations on images, and

  • computing representative cochains.

We supply a large set of interactive notebooks that demonstrate how to take advantage of all the features available. is an evolution of the original C++ Ripser project. We have put extensive work into making the package available to Python developers across all major platforms. If you are having trouble installing, please let us know by opening a github issue.

You can find the source code on github at Scikit-TDA/ For the original C++ library, see Ripser/ripser.

Setup is available on Pypi. To install, you’ll first need Cython.

pip install Cython
pip install Ripser

Example Usage

The interface is as simple as can be:

import numpy as np
from ripser import ripser
from persim import plot_diagrams

data = np.random.random((100,2))
diagrams = ripser(data)['dgms']
plot_diagrams(diagrams, show=True)

We also supply a Scikit-learn transformer style object if you would prefer to use that:

import numpy as np
from ripser import Rips

rips = Rips()
data = np.random.random((100,2))
diagrams = rips.fit_transform(data)


We welcome contributions of all shapes and sizes. There are lots of opportunities for potential projects, so please get in touch if you would like to help out. Everything from an implementation of your favorite distance, notebooks, examples, and documentation are all equally valuable so please don’t feel you can’t contribute.

To contribute please fork the project make your changes and submit a pull request. We will do our best to work through any issues with you and get your code merged into the main branch.


If you use this package, please site the JoSS paper found here: DOI

You can use the following bibtex entry

    doi = {10.21105/joss.00925},
    url = {},
    year  = {2018},
    month = {Sep},
    publisher = {The Open Journal},
    volume = {3},
    number = {29},
    pages = {925},
    author = {Christopher Tralie and Nathaniel Saul and Rann Bar-On},
    title = {{}: A Lean Persistent Homology Library for Python},
    journal = {The Journal of Open Source Software}

License is available under an MIT license! The core C++ code is derived from Ripser, which is also available under an MIT license and copyright to Ulrich Baeur. The modifications, Python code, and documentation is copyright to Christopher Tralie and Nathaniel Saul.