Skip to main content

juniper-config-tools

Stdlib-only config helpers for the Juniper ML platform.

This package is the single source of truth for the env-var alias-with-deprecation helper that has been independently re-implemented across:

  • juniper-cascor (CFG-03, CFG-05) — as pydantic @field_validators
  • juniper-canopy (CFG-04, CFG-16) — as pydantic @field_validators
  • juniper-cascor-worker (CFG-06, in flight) — as a standalone helper

The fourth repo's CFG-06 design surfaced the pattern as worth lifting. Cascor-worker's strict "no Pydantic at runtime" invariant (pinned by tests/test_no_pydantic_at_runtime.py, juniper-ml#168) ruled out juniper-observability (which requires pydantic>=2.0), so this package exists with a stdlib-only dependency policy.

This work mirrors the juniper-doc-tools PyPI migration plan (2026-05-18 doc-link validator incident) and the juniper-ci-tools PyPI migration plan (2026-05-20 dep-docs generator divergence).

The full design and rollout plan lives at notes/JUNIPER_2026-05-22_JUNIPER-ML_CONFIG-TOOLS-PYPI-MIGRATION-PLAN.md in the juniper-ml repo.

Installation

pip install juniper-config-tools

Runtime dependencies: none (stdlib only — os, warnings).

Quick start

from juniper_config_tools import env_with_legacy_alias

# Canonical name first; legacy alias triggers a DeprecationWarning when
# used.
server_url = env_with_legacy_alias(
    "JUNIPER_CASCOR_WORKER_SERVER_URL",  # new canonical name
    "CASCOR_SERVER_URL",                  # legacy alias (deprecated)
    default="",                           # returned if neither is set
)

Behaviour:

env state returns warning?
JUNIPER_CASCOR_WORKER_SERVER_URL set its value none
only CASCOR_SERVER_URL set its value one DepW
both set JUNIPER_CASCOR_WORKER_SERVER_URL val none
neither set "" (the default) none

The DeprecationWarning text names both env-var names so operators can mechanically fix configuration. The warning is emitted with stacklevel=2 so the warning's reported location is the caller's, not this package's internals.

API

env_with_legacy_alias(new_name, legacy_name=None, default=None)

Parameter Type Default Meaning
new_name str required Canonical env-var name. Always checked first.
legacy_name str | None None Optional legacy alias. Pass None to disable.
default str | None None Value when neither env var is set.

Returns str | None.

Why a separate package?

This package exists because juniper-cascor-worker cannot adopt juniper-observability (which requires pydantic) without breaking its load-bearing no-Pydantic-at-runtime invariant.

For consumers that already use pydantic-settings (juniper-cascor, juniper-canopy, juniper-data), this package is not a replacement — the pydantic field-validator pattern in their Settings classes is the right shape there. This package serves the constrained-runtime case.

Versioning

juniper-config-tools follows Semantic Versioning. Public API surface in 0.1.0 is a single function: env_with_legacy_alias. Consumers pin with juniper-config-tools>=0.1.0,<0.2.0 to opt out of future API growth that may add new functions without breaking changes.

License

MIT — see LICENSE.

Metadata

Release files for juniper-config-tools 0.1.1

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

Source distribution (sdist)

Source distribution for juniper-config-tools 0.1.1
File Size Uploaded Provenance Actions
juniper_config_tools-0.1.1.tar.gz 8.5 kB With provenance Details for juniper_config_tools-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for juniper-config-tools 0.1.1
File Interpreter ABI Platform Actions
juniper_config_tools-0.1.1-py3-none-any.whl Python 3 none any Details for juniper_config_tools-0.1.1-py3-none-any.whl

Total release size: 16.1 kB

Release files / juniper_config_tools-0.1.1.tar.gz

Download URL juniper_config_tools-0.1.1.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c7e377beb9c668dc81e3dcebeb48f6ae5955f589dfed96ada6c785606d52410f
BLAKE2b-256 checksum
How to use checksums
6a262995a102bbe527e797eb96ed04809b199fcf0bcabdb343d49ef1d0896ee3
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 Nov 4, 2026.

Transparency log

Release files / juniper_config_tools-0.1.1-py3-none-any.whl

Download URL juniper_config_tools-0.1.1-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a50a926ab792475bedb4f5efbd07701270fbdaefb52d7dbc84199dade6b7a76a
BLAKE2b-256 checksum
How to use checksums
34558f63ee95237243ce9615f343149c9aa1ac26fc8d64895dc03012bfad1332
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 Nov 4, 2026.

Transparency log

Security for juniper-config-tools 0.1.1

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 juniper_config_tools-0.1.1.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 Nov 4, 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

0.1.1 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