GRASS GIS session utilities
Project description
A simple library to use GRASS GIS from python. You can specify the GRASS executable that you want to use with an enviromental variable called: GRASSBIN
Status
In development
Install
To install the stable version use:
$ pip install grass-session
To install the current development version use:
$ pip install git+https://github.com/zarch/grass-session.git
Examples
Set the GRASS GIS binary that you want to use with: export GRASSBIN=grass75:
>>> from grass_session import Session >>> from grass.script import core as gcore >>> with Session(gisdb="/tmp", location="location", ... create_opts="EPSG:4326"): ... print(gcore.parse_command("g.gisenv", flags="s")) {u'GISDBASE': u"'/tmp/';", u'LOCATION_NAME': u"'epsg3035';", u'MAPSET': u"'PERMANENT';",} >>> with Session(gisdb="/tmp", location="location", mapset="test", ... create_opts=""): ... print(gcore.parse_command("g.gisenv", flags="s")) {u'GISDBASE': u"'/tmp/';", u'LOCATION_NAME': u"'epsg3035';", u'MAPSET': u"'test';",}
Development
Clone the repository:
$ git clone git@github.com:zarch/grass_session.git
Make sure that py.test, and tox are installed:
$ pip install -r requirements-testing.txt
Test locally with py.test:
$ GRASSBIN=~/.local/bin/grass75 PYTHONPATH="`pwd`:$PYTHONPATH" py.test test/py.test test/
Test against multiple Python environments using tox:
$ tox ... _________________________________ summary _________________________________ py27: commands succeeded py36: commands succeeded congratulations :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for grass_session-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0386b4d433c03865cd1522bf8db440c9a21d5895402734727ecbf8d196ac9430 |
|
MD5 | 1621fe32e3e118ce22794a76a34fda78 |
|
BLAKE2b-256 | aebe5b9f707dff22529358c3d147373658a85599540addffbda9c629dcc97366 |