Skip to content

saga-project/saga-cpp-binding-python

Repository files navigation

                            SAGA Python Bindings
                  - The Simple API for Grid Applications -
                    <http://www.saga-project.org/python> 


  WHAT IS THIS?

  These are the Python API bindings for the SAGA C++ reference 
  implementation. It provides a thin Python wrapper on top of
  the native SAGA C++ API. This allows you to use saga and all
  of its middleware adaptors with Python! 


  LATEST VERSION

  Details of the latest version can be found on the project page:

  http://www.saga-project.org/python


  INSTALLATION - Read the INSTALL file


  DOCUMENTATION

  The documentation available as of the date of this release is included
  in HTML format in the docs/apidoc directory. The most up-to-date
  documentation for the current release can be found on the project page:

  http://www.saga-project.org/documentation/python/


  QUICKSTART

    install python bindings: see INSTALL for details
    > export SAGA_LOCATION=/path/to/saga/core/installation
    > ./configure
    > make
    > make install
    
    using python bindings in python interpreter 
    (attention: python version depending on your system)
    > export PYTHONPATH=$SAGA_LOCATION/lib/python2.6.5/site-packages
    > python
    >>> import saga
    >>> my_jd = saga.job.description()
    >>> my_jd.executable = "/bin/hostname"
    >>> my_jd.output     = "stdout.txt"
    >>> my_js            = saga.job.service("fork://localhost/");
    >>> my_job           = my_js.create_job(my_jd)
    >>> my_job.run()
    >>> my_job.wait(-1)
    >>> quit()
    > cat stdout.txt
    boskop

    using python bindings in scripts
    > export PYTHONPATH=$SAGA_LOCATION/lib/python2.6.5/site-packages
    > python examples/job/simple_example.py
    > cat stdout.txt
    boskop


  KNOWN PROBLEMS

  On OSX, the python bindings seem to compile and link fine against MacPort
  installations of boost and python.  At runtime, however, the dynamic loader
  seems to somtimes prefer the systems python libraries.  That may cause the
  following error:

    $ python
      # import saga
      # saga.url('bla')
      Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          TypeError: __init__() should return None, not 'NoneType'

  This can be manually fixed by 

    $ install_name_tool -change
      /System/Library/Frameworks/Python.framework/Versions/2.7/Python \
      /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python \
      _engine.so


  LICENSING

  The Pyton Bindings are released under the Boost Software License 1.0.
  Please see the LICENSE file for details.


  CONTACT

  If you want to be informed about new code releases, bug fixes,
  security fixes, general news and information about SAGA, subscribe 
  to the saga-users mailing list at http://www.saga-project.org/mailinglists.