PYCSW-ADMIN(1)

πŸ“¦
version 2.6.2 Β· 4 versions
, in debian trixie, ubuntu questing

πŸ’– PYCSW-ADMIN πŸ’–

okay bestie, sit DOWN, because we're about to talk about pycsw-admin, the manual page for the pycsw admin utility πŸŽ€ this is the glow-up era of your geospatial metadata workflow and honestly? it's giving main character.


✨ NAME ✨

pycsw-admin β€” the pycsw admin utility πŸ’… no cap, that's literally it. it does the admin things. it's the utility. iconic behavior.


πŸ¦‹ SYNOPSIS πŸ¦‹

pycsw-admin -c command -f cfg [-h] [-p /path/to/records] [-r]

that's the whole vibe check right there, bestie. you bring a command, you bring a config file, and optionally some paths and the recursive flag 🫢


🌸 OPTIONS 🌸

okay so here's the menu, and the way that every single one of these matters, i can't even.

  • -c β€” the Command to be performed. your options are literally:
    • setup_db
    • load_records
    • export_records
    • rebuild_db_indexes
    • optimize_db
    • refresh_harvested_records
    • gen_sitemap
    • post_xml
    • get_sysprof
    • validate_xml
    • delete_records

pick one, queen. πŸ‘‘

  • -f β€” Filepath to pycsw configuration πŸ—‚οΈ your config file. the blueprint. the lore.
  • -h β€” Usage message πŸ™ˆ when you need the manual to explain the manual.
  • -o β€” path to output file πŸ’Ύ where the goodies go.
  • -p β€” path to input/output directory or file to read/write metadata records πŸ“ read from it, write to it, it's flexible like that.
  • -r β€” load records from directory recursively πŸ” it goes DEEP. it goes into every folder. it leaves no record behind.
  • -s β€” XML Schema πŸ“ for when you need to validate against a schema.
  • -t β€” Timeout (in seconds) for HTTP requests (default is 30) ⏱️ yes bestie, default is 30, don't come for me.
  • -u β€” URL of CSW 🌐 the endpoint. the destination. the place we're POSTing to.
  • -x β€” XML document πŸ“„ your actual XML file.
  • -y β€” force confirmation ⚠️ this one skips the "are you SURE" moment, so lowkey be careful with it, fr fr.

πŸ’œ EXAMPLE πŸ’œ

here's where it gets fun. twelve (12) whole situations. let's go.

1.) setup_db: Creates repository tables and indexes πŸ—οΈ

pycsw-admin -c setup_db -f default.cfg

2.) load_records: Loads metadata records from directory or file into repository πŸ“₯

pycsw-admin -c load_records -p /path/to/records -f default.cfg

Load records from directory recursively πŸ”

pycsw-admin -c load_records -p /path/to/records -f default.cfg -r

Load records from directory and force updates πŸ’ͺ

pycsw-admin -c load_records -p /path/to/records -f default.cfg -y

Load metadata record from file into repository πŸ“„

pycsw-admin -c load_records -p /path/to/file.xml -f default.cfg

3.) export_records: Dump metadata records from repository into directory πŸ“€

pycsw-admin -c export_records -p /path/to/records -f default.cfg

4.) rebuild_db_indexes: Rebuild repository database indexes 🧱

pycsw-admin -c rebuild_db_indexes -f default.cfg

5.) optimize_db: Optimize repository database ✨

pycsw-admin -c optimize_db -f default.cfg

6.) refresh_harvested_records: Refresh repository records which have been harvested 🌾

pycsw-admin -c refresh_harvested_records -f default.cfg

7.) gen_sitemap: Generate XML Sitemap πŸ—ΊοΈ

pycsw-admin -c gen_sitemap -f default.cfg -o /path/to/sitemap.xml

8.) post_xml: Execute a CSW request via HTTP POST πŸ“‘

pycsw-admin -c post_xml -u http://host/csw -x /path/to/request.xml

9.) get_sysprof: Get versions of dependencies πŸ”

pycsw-admin -c get_sysprof

10.) validate_xml: Validate an XML document against an XML Schema βœ…

pycsw-admin -c validate_xml -x file.xml -s file.xsd

11.) delete_records: Deletes all records from repository πŸ’€

pycsw-admin -c delete_records -f default.cfg

12.) delete_records: Deletes all records from repository without prompting πŸ’€πŸ’€

pycsw-admin -c delete_records -f default.cfg -y
not me pointing out that number 12 with the -y skips the prompt entirely β€” it deletes ALL the records with zero confirmation, so please, PLEASE be careful bestie 😭

🌈 MORE INFORMATION 🌈

want more tea about pycsw? you can get it from /usr/share/doc/pycsw-doc after installing the pycsw-doc package πŸ“š go read, it's worth it.


and that's the whole page, babes πŸ’– this was pycsw-admin from the pycsw manual, dated February 2025, and yes the footer said PYCSW-ADMIN(1) again because it loves a callback ✨ slay, you're now officially admin-literate. periodt. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from