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.6.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file izienv-0.0.6.tar.gz
.
File metadata
- Download URL: izienv-0.0.6.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3f3ca418da998f6cd53ee6951205e94bb5cf923139fc895c42e39e136b5d4d8 |
|
MD5 | f750f8b72585bdf851424cd95617cae9 |
|
BLAKE2b-256 | 4ca3119c54c5fd4cfd1f6189d702765dfbfe60bcdc9ebc858591f8167eb35ed3 |
File details
Details for the file izienv-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: izienv-0.0.6-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 | 9be7cd45412a303dc5b5cd6a98203a89208f40b91787a8296d5224be8ac50de9 |
|
MD5 | c73dd5247016e11f90209746e7564410 |
|
BLAKE2b-256 | 8572662ffbb44ebc254de0306207d9c5e89d21af2d625c2fb4a58fc2501ad15d |