pycsw | Home | Community | Demos | Docs | Issue Tracker | FAQ | Download |
pycsw requires the following supporting libraries:
Note
You can install these dependencies via easy_install or pip
Note
For GeoNode or Open Data Catalog deployments, SQLAlchemy is not required
Download the latest version or fetch from Git:
$ git clone git://github.com/geopython/pycsw.git
Ensure that CGI is enabled for the install directory. For example, on Apache, if pycsw is installed in /srv/www/htdocs/pycsw (where the URL will be http://host/pycsw/csw.py), add the following to httpd.conf:
<Location /pycsw/>
Options FollowSymLinks +ExecCGI
Allow from all
AddHandler cgi-script .py
</Location>
Note
If pycsw is installed in cgi-bin, this should work as expected. In this case, the tests application must be moved to a different location to serve static HTML documents.
$ git clone git://github.com/geopython/pycsw.git
$ python setup.py build
$ python setup.py install
At this point, pycsw is installed as a library and requires a CGI csw.py or WSGI csw.wsgi script to be served into your web server environment (see below for WSGI configuration/deployment).
# easy_install or pip will do the trick
$ easy_install pycsw
# or
$ pip install pycsw
In order to install the OBS package in openSUSE 12.2, one can run the following commands as user root:
# zypper -ar http://download.opensuse.org/repositories/Application:/Geo/openSUSE_12.2/ GEO
# zypper -ar http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.2/ python
# zypper refresh
# zypper install python-pycsw pycsw-cgi
For earlier openSUSE versions change 12.2 with 12.1. For future openSUSE version use Factory.
An alternative method is to use the One-Click Installer.
In order to install pycsw to an Ubuntu based distribution, one can run the following commands:
# sudo add-apt-repository ppa:gcpp-kalxas/ppa-tzotsos
# sudo apt-get updated
# sudo apt-get install python-pycsw pycsw-cgi
An alternative method is to use the OSGeoLive installation script located in pycsw/etc/dist/osgeolive:
# cd pycsw/etc/dist
# sudo ./install_pycsw.sh
The script installs the dependencies (Apache, lxml, sqlalchemy, shapely, pyproj) and then pycsw to /var/www.
For Windows installs, change the first line of csw.py to:
#!/Python27/python -u
Note
The use of -u is required to properly output gzip-compressed responses.
By default, default.cfg is at the root of the pycsw install. If pycsw is setup outside an HTTP server’s cgi-bin area, this file could be read. The following options protect the configuration:
<Files ~ "\.(cfg)$">
order allow,deny
deny from all
</Files>
pycsw supports the Web Server Gateway Interface (WSGI). To run pycsw in WSGI mode, use csw.wsgi in your WSGI server environment. Below is an example of configuring with Apache:
WSGIDaemonProcess host1 home=/var/www/pycsw processes=2
WSGIProcessGroup host1
WSGIScriptAlias /pycsw-wsgi /var/www/pycsw/csw.wsgi
<Directory /var/www/pycsw>
Order deny,allow
Allow from all
</Directory>
or use the WSGI reference implementation:
$ python ./csw.wsgi
Serving on port 8000...
which will publish pycsw to http://localhost:8000/