Lena is an architectural framework for data analysis. It is written in a popular programming language Python and works with Python versions 2, 3 and PyPy (2 and 3).

Lena features from programming point of view include:

  • simple and powerful programming language.
  • modularity, weak coupling. Algorithms can be easily added, replaced or reused.
  • code reuse. Logic is separated from presentation. One template can be used for several plots.
  • rapid development. One can run only those elements which already work. During development only a small subset of data can be analysed (to check the code). Results of heavy calculations can be easily saved.
  • performance. Lazy evaluation is good for memory and speed. Several analyses can be done reading data once. PyPy with just-in-time compiler can be used if needed.
  • easy to understand, structured and beautiful code.

From data analysis perspective:

  • comparison of analyses with arbitrary changes (including different input data or algorithms).
  • algorithm reuse for a subset of data (for example, to see how an algorithm works at different positions in the detector).
  • analysis consistency. When we run several algorithms for same data or reuse an algorithm, we are confident that we use same data and algorithm.
  • algorithms can be combined into a more complex analysis.

Lena was created in experimental neutrino physics and is named after a great Siberian river.



Install the latest official version from PyPI:

pip install lena

Lena core modules have no dependencies except Python standard libraries.


This installation is needed only if you want to extend and develop Lena. Download the full repository (with history) from GitHub and install all development dependencies:

git clone https://github.com/ynikitenko/lena
pip install -r lena/requirements.txt

Install command line programs from the previous subsection and adjust PYTHONPATH as shown in the next subsection.

GitHub or PyPI

PyPI contains the last official release, which was tested for more Python versions. GitHub contains the most recent development code for experienced users. Usually it is well tested too, but there is a chance that a newly introduced interface will be changed.

For most users pip install should be easier. If for some reasons you can’t do that, you can get an archive of an official release from GitHub releases.

pip installs the framework into a system directory, while to install with git you need to adjust the PYTHONPATH. Add to your profile (e.g. .profile or .bashrc on Linux)

export PYTHONPATH=$PYTHONPATH:<path-to-lena>

and replace <path-to-lena> with the actual path to the cloned repository.


To get started, read the Tutorial.

Complete documentation for Lena modules can be found in the Reference.

See Release Notes for changes.


Lena is free software released under Apache software license (version 2). You can use it freely for your data analysis, read its source code and modify it.

It is intended to help people in data analysis, but we don’t take responsibility if something goes wrong.


Ruffus is a Computation Pipeline library for Python used in science and bioinformatics. It connects program components by writing and reading files.