Skip to main content

A simple .env file manager for Python, inspired by NodeJS dotenv

Project description

shit_env

A simple Python package to manage .env files, inspired by NodeJS dotenv.

Installation

Just use pip:

pip install shit_env

Usage

Using the Env class

import shit_env

env = shit_env.Env('.env')  # or just shit_env.Env('myenv')

# Get a variable
db_host = env.Get('DATABASE_HOST')

# Set a variable
env.Set('DATABASE_HOST', 'localhost')

# Get with default
db_user = env.Get('DATABASE_USER', 'root')

Requiring a variable (crashes if missing or empty)

import shit_env

# This will raise RuntimeError if DATABASE_HOST is missing or empty in .env
Var1 = shit_env.Required('DATABASE_HOST')

# You can also specify a custom env file
Var2 = shit_env.Required('DATABASE_USER', 'my.env')

.env file format

DATABASE_HOST=localhost
DATABASE_USER=root
# Comments are supported

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

shit_env-0.1.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

shit_env-0.1.1-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file shit_env-0.1.1.tar.gz.

File metadata

  • Download URL: shit_env-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for shit_env-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0971d55e072d59365d568c939764100355d9779178322f9db7c3b6b6bcfc65c5
MD5 d0df97b3b55bddcdce295c737d041b35
BLAKE2b-256 07d806ecb54c7b34e25a2cae4dbccb1f56863bd59d59d85690dd58d1b3148c39

See more details on using hashes here.

File details

Details for the file shit_env-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shit_env-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for shit_env-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7b1c587361f49fcc51d8d05d9350b8b4c78e598ed6f5d62e2c7756a7073bf1d
MD5 33bb230e0cf43e06e794c68848365ff1
BLAKE2b-256 82758abd702ca47fbbe5c98d2ad28ca0185debce3c780bc3104deeb35553b7f1

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