Skip to main content

Add your description here

Project description

env-example

Package version Package version

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

env_example-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

env_example-1.0.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file env_example-1.0.0.tar.gz.

File metadata

  • Download URL: env_example-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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

Hashes for env_example-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0a0810a22861f3b81a3ffcc318722e36be5e330eec82d28f039d672a4e0ebdc1
MD5 ed04b5cc9537b5f78920776720903e82
BLAKE2b-256 79aeafb85a6caea0d428c03e799e731eb6c03f55454ddc003445eb9f5a7a39cd

See more details on using hashes here.

File details

Details for the file env_example-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: env_example-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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

Hashes for env_example-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d614709674492f3c4526cc8486e758cfb2cc7f50b80a937d86b46ec0201be66
MD5 152e8d65b0b7d3cf0d10a00e43462d20
BLAKE2b-256 aa31e4ed4f96561354b7ba58e56e3e21513711fbccf84a74007194a92f0ecec5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page