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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: envo-1.5.5.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.14 Linux/5.15.0-141-generic

File hashes

Hashes for envo-1.5.5.tar.gz
Algorithm Hash digest
SHA256 6ad8834303a238d5d5773ffabfd15fad204760b788eca6011ed40061fc990b2e
MD5 d46a6efe72e43e7611c1459c7d169505
BLAKE2b-256 bf0345f60e0c952e1463e0287d1a6e6e072a56d7dbcfd9119b1f9f8cd18518ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: envo-1.5.5-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.14 Linux/5.15.0-141-generic

File hashes

Hashes for envo-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d6b59fdb1cbfa90625876e5973194a023064ecc1a07cb741d3cbef99f41ca611
MD5 599b85431424b32e8740a01be2d7aaa5
BLAKE2b-256 05e758835f3689c6786b349d110c4d5afb2456a71e010d9d4cbb16469af75a1a

See more details on using hashes here.

Supported by

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