Installing

Required Software

pycsw
Source home is on GitHub.
Python
Core language of pycsw. Both 3.x and 2.x series are supported.
Database
Used to store metadata elements (PostgreSQL/PostGIS, SQLite, MySQL).
SQLAlchemy
Used to bind database models to Python classes.
OWSLib
Used to parse XML formats.
lxml
Used to parse requests.
pyproj
Used to handle coordinate transformations.
Shapely
Used for spatial operations.

Software Architecture

../../_images/pycsw-software-architecture.jpg

OSGeo Live DVD

see Workshop Requirements

The 4 minute install

$ virtualenv pycsw && cd pycsw && . bin/activate
$ git clone git@github.com:geopython/pycsw.git && cd pycsw
$ pip install -e . && pip install -r requirements.txt
$ cp default-sample.cfg default.cfg
$ vi default.cfg
# adjust paths in
# - server.home
# - repository.database
# set server.url to http://localhost:8000/
$ python csw.wsgi
$ curl http://localhost:8000/?service=CSW&version=2.0.2&request=GetCapabilities

Windows

Note

The following steps were performed on a Windows Vista machine.

  • Install Python:

  • Install Package Management Tools

  • Install Virtual Environment

    • highly recommended
    • read more on its usage: https://pypi.python.org/pypi/virtualenv
    • C:\Python26\Scripts\easy_install.exe virtualenv
      • Create virtual environment
        • C:\Python26\Scripts\virtualenv.exe pycsw-workshop
        • cd pycsw-workshop
        • scripts\activate.exe
  • Install pycsw Dependencies

    • C:\Python26\Scripts\easy_install.exe lxml==2.2.8
    • C:\Python26\Scripts\easy_install.exe pyproj==1.9.2
    • C:\Python26\Scripts\easy_install.exe Shapely==1.2.17
    • C:\Python26\Scripts\easy_install.exe SQLAlchemy>=0.6
    • C:\Python26\Scripts\easy_install.exe OWSLib==0.7.1
  • Install pycsw

    • Download pycsw from http://pycsw.org/download.html and unzip into pycsw-workshop/ folder
    • cd pycsw-1.4.1
    • copy default-sample.cfg default.cfg
    • edit default-sample.cfg
    server.home (e.g. home=C:/Python26/Scripts/pycsw-workshop/pycsw-1.4.1)
    server.url to url=http://localhost:8000/
    repository.database (e.g. database=sqlite:///C:\\Python26\\Scripts\\pycsw-workshop\\pycsw-1.4.1\\data\\cite\\records.db)
    

    Note

    Read more on the database= syntax for PostgreSQL here, SQLite here, or MySQL here.

  • Start CSW server