Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

izienv

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

izienv

Python package to handle multiple files with environment variables.

  • 0.1.2
  • Source
  • PyPI
  • Socket score

Maintainers
1

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)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc