Skip to main content

rda_python_metrics

RDA Python package to gather and view data usage metrics for the NSF NCAR Geoscience Data Exchange (GDEX).

Programs

The package provides two categories of programs:

Run as gdexdata via setuid (requires setup below):

Command Connector script Description
logarch setuid_logarch Archive RDA log files (web, TDS, AWS, OSDF, dssdb) to the DECSDATA area

Run as current user (no setuid required):

Command Description
fillawsusage Fill AWS usage metrics into the database
fillcdgusage Fill CDG usage metrics into the database
fillcodusage Fill COD usage metrics into the database
fillcountry Fill country information into the database
fillendtime Fill end times for usage records
fillgdexusage Fill GDEX usage metrics into the database
fillglobususage Fill Globus transfer usage metrics into the database
fillipinfo Fill IP geolocation info into the database
filloneorder Fill metrics for a single order
fillosdfusage Fill OSDF usage metrics into the database
fillrdadb Fill RDA database usage metrics
filltdsusage Fill TDS (THREDDS) usage metrics into the database
fillzenodousage Fill Zenodo usage metrics into the database
viewallusage View combined usage statistics
viewawsusage View AWS usage statistics
viewcheckusage View usage check results
viewcodusage View COD usage statistics
viewordusage View order usage statistics
viewosdfusage View OSDF usage statistics
viewrqstusage View request usage statistics
viewtdsusage View TDS usage statistics
viewwebfile View web file access records
viewwebusage View web usage statistics

Environment setup

Create a Python environment first; package installs in the next section run inside whichever environment you activate here.

Option A — Python venv (DECS machines)

python3 -m venv $ENVHOME          # e.g. /glade/u/home/gdexdata/gdexmsenv
source $ENVHOME/bin/activate

Option B — Conda (DAV/Casper)

conda create --prefix $ENVHOME python=3.12   # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
conda activate $ENVHOME

Installing rda-python-metrics

Pick whichever install mode fits your workflow. All four pull in the transitive dependencies (rda_python_common, rda_python_setuid, geoip2, ipinfo, httplib2, dnspython, unidecode, urllib3>=2.5.0, requests>=2.33.0, idna>=3.10) automatically.

For local development, clone this repo alongside your project and install it in editable mode so that changes are picked up without re-installing:

git clone https://github.com/NCAR/rda-python-metrics.git
cd rda-python-metrics
pip install -e .

To test a specific branch (e.g. an in-progress feature or fix branch), pass -b/--branch to git clone:

git clone -b <branch-name> https://github.com/NCAR/rda-python-metrics.git
cd rda-python-metrics
pip install -e .

For a regular (non-editable) install from a checkout:

pip install /path/to/rda-python-metrics

For a production install on a system that uses the published distribution:

pip install rda_python_metrics

Setuid Setup

logarch runs as the common user PGLOG['COMMONUSER'] (default gdexdata) via the rda_python_setuid mechanism, which is pulled in automatically as a dependency. After pip install above, choose one of the wiring options below.

Note: If rda_python_setuid is already installed and fully set up in your environment, you can skip the compile step (-c/--compile) and the optional pgstart step (-p/--pgstart). The -l/--link step is still required to wire up this package's own setuid program.

Full setuid install (requires sudo access to COMMONUSER)

Run these steps once per environment:

# 1. Compile the pywrapper C binary (once per environment):
pywrapper-install -c|--compile -n|--username gdexdata

# 2. Wire up logarch as a setuid entry (or use 'all' to link every setuid_* at once):
pywrapper-install -l|--link logarch
pywrapper-install -l|--link all

# 3. Optionally, install a pgstart_<loginname> binary so <loginname> (any
#    user in the same group as PGLOG['COMMONUSER']) can run commands as
#    themselves.  Run either by PGLOG['ADMINUSER'] (default zji, if it has
#    'sudo -u <loginname>'), or by <loginname> directly:
pywrapper-install -p|--pgstart -n|--username <loginname>

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 logarch -s|--simple
pywrapper-install -l|--link all -s|--simple   # or link every setuid_* at once

This creates bin/logarch -> bin/setuid_logarch and logarch runs as the current user with no privilege change.

Update an existing installation (no sudo required)

When the package is upgraded and a new pywrapper.c is bundled, recompile and reinstall all setuid binaries using the existing pgstart_* binaries:

pywrapper-install -u|--update

Setup guide

The shared setuid setup guide is shown automatically if setuid_logarch is invoked directly before the setuid wrapper has been configured.

Metadata

Release files for rda-python-metrics 3.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rda-python-metrics 3.0.11
File Size Uploaded Provenance Actions
rda_python_metrics-3.0.11.tar.gz 126.2 kB With provenance Details for rda_python_metrics-3.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rda-python-metrics 3.0.11
File Interpreter ABI Platform Actions
rda_python_metrics-3.0.11-py3-none-any.whl Python 3 none any Details for rda_python_metrics-3.0.11-py3-none-any.whl

Total release size: 364.8 kB

Release files / rda_python_metrics-3.0.11.tar.gz

Download URL rda_python_metrics-3.0.11.tar.gz
Size 126.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40c20b4b2279ecd126bcc1e7f0b129cd2534346f1caf55a5b3e0fd323e174415
BLAKE2b-256 checksum
How to use checksums
a91e12607bfdc40192dc40699384a818bc36ce156f3219b6d3ac9c6cb3545705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / rda_python_metrics-3.0.11-py3-none-any.whl

Download URL rda_python_metrics-3.0.11-py3-none-any.whl
Size 238.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b7fcd4b024431c53948424b6e3354f1529dcad0851700d27dae5851cf22f173
BLAKE2b-256 checksum
How to use checksums
88db2a46a839021227bb098a82adc3d4dd11bea454b6e70c2af0eecc53eace60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for rda-python-metrics 3.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rda_python_metrics-3.0.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.0.11 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page