Skip to main content
pipen-hostenv

Bring your host environment variables into the jobs of pipen pipelines.


Variables are read when each job is initialized and injected into the job's wrapper script (export VAR='value'), so they are available as $VAR in script and to any process the job starts. The pipen process itself is not modified.

Installing the plugin is all it takes — pipen loads it through its pipen entry point.

Installation

pip install pipen-hostenv

Usage

By default ./.env, relative to the directory pipen is run from, is loaded for every job:

from pipen import Proc, run

class P1(Proc):
    input = "name:var"
    output = "o:file:{{in.name}}.txt"
    script = "echo ${{in.name}} > {{out.o}}"

run("MyPipeline", starts=P1, data=["VAR"])  # $VAR comes from ./.env

Custom env file

Per process:

class P1(Proc):
    plugin_opts = {"hostenv_file": "./envfile"}

Or for the whole pipeline:

run("MyPipeline", starts=P1, data=["VAR"], plugin_opts={"hostenv_file": "./envfile"})

Passing values directly

run(
    "MyPipeline",
    starts=P1,
    data=["VAR"],
    plugin_opts={"hostenv_values": {"VAR": "green grass"}},
)

Options

Option Default Description
hostenv_file ./.env Path to a dotenv file. Resolved against the working directory of the pipen process and silently skipped when it is missing. Set it to a falsy value to disable file loading.
hostenv_values {} Mapping of environment variables to pass to the jobs directly.

Precedence

For a given job, lowest to highest:

  1. job.envs of the process
  2. Entries read from hostenv_file
  3. Entries from hostenv_values

plugin_opts are merged per process on top of the pipeline configuration, so options set on a Proc class win over those passed to run()/Pipen(). The merge is shallow — a process-level hostenv_values replaces the pipeline-level one entirely rather than merging key by key.

Notes

  • A pipeline-level env file applies to every process; override it for a single process with process-level plugin_opts.
  • Only shell variables ($VAR) are populated. The values are not available as template variables at script rendering time ({{ envs.VAR }} renders empty).

Metadata

Release files for pipen-hostenv 0.0.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 pipen-hostenv 0.0.1
File Size Uploaded
pipen_hostenv-0.0.1.tar.gz 257.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipen-hostenv 0.0.1
File Interpreter ABI Platform
pipen_hostenv-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 260.7 kB

Release files / pipen_hostenv-0.0.1.tar.gz

Download URL pipen_hostenv-0.0.1.tar.gz
Size 257.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e8580cf8a5d8bd7b8a3bc24a46bc70628cf686098485c8181b038d5e60fda927
BLAKE2b-256 checksum
How to use checksums
efb6b16394425465e6d6f141fb5aad0a1bdc6a6a9e8ab6e85a4da271c0bc0edb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pipen_hostenv-0.0.1-py3-none-any.whl

Download URL pipen_hostenv-0.0.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28b26102708255487de43b502bb2ae32cffe332ab8e9372e6c81d45a34c4ccbb
BLAKE2b-256 checksum
How to use checksums
58a11b0eb81bb9e905c1192756c91d16409f9770ccabea08fc1fa3a094eeb3fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.1 This release

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