Skip to main content

youvegotdata

Uses RabbitMQ to send new file notifications, with the ultimate purpose of getting the file metadata into the Data Inventory Database.

The "producer" youvegotdata.py will usually be called by the CIRA data ingest scripts when a new file is added to the CIRA data stores, and will send a message through RabbitMQ to the consumers with the file's metadata.

Message "consumers" will be running to receive the file metadata and insert it into the database. It is expected that multiple consumers process will be accepting messages in RabbitMQ's "fair dispatch" configuration. A given notification will be received by one consumer.

Installing youvegotdata

This module requires Python 3.8 or greater. It is deployed to PyPi, so it can be installed with:

pip install youvegotdata

Which will install the ygd CLI command in your current Python environment.

Library usage

youvegotdata is also importable as a plain Python package so that ingest scripts can send notifications programmatically instead of shelling out to the ygd CLI. The public API is re-exported from the top-level package:

from youvegotdata import (
    Config,
    ConfigError,
    Notification,
    load_config,
    resolve_data_store,
    send_notification,
)

Loading configuration

load_config() reads and validates ~/.config/youvegotdata/config.ini (the same file the CLI uses) and returns a frozen Config dataclass. Validation errors raise ConfigError:

try:
    config = load_config()
except ConfigError as exc:
    print(f"configuration problem: {exc}")
    raise

To point at a specific file (e.g. for tests), pass an explicit path:

config = load_config("/path/to/config.ini")

The returned Config exposes rmq_host (str) and ceph_ips (dict[str, list[str]]).

Resolving a data store from a filepath

resolve_data_store maps a local path to its data store name and a store-relative path. It reads /proc/self/mountinfo, so it only works on Linux:

data_store, store_path = resolve_data_store("/data/file.hdf", config.ceph_ips)

Sending a notification

Build a Notification and pass it (plus a Config) to send_notification. It publishes one durable JSON message to the file_notif_queue queue and returns True on success or False if the data store could not be resolved. RabbitMQ errors are logged and re-raised as pika.exceptions.AMQPError:

notification = Notification(
    filepath="/data/file.hdf",
    product="L2_VIS",
    version="1.0",
    start_time="2024-01-01T00:00:00",
    end_time="2024-01-01T01:00:00",
    size=1024,
    checksum="abc123",
    platform_name="VIIRS",
    source_name="imager",
    addl_metadata={
        "geoips_variables": {
            "variables": ["red", "green", "blue"],
            "SSP_spatial_resolution": "0.02 km",
        }
    },
)
send_notification(notification, config)

Only filepath is required; the rest default to None. The checksum must be an xxhash value if it is included.

Backward compatibility

The v1.x function produce_notification(config, filepath, ...) is kept as a deprecated shim that emits a DeprecationWarning and forwards to send_notification. It still accepts a raw configparser.ConfigParser or a Config. New code should use send_notification instead.

Running youvegotdata.py as ygd

Create the ~/.config/youvegotdata/ directory if it does not already exist. Create a config.ini file in this directory that looks like:

[Settings]
RMQ_HOST = <host of the RabbitMQ server>

[Data-store-mappings]
# The list of common Ceph IPs for every Ceph data store
# A dictionary of lists. This must be valid JSON: double quotes, no trailing commas.
CEPH_IPS = {"name": ["IP", "IP", "IP"], "name2": ["IP", "IP", "IP"]}

And fill it in with the RabbitMQ server's host name, and the IP address mappings across different Linux versions for the Ceph data stores.

Run the code with:

ygd [-h] [-v] [-p PRODUCT] [-r VERSION] [-s START_TIME] [-e END_TIME] [-l LENGTH] [-c CHECKSUM] [-t PLATFORM_NAME] [-o SOURCE_NAME] [-a ADDL_METADATA] filepath

Run this with the -h (--help) argument to see the available flagged arguments.

This will usually be run with just the filepath argument. An example is:

ygd /full/path/to/local/file/data_file.hdf

The filepath file must exist on the local machine.

Metadata

Release files for youvegotdata 2.1.0

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

Source distribution (sdist)

Source distribution for youvegotdata 2.1.0
File Size Uploaded Provenance Actions
youvegotdata-2.1.0.tar.gz 22.8 kB With provenance Details for youvegotdata-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for youvegotdata 2.1.0
File Interpreter ABI Platform Actions
youvegotdata-2.1.0-py3-none-any.whl Python 3 none any Details for youvegotdata-2.1.0-py3-none-any.whl

Total release size: 38.4 kB

Release files / youvegotdata-2.1.0.tar.gz

Download URL youvegotdata-2.1.0.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f0d8d8f33084b3ed903be04cc6c740620143b66429a4ec5fcea1354892799678
BLAKE2b-256 checksum
How to use checksums
63794a4f911a198bc54cdbae12f9873f9a1d38396093463ed9f568369a9f6e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 14, 2026.

Transparency log

Release files / youvegotdata-2.1.0-py3-none-any.whl

Download URL youvegotdata-2.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
221120ec0b77e667197d2b1c4afdcc1f4aa7fc1cfd3cb44836a379d43a2ed7e5
BLAKE2b-256 checksum
How to use checksums
91af95d36e89664d2fbe96df729185d35e55f1e6dba26ae3bfa64e9a930a7711
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 14, 2026.

Transparency log

Security for youvegotdata 2.1.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for youvegotdata-2.1.0.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 Aug 14, 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.

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