Skip to main content

A command line tool for generating sample env files from pydantic BaseSettings.

Project description

sample-env

A CLI tool for generating sample env files from pydantic_settings.BaseSettings.

Installation

pip install sample-env

Command-line usage

Let's assume the following BaseSettings.

from pydantic_settings import BaseSettings


class Environment(BaseSettings):
    DEBUG: bool = True
    POSTGRES_HOST: str = "localhost"
    POSTGRES_USER: str = "postgres"
    POSTGRES_DB: str = "db"
    POSTGRES_PASSWORD: str = "postgres"
    POSTGRES_PORT: str = "5432"

You can generate a .env.sample file with this command:

sample-env example.Environment

Output

DEBUG=True
POSTGRES_HOST=localhost
POSTGRES_USER=postgres
POSTGRES_DB=db
POSTGRES_PASSWORD=postgres
POSTGRES_PORT=5432

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

sample_env-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

sample_env-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sample_env-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for sample_env-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5d9a9efab2cb1b174e05ae0709889266c18ad6eeb08aa196caa939e55f751957
MD5 27458d9d0c99c522cbdf64a090be913a
BLAKE2b-256 81d49a54871e05492ef352dfeb5259654a8f7f54ed7fa7daf281f1304f4a688b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sample_env-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for sample_env-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9af5b637fd96b0c7097070b7390e8799b015332c92b21d6912a8eef20fd81a9f
MD5 8bb51721e17b87b4e2b655627473200b
BLAKE2b-256 abfa8dc2b064da4de0a02b7b928688998b09a76c64f95190ef76014a5e1a67f7

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