System Requirements

pycsw is written in Python, and works with (tested) Python 3.

pycsw requires the following Python supporting libraries:

  • lxml for XML support

  • SQLAlchemy for database bindings

  • pyproj for coordinate transformations

  • PyYAML for configuration management

  • Shapely for spatial query / geometry support

  • OWSLib for CSW client and metadata parser

  • xmltodict for working with XML similar to working with JSON

  • geolinks for dealing with geospatial links

OGC API - Records

OGC API - Records support additionally requires the following:

  • Flask for pycsw’s default OGC API - Records endpoint

  • pygeofilter for CQL parsing


You can install these dependencies via pip


For GeoNode or Open Data Catalog or HHypermap deployments, SQLAlchemy is not required

Installing from Source

Download the latest stable version or fetch from Git.

For Developers and the Truly Impatient

The 4 minute install:

virtualenv pycsw && cd pycsw && . bin/activate
git clone && cd pycsw
pip3 install -e . && pip3 install -r requirements-standalone.txt
cp default-sample.yml default.yml
vi default.yml
# adjust paths in
# server.home
# repository.database
# set server.url to http://localhost:8000/
# start server - CSW 2/3, OAI-PMH, OpenSearch, SRU (all endpoints at /)
python3 pycsw/
curl http://localhost:8000/?service=CSW&version=2.0.2&request=GetCapabilities

To enable OGC API - Records as well as the abovementioned search standards:

# configure which config file to use
export PYCSW_CONFIG=default.yml
# start server - OGC API - Records and all services (various endpoints below)
python3 pycsw/
# OGC API - Records
curl http://localhost:8000
# OpenAPI document
curl http://localhost:8000/openapi
curl http://localhost:8000/csw
curl http://localhost:8000/csw?service=CSW&version=2.0.2&request=GetCapabilities
curl http://localhost:8000/oaipmh
# OpenSearch
curl http://localhost:8000/opensearch
curl http://localhost:8000/sru

The Quick and Dirty Way

git clone

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/, add the following to httpd.conf:

<Location /pycsw/>
 Options +FollowSymLinks +ExecCGI
 Allow from all
 AddHandler cgi-script .py


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.

Make sure, you have all the dependencies from requirements.txt and requirements-standalone.txt

The Clean and Proper Way

git clone
cd pycsw
python3 build
python3 install

At this point, pycsw is installed as a library and requires a CGI or WSGI pycsw/ script to be served into your web server environment (see below for WSGI configuration/deployment).

Installing from the Python Package Index (PyPI)

pip3 install pycsw

Installing from OpenSUSE Build Service

In order to install the pycsw package in openSUSE Leap (stable distribution), one can run the following commands as user root:

zypper -ar GEO
zypper refresh
zypper install python-pycsw pycsw-cgi

In order to install the pycsw package in openSUSE Tumbleweed (rolling distribution), one can run the following commands as user root:

zypper -ar GEO
zypper refresh
zypper install python-pycsw pycsw-cgi

An alternative method is to use the One-Click Installer.

Installing on Ubuntu/Mint

In order to install the most recent pycsw release to an Ubuntu-based distribution, one can use the UbuntuGIS Unstable repository by running the following commands:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install python-pycsw pycsw-cgi

Alternatively, one can use the UbuntuGIS Stable repository which includes older but very well tested versions:

sudo add-apt-repository ppa:ubuntugis/ppa sudo apt-get update sudo apt-get install python-pycsw pycsw-cgi


Since Ubuntu 16.04 LTS Xenial release, pycsw is included by default in the official Multiverse repository.

Running on Windows

For Windows installs, change the first line of to:

#!/Users/USERNAME/AppData/Local/Programs/Python/Python36/python -u


The use of -u is required to properly output gzip-compressed responses.


USERNAME should match your username, and the Python version should match with your install (e.g. Python36).


MS4W (MapServer for Windows) as of its version 4.0 release includes pycsw, Apache’s mod_wsgi, Python 3.7, and many other tools, all ready to use out of the box. After installing, you will find your local pycsw catalogue endpoint, and steps for further configuration, on your browser’s localhost page. You can read more about pycsw inside MS4W here.


By default, default.yml 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:

  • move default.yml to a non HTTP accessible area, and modify to point to the updated location

  • configure web server to deny access to the configuration. For example, in Apache, add the following to httpd.conf:

<Files ~ "\.(yml)$">
 order allow,deny
 deny from all

Running on WSGI

pycsw supports the Web Server Gateway Interface (WSGI). To run pycsw in WSGI mode, use pycsw/ in your WSGI server environment.


mod_wsgi supports only the version of python it was compiled with. If the target server already supports WSGI applications, pycsw will need to use the same python version. WSGIDaemonProcess provides a python-path directive that may allow a virtualenv created from the python version mod_wsgi uses.

Below is an example of configuring with Apache:

WSGIDaemonProcess host1 home=/var/www/pycsw processes=2
WSGIProcessGroup host1
WSGIScriptAlias /pycsw-wsgi /var/www/pycsw/
<Directory /var/www/pycsw>
  Order deny,allow
  Allow from all

or use the WSGI reference implementation:

python3 ./pycsw/
Serving on port 8000...

which will publish pycsw to http://localhost:8000/