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/banddude/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.17.tar.gz (4.9 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.17-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mydotenv-0.1.17.tar.gz
  • Upload date:
  • Size: 4.9 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.17.tar.gz
Algorithm Hash digest
SHA256 2dcabd6f9ea317034f2c9a6e0ee1334e0aec8651c56aaaaabfd96dd8939a5300
MD5 840b169e69fb5267cac60e95342a637a
BLAKE2b-256 6ad160212d33f7dfadcadd7504fd9b7e9883804e1792a4a3acfc8cf8ee171bc3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mydotenv-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 6.0 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.17-py3-none-any.whl
Algorithm Hash digest
SHA256 822f4dc4faa062db9d76131f49fd18436b64fa7c071b54ca5b311aa023cd0cdd
MD5 0c3c7765b6b32faf7ae4d56495675095
BLAKE2b-256 29e1c61043fa04a4bd138d20c181c748a674934e3864056fb1285fcdf42934e1

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