Skip to main content

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_SOME_STRING=my_var_1
NAME_ENV_SOME_PATH=/path/to/data
from izienv import BaseEnv, load_env_var, load_izienv

class MyEnv(BaseEnv):
    @property
    @load_env_var_str()
    def SIMPLE_VAR(self) -> str:
        return "SIMPLE_VAR"
    
    @property
    @load_env_var_str(name_left=True)        # Set name_left to add the `NAME_ENV` to the variable.
    def SOME_STRING(self) -> str:
        return "SOME_STRING"
    
    @property
    @load_env_var_path(name_left=True)        # Set name_left to add the `NAME_ENV` to the variable.
    def SOME_PATH(self) -> str:
        return "SOME_PATH"

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.SOME_STRING)
print(env.SOME_PATH)

Project details


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.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

izienv-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file izienv-0.1.0.tar.gz.

File metadata

  • Download URL: izienv-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for izienv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 46032df5bbf218b1b79fa061d3fcf8dbf969db3cff072402627e2a8722501fd7
MD5 e1db972c3924f88293a1f812f490977f
BLAKE2b-256 af56263a3b108f64fd671d6165c21912261491a0b168c899f4c14cf791828453

See more details on using hashes here.

File details

Details for the file izienv-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: izienv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for izienv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 791211e3735d4596db997277e71b8c3176c73d5c51e43913f42bd456c662bb81
MD5 ff4971e13038554a333fbcfad3202aa0
BLAKE2b-256 7926f02e1ad1b333f3b3458ccf12395120b55d260ea0022f407054d941d91e48

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page