Created
August 23, 2022 13:06
-
-
Save gannebamm/5ad7dec84e52f5c33c7654422278268d to your computer and use it in GitHub Desktop.
Very basic example of the CSW API usage for https://atlas.thuenen.de
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from owslib.csw import CatalogueServiceWeb | |
from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox | |
# variables | |
csw_endpoint = 'https://atlas.thuenen.de/catalogue/csw' | |
search_text = 'agraratlas' | |
# connect to csw | |
csw = CatalogueServiceWeb(csw_endpoint) | |
# 1. query by search string | |
text_query = PropertyIsEqualTo('csw:AnyText', search_text) | |
csw.getrecords2(constraints=[text_query], maxrecords=20) | |
# print response titles | |
for rec in csw.records: | |
print(csw.records[rec].title) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment