Make sure you have Python 3.6 or higher installed on your system.
To create a virtual environment, follow these steps:
-
Open a terminal and navigate to the directory containing the
iso-19139-to-dcat-ap.py
script. -
Create a virtual environment by issuing the following command:
-
On Windows:
python -m venv env
-
On MacOS and Linux:
python3 -m venv env
-
-
Enable the virtual environment:
-
On Windows:
.\env\Scripts\activate
-
On MacOS and Linux:
source env/bin/activate
-
With the virtual environment activated, install the necessary prerequisites by running the following command:
-
On Windows, MacOS and Linux:
pip install -r requirements.txt
To configure the script, you need to create a config.yaml
file based on the provided config.yaml.example
. You can do this by copying the example file:
-
On Windows:
copy config.yaml.example config.yaml
-
On MacOS and Linux:
cp config.yaml.example config.yaml
-
xml_url
: The URL to the CSW endpoint. Example:xml_url: http://some.site/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns%28csw=http://www.opengis.net/cat/csw%29&resultType=results&outputSchema=http://www.isotc211.org/2005/gmd&outputFormat=application/xml&typeNames=csw:Record&elementSetName=full&constraintLanguage=CQL_TEXT&constraint_language_version=1.1.0&maxRecords=10
-
xsl_url
: The URL to the XSLT transformation or the local XSLT file path. Example:xsl_url: https://raw.githubusercontent.com/mjanez/iso-19139-to-dcat-ap/refs/heads/develop/iso-19139-to-dcat-ap.xsl
Once you have configured the config.yaml
file, you can run the script as follows:
python iso-19139-to-dcat-ap.py