RDA Python package for utility program dsarch archive RDA data
Project description
dsarch
Python project to archive and maintain datasets for the NSF NCAR Geoscience Data Exchange (GDEX).
The user guide for this utility tool can be viewed at: User guide.
Code overview
The package is built around three Python modules in src/rda_python_dsarch/:
-
dsarch.py— Command-line entry point. DefinesDsArch, the action class that inherits fromPgArchandPgMeta. Its two driver methodsread_parameters()andstart_actions()parse the CLI and dispatch to the matching handler (archive, get, set, move, delete, restore) for web, saved, help, and Quasar-backup files, plus dataset, group, and version metadata. After the primary action, it also performs cross-cutting follow-up: dataset period updates, file-count resets (-WN/-WM/-RT), final logging, and optional email notification. -
pg_arch.py— Shared state and helpers. Defines thePgArchmixin (extendsPgOPT,PgCMD,PgSplitfromrda_python_common). Holds the masterOPTStable that maps short action codes (e.g.AW,GD,SG,RQ) to their bit flags, names, and write-mode levels; the runtime path cache (RTPATH,webpaths,savedpaths); and group-type/display-order caches. Provides the utility methods used across all actions: SQL condition building, path resolution, file-name validation, and dataset/ group metadata caching. -
pg_meta.py— File-count bookkeeping and metadata-XML queueing. Defines thePgMetamixin (extendsPgCMD,PgSplit). Tracks pending changes to per-dataset/per-group file counts inGCOUNTS(a 13-slot array covering MSS, web-D/N, and saved buckets) and flushes them to RDADB in batch. MaintainsMETA, a queue of metadata operations dispatched to the external toolsgatherxml,dcm,rcm,scm, andsml. Also providesswitch_logfile()for redirecting per-action log/error output.
The inheritance chain is DsArch -> PgArch -> PgMeta -> PgCMD/PgSplit, so
DsArch instances expose every option, path, count, and database helper
through a single object.
Setuid Setup
dsarch is executed as the common user gdexdata via the rda_python_setuid
setuid mechanism. rda_python_setuid is declared as a dependency and is
installed automatically with this package.
Environment setup
Option A — Python venv (DECS machines)
python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
source $ENVHOME/bin/activate
pip install rda_python_dsarch
Option B — Conda (DAV/Casper)
conda activate pg-gdex # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
pip install rda_python_dsarch
Full setuid install (requires sudo access to gdexdata)
Run these steps once per environment after pip install:
# Compile the pywrapper C binary (once per environment):
pywrapper-install -c|--compile -u|--user gdexdata
# Wire up dsarch as a setuid entry:
pywrapper-install -l|--link dsarch -u|--user gdexdata
pywrapper-install with no arguments displays the full user guide.
Simple install (no sudo required, runs as current user)
Users who do not need the setuid mechanism can create a direct symlink instead:
pywrapper-install -l|--link dsarch -s|--simple
This creates bin/dsarch -> bin/setuid_dsarch and the program runs as the
current user with no privilege change.
Setup guide
After pip install, run dsarch-setup at any time to display the setup guide:
dsarch-setup
The guide is also shown automatically if setuid_dsarch is invoked directly
before the setuid wrapper has been configured.
Documentation sync
The user guide rendered at
gdex-docs-dsarch.readthedocs.io is
generated from src/rda_python_dsarch/dsarch.usg in this repository. When a
pull request that modifies dsarch.usg is merged here, an automated workflow
converts the updated dsarch.usg into the RST-format source files in the
gdex-docs-dsarch repository and
opens a pull request there with the regenerated docs, ready for review and
merge. No manual RST editing is required — keep all user-facing content in
dsarch.usg and let the sync produce the docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rda_python_dsarch-2.0.21.tar.gz.
File metadata
- Download URL: rda_python_dsarch-2.0.21.tar.gz
- Upload date:
- Size: 146.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14eba804f0222f9854c7a7d88ef4b77fe99a0bbb16f8be30e6a4a433faa90f21
|
|
| MD5 |
2fd545bf98e8bdbcef98b57de3098b00
|
|
| BLAKE2b-256 |
faf5302ca852628f9a3996a770bb597f26dc5745a25915041dbd6a125c209e88
|
Provenance
The following attestation bundles were made for rda_python_dsarch-2.0.21.tar.gz:
Publisher:
publish.yml on NCAR/rda-python-dsarch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rda_python_dsarch-2.0.21.tar.gz -
Subject digest:
14eba804f0222f9854c7a7d88ef4b77fe99a0bbb16f8be30e6a4a433faa90f21 - Sigstore transparency entry: 1549562448
- Sigstore integration time:
-
Permalink:
NCAR/rda-python-dsarch@6b30c6e6e946da814b512fa00fce4555e5cf8e53 -
Branch / Tag:
refs/tags/v2.0.21 - Owner: https://github.com/NCAR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6b30c6e6e946da814b512fa00fce4555e5cf8e53 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rda_python_dsarch-2.0.21-py3-none-any.whl.
File metadata
- Download URL: rda_python_dsarch-2.0.21-py3-none-any.whl
- Upload date:
- Size: 150.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f566a40057553735fd9158ddf6419f981bb15e3e9e7551d8048a66760c20e2f
|
|
| MD5 |
f498207c28f0dbd4596ca3d3125dd3d7
|
|
| BLAKE2b-256 |
98b83346f7031db01de317ca2d408398188adc5289fb05e51ffc67c54cb64ced
|
Provenance
The following attestation bundles were made for rda_python_dsarch-2.0.21-py3-none-any.whl:
Publisher:
publish.yml on NCAR/rda-python-dsarch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rda_python_dsarch-2.0.21-py3-none-any.whl -
Subject digest:
3f566a40057553735fd9158ddf6419f981bb15e3e9e7551d8048a66760c20e2f - Sigstore transparency entry: 1549562473
- Sigstore integration time:
-
Permalink:
NCAR/rda-python-dsarch@6b30c6e6e946da814b512fa00fce4555e5cf8e53 -
Branch / Tag:
refs/tags/v2.0.21 - Owner: https://github.com/NCAR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6b30c6e6e946da814b512fa00fce4555e5cf8e53 -
Trigger Event:
release
-
Statement type: