/pumas-python

Experimental Python bindings for PUMAS

Primary LanguagePythonGNU Lesser General Public License v3.0LGPL-3.0

Python bindings for the PUMAS library

Warning: This is an experimental project. It is work in progress.

Building

From source, on Linux:

  1. Clone this project

    git clone https://github.com/niess/pumas-python
    
  2. Copy, or link, the pumas.c and pumas.h source files.

    ln -s $PUMAS_DIR/src/pumas.c pumas/c/src
    ln -s $PUMAS_DIR/include/pumas.h pumas/c/include
    

    where PUMAS_DIR is the location of the PUMAS source.

  3. Run the Makefile

    cd pumas-python
    make
    

    This generates in-source bindings under the pumas/ folder.

  4. (Optionnaly) export the pumas/ folder to PYTHONPATH

    export PYTHONPATH=$(pwd):$PYTHONPATH
    

Usage

A few examples of usage are located under the examples/ folder. The Python API is similar to the C one, with some quality of life tweaks.