envmix
Typed environment loader for Pydantic v2 models.
Features
- Simple:
from_env()fills fields from overrides > env vars > defaults - Typed: ships
py.typed; works nicely with type checkers - Robust casting: JSON-first via TypeAdapter; CSV and k=v fallbacks
Install
pip install envmix
Quick start
from pydantic import BaseModel
from envmix import EnvMixModel
class DB(BaseModel):
host: str
port: int
class Settings(EnvMixModel):
__env_prefix__ = "APP_"
host: str = "127.0.0.1"
port: int = 8080
debug: bool = False
# export APP_PORT=5000 APP_DEBUG=true
s = Settings.from_env()
print(s.port) # 5000
print(s.debug) # True
Custom env key per field
from pydantic import Field
class Settings(EnvMixModel):
server_host: str = Field("0.0.0.0", json_schema_extra={"env": "SERVER_HOST"})
License MIT
Metadata
Release files for envmix 0.1.2
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 |
|---|---|---|---|---|
| envmix-0.1.2.tar.gz | 5.2 kB | Without provenance | Details for envmix-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| envmix-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for envmix-0.1.2-py3-none-any.whl |
Total release size: 11.2 kB
Release files / envmix-0.1.2.tar.gz
| Download URL | envmix-0.1.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c429799fdb929762875b8b9fd8cd0b0b84c17b7156ced57e9b6f2aa5f0a66c4
|
|
BLAKE2b-256 checksum How to use checksums |
6df30f803f6709141ed2f8dd363a6e070a0505f0eaad26ebb441d6b1eca7ca33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / envmix-0.1.2-py3-none-any.whl
| Download URL | envmix-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9402845fb06d4a02b434e393fb7e18b0995dc8f47d613a01cc4a9ba5c3383a4
|
|
BLAKE2b-256 checksum How to use checksums |
e8614ded333aa7ad990ad30de52a6d45b6b1d0c59968212483633c0a1d5f53cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for envmix 0.1.2
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.