Skip to main content

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)

Release files for izienv 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for izienv 0.1.2
File Size Uploaded
izienv-0.1.2.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for izienv 0.1.2
File Interpreter ABI Platform
izienv-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / izienv-0.1.2.tar.gz

Download URL izienv-0.1.2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
abe0961463964d926c3191ad08078ed39f2093355caef55ed499f6637dffab54
BLAKE2b-256 checksum
How to use checksums
1fa0d5be5a8738b591e1ca7b301512d39c4213550c7770123de9ccfb00d806ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / izienv-0.1.2-py3-none-any.whl

Download URL izienv-0.1.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
900d927034082548bc25e7c5926ccc741ea3120328cebf23bf03b02a3765e40c
BLAKE2b-256 checksum
How to use checksums
3301a8e7c3648b9f30ecdd50307796fbcab1a0f68aa2373bb02d2aef20d9aecc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page