Skip to content

Runnable samples

The examples below are also available as scripts in the samples directory. Run them from the repository root or after installing the package. They require a reachable geOrchestra instance and an account permitted to use the requested services.

Each script defines editable SERVER, USERNAME, and PASSWORD constants near the top. Replace the placeholder values with your instance URL and account before running; the metadata-string helper only needs SERVER.

Library examples

  • Console API: reads the configured user by default. --apply creates and deletes temporary test resources. --update-user-description changes the configured user's description.
python samples/console_api_demo.py
python samples/console_api_demo.py --apply
  • Combined client: lists active filesystem harvests and optionally reads a record with --uuid UUID. --assign-harvests changes harvest assignments. --batch-edit edits the selected record and must be used with --uuid.
python samples/georchestra_client_demo.py --uuid UUID
python samples/georchestra_client_demo.py --uuid UUID --batch-edit
  • GeoNetwork API: reads site and thesaurus information by default. --thesaurus-file FILE uploads a thesaurus; --overwrite-metadata FILE overwrites and publishes a record.
python samples/geonetwork_api_demo.py
python samples/geonetwork_api_demo.py --thesaurus-file vocabulary.rdf
  • Metadata thesaurus helper: adds a selected GeoNetwork keyword to an input metadata file and writes to sample_meta3.xml by default. Use --output FILE to choose another destination.
python samples/metadata_thesaurus_demo.py metadata.xml --output updated.xml
python samples/meta_manipulation_demo.py metadata.xml

Remote changes are deliberately opt-in. Review the sample and target instance before using mutation flags, especially --update-user-description, --assign-harvests, --batch-edit, --thesaurus-file, and --overwrite-metadata.

Other command-line tools

These files are standalone utilities, not library demos; their main() entry points remain in place: