Add your description here
Project description
env-example
Creates an .env.example file for your Python monorepo, based on all Pydantic settings classes found in your project. Env-example uses the abstract syntax tree of your project to discover settings instead of runtime introspection, to avoid side effects and having to deal with external project dependencies.
Usage
I recommend to use uvx to run env-example:
# Basic usage
uvx env-example
# Exclude specific directories relative to the project root
uvx env-example --exclude-dir other/scripts
Example
from pydantic import BaseSettings
class AppSettings(BaseSettings):
model_config = {
"env_prefix": "APP__"
}
debug: bool
log_level: str
class DatabaseSettings(BaseSettings):
model_config = {
"env_prefix": "DB__"
}
host: str
port: int
username: str
password: str
env-example will generate the following .env.example file:
# AppSettings
APP__DEBUG=
APP__LOG_LEVEL=
# DatabaseSettings
DB__HOST=
DB__PORT=
DB__USERNAME=
DB__PASSWORD=
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file env_example-0.4.0.tar.gz.
File metadata
- Download URL: env_example-0.4.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
106083ccf45ce43f428bb17f7f32363998e983cc799ccbabd28a11138b743e87
|
|
| MD5 |
12842c61b46c6374a035ff71e0004fd0
|
|
| BLAKE2b-256 |
2e989741be51b2da8ca1c3cf43b1ea0a6ac4f5e60111de6de6b8a686ad124e6f
|
File details
Details for the file env_example-0.4.0-py3-none-any.whl.
File metadata
- Download URL: env_example-0.4.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7eac73e05ed79c4dfac510737337bc505176c093c051e162d327a098d8de944
|
|
| MD5 |
1d8f06e55ce800354f14bb98024685cd
|
|
| BLAKE2b-256 |
20839a21acfb52b9e7274472ad6bc3ed03a1cfde8ef01de19a4b17218803b023
|