Skip to content

API

A pyrig plugin that manages a project's .env file.

rig

Integration namespace exposing this plugin's contributions to pyrig.

Mirrors pyrig's own rig layout, the shared convention this plugin's contributions must follow to be usable by pyrig's tooling.

configs

This plugin's config-file contributions to pyrig.

pyrig discovers these during pyrig sync and generates or updates the corresponding files in projects that install the plugin.

env

Configuration for the target project's .env file.

EnvConfigFile

Bases: DictConfigFile

Config file manager for the target project's .env file.

Only ever creates an empty .env file when one is missing; its content is never read or overwritten afterward, so users are free to populate and maintain secrets and local environment variables by hand. Excluded from version control so those secrets are never committed.

extension
extension() -> str

Return "", since .env has no extension.

Source code in src/pyrig_env/rig/configs/env.py
def extension(self) -> str:
    """Return `""`, since `.env` has no extension."""
    return ""
extension_separator
extension_separator() -> str

Return "", so the stem is not followed by a trailing dot.

Source code in src/pyrig_env/rig/configs/env.py
def extension_separator(self) -> str:
    """Return `""`, so the stem is not followed by a trailing dot."""
    return ""
is_correct
is_correct() -> bool

Return whether .env exists, without loading its content.

Source code in src/pyrig_env/rig/configs/env.py
def is_correct(self) -> bool:
    """Return whether `.env` exists, without loading its content."""
    return self.path().exists()
parent_path
parent_path() -> Path

Return the project root as the parent directory.

Source code in src/pyrig_env/rig/configs/env.py
def parent_path(self) -> Path:
    """Return the project root as the parent directory."""
    return Path()
stem
stem() -> str

Return ".env".

Source code in src/pyrig_env/rig/configs/env.py
def stem(self) -> str:
    """Return `".env"`."""
    return ".env"
version_control_ignored
version_control_ignored() -> bool

Return True; .env is always excluded from version control.

Source code in src/pyrig_env/rig/configs/env.py
def version_control_ignored(self) -> bool:
    """Return `True`; `.env` is always excluded from version control."""
    return True