Skip to main content

agnue-push

CLI and Python SDK for uploading sensor data to the AgNUE platform.

Step-by-step guide (install, configure, first upload, scheduling with cron or Windows Task Scheduler, troubleshooting): Automatic uploads with agnue-push.

Installation

pip install agnue-push

Configuration

When your site is approved, you receive an agnue.toml file by email. Place it in the directory you run agnue from — the SDK reads ./agnue.toml, or pass --config PATH.

You can also configure via environment variables: AGNUE_PLATFORM_URL, AGNUE_CLIENT_ID, AGNUE_CLIENT_SECRET, and optionally AGNUE_KEYCLOAK_URL (defaults to <platform origin>/realms/agnue) and AGNUE_S3_*. Precedence: CLI flags / explicit args > env vars > agnue.toml.

CLI

# Upload a single file
agnue upload data.csv --data-source DK-Foo-SOIL-001

# Upload a directory
agnue upload ./sensor-exports/ --data-source DK-Foo-SOIL-001

# Upload with glob, excluding backups
agnue upload "*.csv" --data-source DK-Foo-SOIL-001 --exclude "*_backup*"

# Several patterns; a leading ! excludes (single-quote it in bash)
agnue upload "*.csv" "*.txt" '!*.locked' --data-source DK-Foo-SOIL-001

# Scheduled runs: send everything, delete what arrived, retry the rest next run
agnue upload "*.dat" '!*.locked' --data-source DK-Foo-SOIL-001 --delete-after-upload

The --data-source ID follows the format CC-SSS-DOMAIN-SEQ (e.g. DK-Foo-SOIL-001).

Compression: text files (.csv, .txt, .dat, .tsv, .json) are gzip-compressed before upload; the platform keeps the original content. Pass --no-compress (or upload(..., compress=False)) to send files as-is.

Deleting after upload: pass --delete-after-upload (or upload(..., delete_after_upload=True)) to delete each local file once the platform or S3 confirms it has it. A file that changed after it was read or can't be deleted is kept and reported, but a write landing in the instant before deletion is lost, so leave out the file the logger is still writing to ('!*.locked', or have the logger start a new file e.g. every 30 minutes and exclude the current one); a file only queued locally in agnue-staging/ is kept too. Run the same command again later and those are sent (or recognised) and deleted then.

Fallback behaviour: if the platform API is unreachable after 3 attempts, files are uploaded directly to S3 only if the resolved S3 settings are complete (from the [s3] block, AGNUE_S3_* env vars or --s3-* flags), otherwise copied to a local agnue-staging/ folder. In both cases upload() returns None.

Registering data sources (for AI agents)

agnue sources registers data sources from JSON spec files, with the site client in agnue.toml. It is built for coding agents; agnue skill --install installs the instructions for Claude Code (agnue skill prints them).

agnue sources list                                 # this site's sources and status
agnue sources template --data-type LAB_ANALYSIS > specs/nitrate.json
agnue sources validate specs/*.json                # server dry run, nothing saved
agnue sources register specs/*.json                # writes the assigned ID into each spec
agnue domains | badm-variables nitrate | locations | credentials list
agnue api GET api/v1/data-sources/domains          # any endpoint, authenticated

Output is JSON. A failed spec doesn't stop the rest; the exit code is 1 if any failed. Registration stops at DRAFT: an operator approves the schema. These commands are never loaded by agnue upload.

Python API

from agnue_push import AgNUEClient

client = AgNUEClient.from_config()  # reads ./agnue.toml or env vars
# client = AgNUEClient.from_config("/path/to/agnue.toml")

# Upload a file — returns ingestion_id, or None after the direct-S3 or local-staging fallback
ingestion_id = client.upload("data.csv", data_source_id="DK-Foo-SOIL-001")

# Re-uploading the same file is safe: the platform recognises it and returns the original ingestion_id

Pass explicit config instead of a file:

client = AgNUEClient.from_config(
    platform_url="https://nuedata.eu",
    client_id="site-DK-Foo",
    client_secret="...",
)

Changelog

Unreleased

Added

  • agnue sources template | validate | register | list: register data sources from JSON spec files, meant for AI coding agents. validate is a server dry run; register uploads the sample (or stores the ZentraCloud credential), sends an optional help request, and writes the assigned ID back into the spec so re-runs are safe. Needs a platform that assigns data source IDs (domain in the create request).
  • Lookups agnue domains, agnue badm-variables, agnue locations, agnue credentials list, and agnue api METHOD PATH [--data @body.json] for any other endpoint.
  • agnue skill [--install] prints the agent instructions shipped in the package, or installs them to ~/.claude/skills/agnue-cli/SKILL.md.
  • --delete-after-upload / upload(..., delete_after_upload=True) deletes the local file once the platform or S3 confirms it has it. Never deletes a file that was only queued locally, or one seen to change after it was read. A write in the instant before deletion is not caught, so exclude files the logger is still writing to.
  • agnue upload --config PATH reads a config file other than ./agnue.toml, like the sources commands.
  • agnue upload takes several paths or patterns; a pattern starting with ! excludes matching files (same as --exclude). A file matched by more than one pattern is sent once.

0.4.0

Breaking

  • Removed Parquet conversion and the convert argument of upload(). It guessed each file's layout and could change values (headerless files lost their first row, some files failed to upload). Files are now sent exactly as they are. --no-convert and pip install 'agnue-push[convert]' still work but do nothing.
  • Requires a platform that accepts compressed uploads (rolled out before this release).

Added

  • Text files (.csv, .txt, .dat, .tsv, .json) are gzip-compressed before upload, typically 4–25× smaller. The platform stores the original content. Turn it off with --no-compress or upload(..., compress=False).

0.3.0

Breaking

  • Removed AgNUEClient.verify_upload() and AgNUEClient.list_uploads(). They could only see files sent through the direct-S3 fallback, not files sent through the platform. To check whether a file arrived, upload it again: the platform recognises it and returns the original ingestion ID.

Metadata

Release files for agnue-push 0.5.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 agnue-push 0.5.0
File Size Uploaded Provenance
agnue_push-0.5.0.tar.gz 43.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agnue-push 0.5.0
File Interpreter ABI Platform
agnue_push-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.9 kB

Release files / agnue_push-0.5.0.tar.gz

Download URL agnue_push-0.5.0.tar.gz
Size 43.8 kB
Tags Source
SHA-256 checksum
How to use checksums
450741dc9b415d3d65e2a7abc3a35c4f20c771a1508c6e347ef36aac03466db1
BLAKE2b-256 checksum
How to use checksums
098269cf07629295ffcd97bc9a70229006929467f59b5661178ca6e3cb96fd97
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 Oct 22, 2026.

Transparency log

Release files / agnue_push-0.5.0-py3-none-any.whl

Download URL agnue_push-0.5.0-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4da4f98175790ef21f4d710895b2ed19c10a03166a22eee7de85a815492bab1
BLAKE2b-256 checksum
How to use checksums
7cc5f9dea6054414b25b32a8939849f4f291f1450e89cd557471ff52e7fff7b6
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 Oct 22, 2026.

Transparency log

Security for agnue-push 0.5.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 agnue_push-0.5.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 Oct 22, 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