pyauto-dotenv
pyauto-dotenv is a python package that simplifies the process of loading environment variables from a .env
file in your project. With pyauto-dotenv, you no longer need to manually load the .env file in your code.
This package automatically loads the variables from the .env file if the auto-dotenv package is installed
in your environment.
pyauto-dotenv is just a wrapper around python-dotenv. In fact what it does is basically run the following code everytime you run a python file:
from dotenv import load_dotenv
load_dotenv()
Installation
You can install pyauto-dotenv via pip:
pip install pyauto-dotenv
Usage
Using pyauto-dotenv is straightforward. Once you've installed the package, that's it!
If a .env file is present in your project directory,
pyauto-dotenv will automatically load its contents into the environment.
You can define the following environment variable to override the default .env file: AUTO_DOTENV_PATH, AUTO_DOTENV_ENV
Example
Let's say you have a .env file with the following contents:
DB_HOST=localhost
DB_USER=admin
DB_PASS=password123
Normally, you would need to load these variables manually in your code. However, with pyauto-dotenv, you can access these variables directly from the environment:
import os
print(os.environ['DB_HOST']) # Output: localhost
print(os.environ['DB_USER']) # Output: admin
print(os.environ['DB_PASS']) # Output: password123
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This package comes with no warranties or guarantees. Use it at your own risk.
Metadata
Release files for pyauto-dotenv 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyauto_dotenv-0.1.0.tar.gz | 5.8 kB | Without provenance | Details for pyauto_dotenv-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyauto_dotenv-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyauto_dotenv-0.1.0-py3-none-any.whl |
Total release size: 9.9 kB
Release files / pyauto_dotenv-0.1.0.tar.gz
| Download URL | pyauto_dotenv-0.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2424f65dc50f829334383292aa42023c38801519d00bebe004d908c1c349e9ab
|
|
BLAKE2b-256 checksum How to use checksums |
1b22fc5661badc9744eaa0def627a96dbc76313c6d34b19a7ef8c52561060a14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Release files / pyauto_dotenv-0.1.0-py3-none-any.whl
| Download URL | pyauto_dotenv-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
daf3a03c8d05dbbbfa3b56748231a5d06799c06c503ef6e4b7a5030261c798be
|
|
BLAKE2b-256 checksum How to use checksums |
f4280fc524bf1f80e00a328cbd9507ce36449e55e475ad1284005490a6a3c1ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Security for pyauto-dotenv 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.