Python package to handle multiple files with environment variables.
Project description
Python package to handle multiple files with environment variables.
- TODO: Ver si puedo instalarlo en global para manejar las variables dentro de arch.
Quickstart
- Crear folder
.envs/
en la raiz del proyecto.
cd /path/to/project
mkdir -p .envs
touch .envs/name_env.env
- Editar las variables de entorno, deberán llamarse
{NAME_ENV}_{VAR}
.
SIMPLE_VAR=my_cats_are_beautiful
NAME_ENV_VAR_1=my_var_1
NAME_ENV_VAR_2=my_var_2
from izienv import BaseEnv, load_env_var, load_izienv
class MyEnv(BaseEnv):
@property
@load_env_var()
def SIMPLE_VAR(self) -> str:
return "SIMPLE_VAR"
@property
@load_env_var(name_pre=True) # Set name_pre to add the `NAME_ENV` to the variable.
def VAR_1(self) -> str:
return "VAR_1"
@property
@load_env_var(name_pre=True) # Set name_pre to add the `NAME_ENV` to the variable.
def VAR_2(self) -> str:
return "VAR_2"
NAME = 'name_env'
load_izienv(name=NAME, path_envs=Path(".envs"))
# You need .envs/ folder with envs. Or set `path_envs`.
env = MyEnv(name=NAME)
print(env.SIMPLE_VAR)
print(env.VAR_1)
print(env.VAR_2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
izienv-0.0.7.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file izienv-0.0.7.tar.gz
.
File metadata
- Download URL: izienv-0.0.7.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0bb32cdd626d6da68706c1c0541dfe2c5205a65d3aaedf30d818f2d2dcf7913 |
|
MD5 | caa59046f6773df7b444824015415847 |
|
BLAKE2b-256 | bff760de5b683f6dabfba6bc0f1484537f48aa332f775e454909452168408840 |
File details
Details for the file izienv-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: izienv-0.0.7-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 182c0fca1a35ef5d9fd05daebd10304c036dff5ad9e830e0b9320730b6ed757d |
|
MD5 | 84799d0d2ef8737dabbb06e701201f25 |
|
BLAKE2b-256 | 18f83f526c181e8a2bb92068f4175cfc22e531881b08f969c0bb6e98e84b54d5 |