Skip to main content

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

envo-1.5.3.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

envo-1.5.3-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file envo-1.5.3.tar.gz.

File metadata

  • Download URL: envo-1.5.3.tar.gz
  • Upload date:
  • Size: 25.7 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

Hashes for envo-1.5.3.tar.gz
Algorithm Hash digest
SHA256 144a6ee1e5fcc8f093545a6f6249fb12ba2b294e43003f2e65c3fe71f1103176
MD5 b20362e1e42830bb6c762f1a0138246b
BLAKE2b-256 8aeec2bd177ab9c60f1eba57bab4082fecaec2ce0cbdf0560a537553519e64a4

See more details on using hashes here.

File details

Details for the file envo-1.5.3-py3-none-any.whl.

File metadata

  • Download URL: envo-1.5.3-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

Hashes for envo-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7b242bcce85a85490d45c3c8b40ff6eb5aeb6e926f917cb0ce3d11480b44312d
MD5 872d8b9d16575e74d2562845ab942109
BLAKE2b-256 b2be864e0b0044ca750641de437eb9f2fd709c520afb78d25ff274f9e01cb82b

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