EnvKit
A lightweight, strongly‑typed environment variable parser focused on explicit configuration and predictable behavior, inspired by environs.
- Zero runtime dependencies, requires Python 3.12+
- Precise return types via overloads: no
| Nonewhen a variable is required or has a default - Runtime validation: length and range bounds, enum membership, literal choices
- Ships
py.typed, checked with mypy (strict), basedpyright, ty, and pyrefly
Installation
pip install envkit
Usage
from enum import Enum
from envkit import Env
class LogLevel(Enum):
DEBUG = 1
INFO = 2
WARNING = 3
# Required string with minimum length (returns str)
api_key = Env.str("API_KEY", min_length=32)
# Optional integer with default and range (returns int)
port = Env.int("PORT", required=False, default=8080, min_value=1, max_value=65535)
# Boolean with default (returns bool)
debug = Env.bool("DEBUG", required=False, default=False)
# Enum parsing by member name (returns LogLevel)
log_level = Env.enum("LOG_LEVEL", LogLevel, required=False, default=LogLevel.INFO)
# Optional without default (returns str | None)
hostname = Env.str("HOSTNAME", required=False)
Behavior
- A missing required variable raises
KeyError. - A value that fails to parse or validate raises
ValueError. - An unset variable with
required=Falsereturnsdefault(Noneif no default is given). An empty string counts as set. int,float,bool, andenumvalues are stripped of surrounding whitespace before parsing.
Metadata
Release files for envkit 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| envkit-0.7.1.tar.gz | 4.9 kB | Without provenance | Details for envkit-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| envkit-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for envkit-0.7.1-py3-none-any.whl |
Total release size: 10.5 kB
Release files / envkit-0.7.1.tar.gz
| Download URL | envkit-0.7.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
842f774037259664c5c08692c40fad5f39d99b3223cf5feeec9c1f940bee8cb4
|
|
BLAKE2b-256 checksum How to use checksums |
f65d7329f92ffc3b88b2b35e11b30042ed650050025b67cc78a04e7eaeb0da5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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 / envkit-0.7.1-py3-none-any.whl
| Download URL | envkit-0.7.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
add310ba0f5dcdc7584b54c2ff569de9655b6167c07cc4d6a1f94e5383f8d124
|
|
BLAKE2b-256 checksum How to use checksums |
3b17d5eb170a54c0548f99230f6723875a70e308b12482b7fde4d8dccd02d253
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}
|
Security for envkit 0.7.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.