Metadata-Version: 2.3
Name: env-example
Version: 1.0.0
Summary: Add your description here
Author: Jochem Loedeman
Author-email: Jochem Loedeman <60843521+jochemloedeman@users.noreply.github.com>
License: MIT License
         
         Copyright (c) 2026 Jochem Loedeman
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Python: >=3.14
Description-Content-Type: text/markdown

<div align="center">
<h1>
  env-example
</h1>
</div>
<p align="center">
<a href="https://pypi.org/project/env-example" target="_blank">
    <img src="https://img.shields.io/pypi/v/env-example?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypi.org/project/env-example" target="_blank">
    <img src="https://github.com/jochemloedeman/env-example/actions/workflows/test.yml/badge.svg" alt="Package version">
</a>
</p>


Creates an `.env.example` file for your Python monorepo, based on all [Pydantic settings](https://docs.pydantic.dev/latest/concepts/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`:
```bash
# Basic usage
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=
```
