Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,38 @@ uvx env-example
# Exclude specific directories relative to the project root
uvx env-example --exclude-dir other/scripts
```

# Example
```python
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:
```shell
# AppSettings
APP__DEBUG=
APP__LOG_LEVEL=

# DatabaseSettings
DB__HOST=
DB__PORT=
DB__USERNAME=
DB__PASSWORD=
```
Loading