Skip to main content

Environment manager with multi-env parsing

Project description

🛠️ Envyro: Environment Configuration Simplified

Envyro is a modern configuration format and CLI tool for managing environment variables across multiple environments like dev, prod, stage, and local. It uses a custom .envyro format that supports nesting, multi-env inline values, and structured scoping.


🔍 Features

1. 🔄 Convert .envyro to .env

Generate traditional .env files for a specific environment by parsing a structured .envyro file.

Command:

envyro export --env dev

2. 📤 Export Environment Variables to Shell

Directly export variables to your current shell environment for a given environment.

Command:

source <(envyro export --env dev --shell)

3. 📦 Split .envyro into Multiple .env Files

Break a single .envyro file into multiple .env files like .env.dev, .env.prod, etc.

Command:

envyro split

4. 🎨 Export to Multiple Formats

Export your configuration to various formats including JSON, YAML, and TOML.

Commands:

# Export to JSON format
envyro export --env dev --format json

# Export to YAML format  
envyro export --env dev --format yaml

# Export to TOML format
envyro export --env dev --format toml

# Export to custom output file
envyro export --env prod --format json --output config.production.json

Supported Formats:

  • env - Traditional .env format (default)
  • json - JSON format with nested structure
  • yaml - YAML format with nested structure
  • toml - TOML format with nested structure


5. Diff Between Environments

Compare two environments and see what variables are different, missing, or changed.

Command:

envyro diff --env1 dev --env2 prod

Example Output:

───────────── Diff: dev vs prod ─────────────
Only in dev:
  AWS_SQS_QUEUE_DEV = myapp-dev-queue
Only in prod:
  AWS_SQS_QUEUE_PROD = myapp-prod-queue
Differing values:
  APP_VERSION: dev=0.1.0 | prod=1.0.0
  DB_HOST: dev=dev-db.example.com | prod=prod-db.example.com
  DB_USER: dev=local_user | prod=prod_user1
  DB_PASSWORD: dev=dev_pass | prod=prod_#.!`~apass
  AWS_S3_BUCKET: dev=myapp-dev-bucket | prod=myapp-prod-bucket
  AWS_SNS_TOPIC: dev=arn:aws:sns:us-west-2:123456789012:dev-topic | prod=arn:aws:sns:us-west-1:123456789012:prod-topic
  • Shows variables only in one environment
  • Highlights variables with different values
  • Uses color for clarity (when run in terminal)

🧪 Example .envyro Format

[envs]
environments = prod, dev, stage, local
default = dev

[app]
name = "MyApp"
version = [prod]:1.0.0 [dev]:0.1.0 [stage]:0.2.0 [local]:0.3.0
description = "Unified app config"
author = "John Doe"

[db]
host = [prod]:prod-db.example.com [*]:localhost
port = 5432
user = [prod]:prod_user [*]:local_user
password = [prod]:prod_pass [*]:dev_pass

[aws.s3]
bucket = [prod]:prod-bucket [dev]:dev-bucket [stage]:stage-bucket [local]:local-bucket
region = [*]:us-east-1

[aws.sns]
topic = [prod]:arn:aws:sns:us-west-1:123456789012:prod-topic [dev]:arn:aws:sns:us-west-2:123456789012:dev-topic

🆕 Global Variables with [*] Section (NEWLY ADDED in v-0.5.0)

You can now declare global (flat) variables in your .envyro file using the special [ * ] section. This is useful for variables that don't fit into a nested section or for direct migration from flat .env files.

Example .envyro:

[envs]
environments = dev, prod
default = dev

[*]
BUCKET_NAME = [prod]:prod-bucket [dev]:dev-bucket [*]:default-bucket
API_KEY = [*]:my-api-key

[db]
host = [*]:localhost

Exported .env for dev:

BUCKET_NAME=dev-bucket
API_KEY=my-api-key
DB_HOST=localhost
  • Variables in [ * ] are exported as flat keys (no section prefix)
  • You can use environment-specific or default values as usual

🧠 Advantages of .envyro

  • ✅ Supports nesting like [aws.s3], [db.connection]
  • Single-file config for all environments
  • ✅ Allows default ([*]) and environment-specific values
  • ✅ Cleaner and more maintainable than multiple .env files
  • ✅ Easy to convert into .env, .yaml, .json, .toml, or Python dict

🧰 Installation

You can install envyro CLI from pypy by running:

pip install envyro

or

python -m pip install envyro

or

python3 -m pip install envyro

👨‍💻 Author

Made by Manmeet Kohli, was there a need ? Don't know....

GitHub X LinkedIn


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envyro-0.5.0.tar.gz (26.1 MB view details)

Uploaded Source

Built Distribution

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

envyro-0.5.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file envyro-0.5.0.tar.gz.

File metadata

  • Download URL: envyro-0.5.0.tar.gz
  • Upload date:
  • Size: 26.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for envyro-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b0a018f180b66d8a728bec58ad0561efbecbe40cfcc11b07fe8edca8d9f8afa1
MD5 37809e9346eafd95fe557df229c2db51
BLAKE2b-256 7ea5652e44f0d1049d15e4fdcd40c4d4f6156405fb38405ad471d82816feabfd

See more details on using hashes here.

File details

Details for the file envyro-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: envyro-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for envyro-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a7fcb57509dd260b571015ce0767b17f42bac2d070a12f3d4ed65aa1e652ec4
MD5 d22b5a8e4f80ce53c5670ff920999a77
BLAKE2b-256 891d2e80d95eb756d6f82ea3adced4f3287a5468b3c4f3c3a791e983e9f2386d

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