python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

Add method to update multiple key/values to .env

Open mrjng opened this issue 4 years ago • 2 comments

update_dict_to_dotenv was implemented to support for updating multiple environment variables at once. This method is necessary because set_key can update only one environment variable at once.

Feel free to ask any questions or give your opinion. Thanks.

Following things were changed.

  • update_dict_to_dotenv was added to main.py
  • make_env_line was extracted from set_key
  • test_update_dict_to_dotenv was added to test_main.py
  • Update tests/__init__.py to import update_dict_to_dotenv

mrjng avatar Jul 07 '21 14:07 mrjng

@theskumar Could you take a look at this PR?

mrjng avatar Jul 30 '21 23:07 mrjng

I make the commit history clearer.

mrjng avatar Aug 12 '21 05:08 mrjng