db.csw.admin
CSW database manager
db.csw.admin [-rsiohdfa] configure=name [load_records=string] [export_records=string] [gen_sitemap=name] [url_csw=string] [file_xml=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
db.csw.admin configure=/var/www/html/pycsw/default.cfg
grass.script.run_command("db.csw.admin", configure="/var/www/html/pycsw/default.cfg", load_records=None, export_records=None, gen_sitemap=None, url_csw=None, file_xml=None, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)
Example:
gs.run_command("db.csw.admin", configure="/var/www/html/pycsw/default.cfg")
grass.tools.Tools.db_csw_admin(configure="/var/www/html/pycsw/default.cfg", load_records=None, export_records=None, gen_sitemap=None, url_csw=None, file_xml=None, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)
Example:
tools = Tools()
tools.db_csw_admin(configure="/var/www/html/pycsw/default.cfg")
This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.
Parameters
configure=name [required]
    path to configure file (default.cfg)
    Default: /var/www/html/pycsw/default.cfg
load_records=string
    Load metadata(folder)
    Loads metadata records from directory into repository
export_records=string
    Create db dump(folder)
    Dump metadata records from repository into directory
gen_sitemap=name
    Sitemap
    Generate XML Sitemap
url_csw=string
    Url of CSW
    Execute a CSW request via HTTP POST: URL of CSW
file_xml=name
    XML file
    Execute a CSW request via HTTP POST: XML FILE
-r
    Load records recursively
    Load records from directory recursively
-s
    Setup database
    Creates repository tables and indexes
-i
    Database indexes
    Rebuild repository database indexes
-o
    Optimize db
    Optimize repository database
-h
    Refresh harvested records
    Optimize repository database
-d
    Delete all records(!!)
    Delete all records without prompting
-f
    Force confirmation
    Force confirmation of task
-a
    Automatic configuration
    Set database according GRASS default and confugure server
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog
configure : str, required
    path to configure file (default.cfg)
    Used as: input, file, name
    Default: /var/www/html/pycsw/default.cfg
load_records : str, optional
    Load metadata(folder)
    Loads metadata records from directory into repository
export_records : str, optional
    Create db dump(folder)
    Dump metadata records from repository into directory
gen_sitemap : str, optional
    Sitemap
    Generate XML Sitemap
    Used as: output, file, name
url_csw : str, optional
    Url of CSW
    Execute a CSW request via HTTP POST: URL of CSW
file_xml : str, optional
    XML file
    Execute a CSW request via HTTP POST: XML FILE
    Used as: input, file, name
flags : str, optional
    Allowed values: r, s, i, o, h, d, f, a
    r
        Load records recursively
        Load records from directory recursively
    s
        Setup database
        Creates repository tables and indexes
    i
        Database indexes
        Rebuild repository database indexes
    o
        Optimize db
        Optimize repository database
    h
        Refresh harvested records
        Optimize repository database
    d
        Delete all records(!!)
        Delete all records without prompting
    f
        Force confirmation
        Force confirmation of task
    a
        Automatic configuration
        Set database according GRASS default and confugure server
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None  
configure : str | io.StringIO, required
    path to configure file (default.cfg)
    Used as: input, file, name
    Default: /var/www/html/pycsw/default.cfg
load_records : str, optional
    Load metadata(folder)
    Loads metadata records from directory into repository
export_records : str, optional
    Create db dump(folder)
    Dump metadata records from repository into directory
gen_sitemap : str, optional
    Sitemap
    Generate XML Sitemap
    Used as: output, file, name
url_csw : str, optional
    Url of CSW
    Execute a CSW request via HTTP POST: URL of CSW
file_xml : str | io.StringIO, optional
    XML file
    Execute a CSW request via HTTP POST: XML FILE
    Used as: input, file, name
flags : str, optional
    Allowed values: r, s, i, o, h, d, f, a
    r
        Load records recursively
        Load records from directory recursively
    s
        Setup database
        Creates repository tables and indexes
    i
        Database indexes
        Rebuild repository database indexes
    o
        Optimize db
        Optimize repository database
    h
        Refresh harvested records
        Optimize repository database
    d
        Delete all records(!!)
        Delete all records without prompting
    f
        Force confirmation
        Force confirmation of task
    a
        Automatic configuration
        Set database according GRASS default and confugure server
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None  
Returns:
result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned.
Raises:
grass.tools.ToolError: When the tool ended with an error.
DESCRIPTION
Module db.csw.admin allows to handle csw server.
NOTES
For dependencies and installation instructions see wiki page.
USAGE
For using this module must be installed pycsw libraries. Default path to configure folder is setup to pycsw install folder(LINUX) /var/www/html/pycsw in another case, path to config file must by set by user.
Configure file
In configure file must be setup few parameters for proper work of pycsw library.
- server.home
Path to folder with installed pycsw - database.homez
Path to database with data of catalog. By default is set to SQLite database. E.g GRASS sqlite database. - server.url
For using local serever this parameter should by set to http://localhost:8000/ 
db.csw.harvest source=https://geodati.gov.it/RNDT/csw destination=http://localhost:8000/
SEE ALSO
r.info, v.info.iso, g.gui.metadata, g.gui.cswbrowser, db.csw.harvest, db.csw.run
See also related wiki page.
AUTHOR
Matej Krejci, OSGeoREL at the Czech Technical University in Prague, developed during Google Summer of Code 2015 (mentors: Martin Landa)
SOURCE CODE
Available at: db.csw.admin source code
(history)
Latest change: Saturday Aug 09 10:30:07 2025 in commit 4b03638