m.csw.update
Update catalogue service for the web connections resources candidates.
m.csw.update [-aivnpswlxck] [spreadsheet=name] [url=string] xml=name xsd=name timeout=timeout [separator=separator] [proxy=proxy [,proxy,...]] [header=header [,header,...]] [--verbose] [--quiet] [--qq] [--ui]
Example:
m.csw.update xml=connections_resources.xml xsd=connections_resources.xsd timeout=10
grass.script.run_command("m.csw.update", spreadsheet="API-cases.ods", url=None, xml="connections_resources.xml", xsd="connections_resources.xsd", timeout=10, separator="': '", proxy=None, header="User-Agent=Mozilla/5.0", flags=None, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("m.csw.update", xml="connections_resources.xml", xsd="connections_resources.xsd", timeout=10)
Parameters
spreadsheet=name
Path to spreadsheet file (ODS format)
Default: API-cases.ods
url=string
Spreadsheet file URL
xml=name [required]
Path to CSW connections resources XML file
Default: connections_resources.xml
xsd=name [required]
Path to CSW connections resources validation schema XSD file
Default: connections_resources.xsd
timeout=timeout [required]
Timeout for checking if CSW connections resources URL is active
Default: 10
separator=separator
Separator inside connections resources item string '{Name}{Separator}{URL}' (print only), use "separator"
Default: ': '
proxy=proxy [,proxy,...]
Set the proxy with: "http=<value>,ftp=<value>"
header=header [,header,...]
Set the header with: "User-Agent=<value>,Accept=<value>"
Default: User-Agent=Mozilla/5.0
-a
Print all active (valid and active) CSW connections resources only
-i
Print not active CSW connections resources only
-v
Print valid CSW connections resources URLs
-n
Print not valid CSW connections resources URLs
-p
Print all new CSW connections (valid/not valid, active/not active) resources with following format '{Country}, {Governmental level}, {API provider}: {URL}'
-s
Print new CSW connections resources summary info
-w
Print default spreadsheet file URL
-l
Print default local spreadsheet file URL
-x
Validate CSW connections resources XML file against XSD schema
-c
Remove and print not active CSW connection resources from XML file
-k
Remove and print not valid CSW connections resources from XML file
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
spreadsheet : str, optional
Path to spreadsheet file (ODS format)
Used as: input, file, name
Default: API-cases.ods
url : str, optional
Spreadsheet file URL
Used as: string
xml : str, required
Path to CSW connections resources XML file
Used as: input, file, name
Default: connections_resources.xml
xsd : str, required
Path to CSW connections resources validation schema XSD file
Used as: input, file, name
Default: connections_resources.xsd
timeout : int, required
Timeout for checking if CSW connections resources URL is active
Used as: timeout
Default: 10
separator : str, optional
Separator inside connections resources item string '{Name}{Separator}{URL}' (print only), use "separator"
Used as: separator
Default: ': '
proxy : str | list[str], optional
Set the proxy with: "http=<value>,ftp=<value>"
Used as: proxy
header : str | list[str], optional
Set the header with: "User-Agent=<value>,Accept=<value>"
Used as: header
Default: User-Agent=Mozilla/5.0
flags : str, optional
Allowed values: a, i, v, n, p, s, w, l, x, c, k
a
Print all active (valid and active) CSW connections resources only
i
Print not active CSW connections resources only
v
Print valid CSW connections resources URLs
n
Print not valid CSW connections resources URLs
p
Print all new CSW connections (valid/not valid, active/not active) resources with following format '{Country}, {Governmental level}, {API provider}: {URL}'
s
Print new CSW connections resources summary info
w
Print default spreadsheet file URL
l
Print default local spreadsheet file URL
x
Validate CSW connections resources XML file against XSD schema
c
Remove and print not active CSW connection resources from XML file
k
Remove and print not valid CSW connections resources from XML file
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
m.csw.update updates the CSW connections resource XML file (required by the g.gui.cswbrowser and g.gui.metadata modules). If the -p flag is used only printing instead of writing is done.
The module also allows validate the connections resources XML file against XSD schema, remove invalid and not active CSW connections resources candidates.
NOTES
For dependencies and installation instructions see the wiki page.
Stored new connections resources candidates are only those being active and valid.
Writing new connections resources candidates
Default source of the new candidates is a spreadsheet file (*.ods), which is to be stored in the module's config/ directory. It is possible to use the updated document directly from the web address, see -w flag.
EXAMPLES
Import and store new resources connections candidates (default):
m.csw.update url=API-cases.ods
Store new resources connections candidates along with printing a summary info:
m.csw.update -s
Print only all new connections resources candidates (with following format '{Country}, {Governmental level}, {API provider}: {URL}') with summary info:
m.csw.update -ps
Print only active new connections resources candidates with summary info:
m.csw.update -pas
Validate the default connections resources XML file against XSD schema plus validate individual CSW connection resources (remove and print non active CSWs):
m.csw.update -xc
SEE ALSO
g.gui.cswbrowser, g.gui.metadata
See also related wiki page.
AUTHOR
Tomas Zigo
SOURCE CODE
Available at: m.csw.update source code
(history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819