Markus Neteler e2e19e40d5 updated to current API 16 lat temu
..
NumPtr 5524bcabcb Fix "%typemap(out) char **" 17 lat temu
examples e2e19e40d5 updated to current API 16 lat temu
Makefile 89321bbb54 Retain local copies of modules 16 lat temu
README da54482439 boosted to GRASS 7 for parallel installation 17 lat temu
TODO db49180dd7 welcome to GRASS 7.0.svn 17 lat temu
__init__.py 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
common.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
date.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
display.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
grass.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
grasspython.dox 1ff04f14e8 examples listed but they seem to require updates 16 lat temu
imagery.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
math.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
my_typemaps.i cb655b3aac Remove debug code 16 lat temu
proj.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
raster.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
stats.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
test.py 89321bbb54 Retain local copies of modules 16 lat temu
utils.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu
vector.i 5fcdafa3e9 Move Python rules into Python.make 16 lat temu

README

What is this?
-------------
This is SWIG based python wrapping for GRASS API
which allows to call GRASS functions from python programs.
Currently only a limited set of functions (those needed for
me) are wrapped.


How to INSTALL?
---------------
1. Install SWIG, the Simplified Wrapper and Interface Generator
http://www.swig.org

2. Be sure you configured GRASS with support for Python:
./configure --with-python=/usr/bin/python2.5-config

3. Run make in the swig/python/ directory

It will create two files, python_grass7.py and _python_grass7.so.

4. From within GRASS (or a fake grass session) run "python test.py" to
test and to automatically create a byte-compiled version of the module
(python_grass7.pyc). The .pyc file is platform independent and may be
safely shared among systems. Even so, it doesn't hurt to rebuild it
ourselves while we still have write permissions and to make sure we
are using an up to date copy. (out of date copies will be ignored)

5. It is useful to build the NumPtr module as well.
- see README.GRASS in that directory for instructions

How to use it?
--------------

import python_grass7
GRASS functions will be available in this module.
Eg:
import python_grass7
mapset=python_grass7.G_mapset()
print mapset

See examples/m.distance for an example of a working SWIG-Python module.

More examples can be found on the GRASS Wiki site's Python page:
http://grass.gdf-hannover.de/wiki/GRASS_and_Python#Python-SWIG-GRASS_interface


DEBUGGING
----------

gdb --args python

e.g.
gdb --args python rasteraccess.py


TODO
-----
See TODO in this directory.


AUTHOR
-----

Sajith VK sajithvk at gmail.com
Thu, 9 Mar 2006 16:02:50 +0530
http://grass.itc.it/pipermail/grass-dev/2006-March/021651.html
http://freegis.gnu.org.in/temporary/python_grass6.tar.bz2