Skip to main content

py-juxlib

Shared Python library for the Jux tools ecosystem.

Python 3.11+ License: Apache-2.0

Overview

py-juxlib provides common functionality for Jux client tools:

  • Environment metadata detection - Capture Git, CI/CD, and runtime environment information
  • XML digital signatures - Sign and verify JUnit XML reports using XMLDSig
  • API client - Publish signed reports to Jux OpenAPI servers
  • Configuration management - Multi-source configuration with precedence handling
  • Local storage - Filesystem storage with offline queue support
  • Error handling - User-friendly errors with actionable suggestions

Installation

pip install py-juxlib

Or with uv:

uv pip install py-juxlib

Quick Start

Capture Environment Metadata

from juxlib.metadata import capture_metadata

metadata = capture_metadata()
print(f"Project: {metadata.project_name}")
print(f"Git commit: {metadata.git_commit}")
print(f"CI provider: {metadata.ci_provider}")

Sign a JUnit XML Report

from juxlib.signing import sign_xml, load_private_key
from lxml import etree

# Load your private key
key = load_private_key("~/.ssh/jux/dev-key.pem")

# Parse and sign XML
tree = etree.parse("junit-report.xml")
signed_tree = sign_xml(tree.getroot(), key)

# Write signed XML
with open("junit-report-signed.xml", "wb") as f:
    f.write(etree.tostring(signed_tree, xml_declaration=True, encoding="UTF-8"))

Publish to Jux Server

from juxlib.api import JuxAPIClient

client = JuxAPIClient(
    api_url="https://jux.example.com",
    bearer_token="your-token"
)

with open("junit-report-signed.xml") as f:
    response = client.publish_report(f.read())

print(f"Test run ID: {response.test_run_id}")
print(f"Success rate: {response.success_rate}%")

Documentation

Development

# Clone the repository
git clone https://github.com/jux-tools/py-juxlib.git
cd py-juxlib

# Setup development environment
uv venv && uv pip install -e ".[dev]"

# Run tests
uv run pytest

# Run with coverage
uv run pytest --cov=juxlib --cov-report=term-missing

# Format and lint
uv run ruff format .
uv run ruff check .

# Type check
uv run mypy src/juxlib

API Specification

Source of Truth: The canonical API specifications live in jux-openapi.

  • OpenAPI specs: jux-openapi/specs/v1/
  • API changelog: jux-openapi/docs/CHANGELOG.md

py-juxlib v0.2.0+ is compliant with jux-openapi API v1.0.0.

Project Description
pytest-jux pytest plugin for signing and publishing JUnit XML
behave-jux Enhanced JUnit reporter for behave BDD
jux Server for receiving and analyzing test reports
jux-openapi API contract specification (source of truth)

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

Metadata

Release files for py-juxlib 0.3.3

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

Source distribution (sdist)

Source distribution for py-juxlib 0.3.3
File Size Uploaded
py_juxlib-0.3.3.tar.gz 60.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-juxlib 0.3.3
File Interpreter ABI Platform
py_juxlib-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 106.9 kB

Release files / py_juxlib-0.3.3.tar.gz

Download URL py_juxlib-0.3.3.tar.gz
Size 60.4 kB
Tags Source
SHA-256 checksum
How to use checksums
626d51670caadaf58c32a09741838323d06e79214c18617abaa98ef1bbc13da9
BLAKE2b-256 checksum
How to use checksums
7196609857a42f36726dc532505fe27bec8a626100827f5cfbe7283e9f7ddb43
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 Sep 26, 2026.

Transparency log

Release files / py_juxlib-0.3.3-py3-none-any.whl

Download URL py_juxlib-0.3.3-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e521d114253b7eca937d945b2d46e51222be21e3c8147062653f0fc7f80e38f9
BLAKE2b-256 checksum
How to use checksums
59be6a03453da649690e5a27403363d665604b9497e9334331a3e1b7d24af3fd
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 Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.4

2 release files

This release

0.3.3 This release

2 release files

0.3.1

2 release files

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