pycsw is an OGC API - Records and OGC CSW server implementation written in Python. Started in 2010 (more formally announced in 2011), pycsw allows for the publishing and discovery of geospatial metadata via numerous APIs (CSW 2/CSW 3, OpenSearch, OAI-PMH, SRU), providing a standards-based metadata and catalogue component of spatial data infrastructures. pycsw is Open Source, released under an MIT license, and runs on all major platforms (Windows, Linux, Mac OS X).
# Setup a virtual environment:
python3 -m venv pycsw && cd pycsw && . bin/activate
# Grab the pycsw source code:
git clone https://github.com/geopython/pycsw.git && cd pycsw
pip3 install -e . && pip3 install -r requirements-standalone.txt
# Create and adjust a configuration file:
cp default-sample.yml default.yml
vi default.yml
# adjust paths in
# - server.home
# - repository.database
# set server.url to http://localhost:8000/
# Setup the database:
pycsw-admin.py setup-repository --config default.yml
# Load records by indicating a directory of XML files, use -r for recursive:
pycsw-admin.py load-records --config default.yml --path /path/to/xml/
# Run the server:
python ./pycsw/wsgi.py
# See that it works!
curl http://localhost:8000 # OGC API - Records
curl http://localhost:8000/csw?service=CSW&version=2.0.2&request=GetCapabilities # CSW
Everything is callable and configurable: