https://github.com/alexflipnote/dotenvplus
Reads key-value pairs from a .env file and supports multiple values with dynamic interpolation.
https://github.com/alexflipnote/dotenvplus
bool dotenv dotenv-parser float int python string types variables
Last synced: 8 months ago
JSON representation
Reads key-value pairs from a .env file and supports multiple values with dynamic interpolation.
- Host: GitHub
- URL: https://github.com/alexflipnote/dotenvplus
- Owner: AlexFlipnote
- License: mit
- Created: 2024-10-08T13:14:11.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-15T10:44:41.000Z (10 months ago)
- Last Synced: 2025-05-08T21:53:31.468Z (8 months ago)
- Topics: bool, dotenv, dotenv-parser, float, int, python, string, types, variables
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DotEnvPlus
Reads key-value pairs from a .env file and supports multiple values with dynamic interpolation.
The values returned by the DotEnv object is treated like a dictionary, so you can use it like a normal dictionary.
Some of the usual dictionary methods are also supported like `.items()`, `.keys()`, `.values()`, etc.
Goal is to make it easy to use environment variables in your code, while also supporting multiple values.
## Installing
> You need **Python >=3.7** to use this library.
```bash
pip install dotenvplus
```
## Usage
```env
# .env
KEY1=value
KEY2=123
KEY3=true
```
```python
# main.py
from dotenvplus import DotEnv
# Create a DotEnv object
env = DotEnv()
>>>
# Call it like a dictionary
(env["KEY1"], env["KEY2"], env["KEY3"])
>>> ("value", 123, True)
```