Skip to main content

Hetman Kit Environment is a developer-centric environment variable manager. It leverages the Hetman Pipeline engine to treat environment variables not just as strings, but as strictly validated and transformed data structures.

Project description

Hetman Logo

Hetman Kit Environment is a developer-centric environment variable manager. It leverages the Hetman Pipeline engine to treat environment variables not just as strings, but as strictly validated and transformed data structures.

Installation

pip install hetman-kit-env

Why use this?

Standard os.environ.get returns strings and provides no validation. Hetman Kit Environment allows you to:

  1. Validate length, patterns, and types immediately.
  2. Transform values (lowercase, strip, cast) during retrieval.
  3. Parse JSON structures stored in environment strings automatically.
  4. Enforce existence for missing variables.

Usage Example

from hetman_kit_env import EnvironmentVariable
from pipeline import Condition, Match, Transform

# Set the path for your .env file
EnvironmentVariable.dotenv_path = ".env"

# Define a validated environment variable
# This will raise an exception if the key is missing or validation fails
SECRET_KEY = EnvironmentVariable[str](
    name="SECRET_KEY",
    type=str,
    conditions={
        Condition.ExactLength: 32
    },
    matches={
        Match.Text.Letters: None
    },
    transform={
        Transform.Lowercase: None
    }
)

# Access the processed value
print(SECRET_KEY.get)

Core Features

  • Strict Typing: Use Python generics EnvironmentVariable[T] for better IDE support and type safety.
  • JSON Ready: Built-in json.loads support for complex environment configurations.
  • Pipeline Integration: Full access to the Pipeline execution flow (Type Check -> Setup -> Conditions -> Matches -> Transformations).
  • Singleton .env Loading: The .env file is loaded once and shared across all instances.

Documentation

This package uses the Hetman Pipeline logic for its core processing. To learn more about available conditions, matches, and transformations, visit Official Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hetman_kit_env-0.1.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hetman_kit_env-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file hetman_kit_env-0.1.1.tar.gz.

File metadata

  • Download URL: hetman_kit_env-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hetman_kit_env-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3592a2b79982e8444ec755d3ba33771d32f4a95e12612d0809929d063b9b6c43
MD5 889a624a9491258f334d8ac20e31afdd
BLAKE2b-256 fb2cab1afc39c36bcf901b119621e3c6e5a376bcacab948b5e8de24627b2c3ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for hetman_kit_env-0.1.1.tar.gz:

Publisher: python-publish.yml on hetman-app/hetman-kit-env

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hetman_kit_env-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hetman_kit_env-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hetman_kit_env-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aace7b47afa201ce26d0c06ae3854b92c84319ff85a68ff03772d681a9a5b920
MD5 e1f7534369caef37ce328a403cb101d2
BLAKE2b-256 9d31fa7a0ab37e3f8628f739c48360e625be6232a325e5b584a07ba2f897cf95

See more details on using hashes here.

Provenance

The following attestation bundles were made for hetman_kit_env-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on hetman-app/hetman-kit-env

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page