pycsw | Home | Documentation | Issue Tracker | FAQ | Download |
pycsw allows for the implementation of profiles to the core standard. Profiles allow specification of additional metadata format types (i.e. ISO 19139:2007, NASA DIF, INSPIRE, etc.) to the repository, which can be queried and presented to the client. pycsw supports a plugin architecture which allows for runtime loading of Python code.
All profiles must be placed in the server/profiles directory.
pycsw/
server/
profile.py # defines abstract profile object (properties and methods) and functions to load plugins
profiles/ # directory to store profiles
__init__.py # empty
apiso/ # profile directory
apiso.py # profile code
... # supporting files, etc.
All profile code must be instantiated as a subclass of profile.Profile. For example:
from server import profile
class FooProfile(profile.Profile):
profile.Profile.__init__(self, 'foo', '1.0.0', 'My Profile', 'http://example.org/', 'http://example.org/foons', 'foo:TypeName', 'http://example.org/foons')
Your profile plugin class (FooProfile) must implement all methods as per profile.Profile. Profile methods must always return lxml.etree.Element types, or None.
All profiles are disabled by default. To specify profiles at runtime, set the server.profiles value in the Configuration to the name of the package (in the server/profiles directory). To enable multiple profiles, specify as a comma separated value. See Configuration for more information.
The ISO Metadata Application Profile (APISO) is a profile of CSW 2.0.2 which enables discovery of geospatial metadata following ISO 19139:2007 and ISO 19119:2005/PDAM 1.
To expose your geospatial metadata via the APISO, via pycsw, perform the following actions:
By default, all profiles in pycsw are disabled. To enable APISO, set [server.profiles]=apiso in default.cfg.
$ cd /path/to/pycsw
$ export PYTHONPATH=`pwd`
$ python ./sbin/setup_db.py ./server/profiles/apiso/etc/schemas/sql/md_metadata.ddl md_metadata.db
$ python ./server/profiles/apiso/sbin/load_csw_records.py /path/to/records md_metadata.db
This will import all *.xml records from /path/to/records into md_metadata.db.
By default, server/profiles/apiso/apiso.cfg-shipped contains all required binding information. If you are setting up your database as per above, the default configuration needs only the repository.db value to be updated. Otherwise, you can map your own database table and columns.