Skip to main content

A simple package to manage environment variables with command-line interface

Project description

mydotenv

A simple Python package to manage environment variables in your .env file with command-line interface.

Installation

Using pipx (Recommended)

pipx install mydotenv

Using pip

pip install mydotenv

From Source

git clone https://github.com/mikejshaffer/mydotenv.git
cd mydotenv
pip install -e .

Usage

Command Line Interface

  1. Print a variable's value:
mydotenv API_KEY
  1. Add or update a variable:
mydotenv NEW_KEY=value
mydotenv "KEY_WITH_SPACES=value with spaces"
  1. Delete a variable:
mydotenv delete VARIABLE_NAME
  1. View all variables:
mydotenv

Custom Command Name

You can set a custom command name to use instead of mydotenv:

mydotenv --set-command dotman

Now you can use either mydotenv or dotman to run commands:

dotman NEW_KEY=value
dotman delete NEW_KEY

When you set a new command name, it replaces any previous custom command name.

Features

  • Manage environment variables from the command line
  • Set custom command names for easier use
  • Preserves comments and formatting in .env file
  • Handles values with spaces and special characters
  • Works from any directory
  • Creates and manages .env file in your current directory

Dependencies

  • python-dotenv >= 1.0.0

Configuration

  • The package stores its configuration in ~/.config/mydotenv/config.env
  • Custom command names are managed through symlinks in ~/.local/bin

License

MIT License - feel free to use this package in your projects!

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

mydotenv-0.1.12.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

mydotenv-0.1.12-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file mydotenv-0.1.12.tar.gz.

File metadata

  • Download URL: mydotenv-0.1.12.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mydotenv-0.1.12.tar.gz
Algorithm Hash digest
SHA256 a4c0b7a27d9e30965b6e57d1dc33bc6270b56105c94c1bbed0b6f7b286fb47d9
MD5 1dd7647963a0ed20d6e0a9b495a2d152
BLAKE2b-256 9bfdd8e58da65f416e3c7bce2e1e9b0e0add19a25a9c24c210ca6c6399398050

See more details on using hashes here.

File details

Details for the file mydotenv-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: mydotenv-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mydotenv-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 2fcd5d253bc7a104ffa5b8155f41581afc3c595218c9fbe923123a15adb74cac
MD5 ded3e3e6cb6094235b267cbdcb335437
BLAKE2b-256 75865814d4c0d23dfcfbb25285a20edfd40425d36bda4fb1cd09a33b4f286f1a

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