Smart Environments handling - Define command hooks, file hooks and env variables in python and activate hot reloaded shells.
Project description
Define environmental variables in python and activate hot reloaded shells for them.
Features
Initialisation of variables in a given directory (creates common variables file too)
user@pc:/project$ envo local --init # creates local environment python files
Easy and dynamic handling in .py files (See documentation to learn more)
Provides addons like handling virtual environments
user@pc:/project$ envo local --init=venv # will add .venv to PATH
Automatic env variables generation based on defined python variables
Activating shells for a given environment
user@pc:/project$ envo local
🐣(project)user@pc:/project$
🐣(project)user@pc:/project$ exit
user@pc:/project$ envo prod
🔥(project)user@pc:/project$
Saving variables to a regular .env file
user@pc:/project$ envo local dump
Printing variables (handy for non interactive CLIs like CI or docker)
user@pc:/project$ envo local dry-run
Detects undefined variables.
Perfect for switching kubernetes contexts and devops tasks
Example
Initialising environment
user@pc:/project$ envo local init
Will create env_comm.py
and env_local.py
# env_comm.py
class ProjectEnvComm(Env):
class Meta(Env.Meta):
name: str = "my_project'
verbose_run = True
def init(self) -> None:
super().init()
@command
def hello_world(self) -> None:
print("Hello world!")
ThisEnv = ProjectEnvComm
# env_local.py
class ProjectLocalEnv(ProjectEnvComm):
class Meta(ProjectEnvComm.Meta):
stage: str = "local"
emoji: str = "🐣"
def init(self) -> None:
super().init()
ThisEnv = ProjectLocalEnv
Example usage:
user@pc:/project$ envo # short for "envo local"
🐣(my_project)user@pc:/project$ hello_world
Hello world!
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
Built Distribution
File details
Details for the file envo-1.5.4.tar.gz
.
File metadata
- Download URL: envo-1.5.4.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.14 Linux/5.15.0-125-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3954731d350a17bf0c2fced201d125906ea611a2548f73b34578cc7b0c00d9ce |
|
MD5 | 1282df82df4d1fc0f28c1fbcc7fbb9ea |
|
BLAKE2b-256 | a778419693e7f0f4395a82f8d5b4822420b691b57e0b07268baf975d9311ca61 |
File details
Details for the file envo-1.5.4-py3-none-any.whl
.
File metadata
- Download URL: envo-1.5.4-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.14 Linux/5.15.0-125-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f24749063445620d4965bffb483f942e5186ec290627b05130ee75405e8c570 |
|
MD5 | 98d6434ef002efab8d7076eb7cd0556f |
|
BLAKE2b-256 | 13c5f8c5ed13919a2dba271ee78f010dfe52caee07250d17cc59a8778d02f839 |