{"id":34863859,"url":"https://github.com/megalus/stela","last_synced_at":"2026-04-25T20:03:56.651Z","repository":{"id":44914712,"uuid":"249215782","full_name":"megalus/stela","owner":"megalus","description":"Organize your project settings and secrets with ease","archived":false,"fork":false,"pushed_at":"2026-04-25T14:10:07.000Z","size":2464,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-25T16:14:26.447Z","etag":null,"topics":["configuration","dotenv","python","secrets","settings"],"latest_commit_sha":null,"homepage":"https://megalus.github.io/stela/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/megalus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["megalus"],"custom":["https://www.buymeacoffee.com/megalus"]}},"created_at":"2020-03-22T15:43:59.000Z","updated_at":"2026-04-25T14:10:09.000Z","dependencies_parsed_at":"2024-02-08T19:43:17.001Z","dependency_job_id":null,"html_url":"https://github.com/megalus/stela","commit_stats":null,"previous_names":["chrismaille/stela"],"tags_count":66,"template":false,"template_full_name":null,"purl":"pkg:github/megalus/stela","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megalus%2Fstela","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megalus%2Fstela/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megalus%2Fstela/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megalus%2Fstela/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/megalus","download_url":"https://codeload.github.com/megalus/stela/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megalus%2Fstela/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32274987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","dotenv","python","secrets","settings"],"created_at":"2025-12-25T21:55:56.039Z","updated_at":"2026-04-25T20:03:56.638Z","avatar_url":"https://github.com/megalus.png","language":"Python","funding_links":["https://github.com/sponsors/megalus","https://www.buymeacoffee.com/megalus"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n   \u003cimg src=\"docs/images/stela.png\" alt=\"Stela\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cem\u003eEasily manage your application settings and secrets\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pypi.org/project/stela/\" target=\"_blank\"\u003e\n\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/stela\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/megalus/stela/actions\" target=\"_blank\"\u003e\n\u003cimg alt=\"Build\" src=\"https://github.com/megalus/stela/workflows/tests/badge.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://www.python.org\" target=\"_blank\"\u003e\n\u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/stela\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/megalus/stela/blob/main/LICENSE\" target=\"_blank\"\u003e\n\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/megalus/stela\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Welcome to Stela\n\n[Stela](https://en.wikipedia.org/wiki/Stele) were the \"information\nfiles\" of ancient times. This library helps you manage your project\nsettings and secrets with ease, using a simple and consistent approach.\n\n### What is Stela?\n\nStela is a Python library that simplifies how you handle:\n- **Settings**: Non-sensitive values that can be committed to your repository (API URLs, timeouts, etc.)\n- **Secrets**: Sensitive values that should not be committed (passwords, tokens, etc.)\n- **Environment-specific configurations**: Different values for development, testing, and production\n\n### TL;DR\n\n1. In a new project run `pip install stela`\n2. On terminal, run `stela init --default --no-confirm`\n3. Uncomment the `MY_SECRET` line in `.env`\n4. Add `from stela import env` and run `print(env.MY_SECRET)` in your code\n5. Uncomment the `MY_SECRET` line in `.env.local` and get the code again.\n6. Add `export MY_SECRET=memory_value` in your terminal and get the code again.\n\nNew to multi-environment setups? Start with the Quick Setup guide: https://megalus.github.io/stela/quick_setup/\n\n### Install\n\n```shell\npip install stela\n```\n\n### Development\n\n```bash\n# Define your VIRTUAL_ENV location. For example: export VIRTUAL_ENV=$(pwd)\nuv sync --active --group dev\nmake ci\n```\n\n### Documentation\n\nFor detailed documentation, visit: https://megalus.github.io/stela/\n\n### Key Features\n\n1. **Learn once, use everywhere** - Works with any Python project or framework\n2. **Separate settings from secrets** - Use multiple dotenv files to organize your configuration\n3. **Environment-specific settings** - Easily switch between development, testing, and production environments\n4. **Simple API** - Access your settings with `from stela import env`\n5. **Extensible** - Not limited to dotenv files, can load settings from any source (AWS Parameter Store, Vault, etc.)\n\n\n## Quick Start Guide\n\n### Step 1: Initialize Your Project\n\nRun the Stela initialization command to set up your project:\n\n```bash\nstela init --default\n```\n\nThis creates four files:\n- `.env` - Store your default settings (will be committed to git)\n- `.env.local` - Store your secrets (will be ignored by git)\n- `.stela` - Stela configuration file\n- Updates `.gitignore` to exclude sensitive files\n\n### Step 2: Configure Your Settings and Secrets\n\nAdd your settings to `.env`:\n\n```ini\n# .env - This file WILL be committed to your repository\n# Store default settings and fake credentials here\nAPI_URL=\"http://localhost:8000\"\nDB_URL=\"db://fake_user:fake_password@local_db:0000/name\"\n```\n\nAdd your real secrets to `.env.local`:\n\n```ini\n# .env.local - This file will NOT be committed (ignored by git)\n# Store real credentials and secrets here\nDB_URL=\"db://real_user:real_password@real_db:0000/name\"\n```\n\n### Step 3: Access Your Settings in Code\n\nUse the simple API to access your settings and secrets:\n\n```python\n# my_script.py\nfrom stela import env\n\n# Access your settings with dot notation\nAPI_URL = env.API_URL  # http://localhost:8000\nDATABASE_URL = env.DB_URL  # db://real_user:real_password@real_db:0000/name\n```\n\nStela automatically loads values from `.env` first, then overrides them with values from `.env.local`.\n\n### Precedence at a glance\n\nWhen the same key is defined in multiple places, Stela resolves it using this order (top wins):\n1. Value already present in the process environment (os.environ). Stela will not overwrite existing env vars.\n2. .env.{environment}.local\n3. .env.{environment}\n4. .env.local\n5. .env\n\nIf a key is missing everywhere, Stela raises a StelaValueError by default (configurable).\n\n## Environment-Specific Configuration\n\nStela makes it easy to manage different environments (development, testing, production):\n\n### Step 1: Create Environment-Specific Files\n\nCreate a file for each environment:\n\n```ini\n# .env.development\nAPI_URL=\"http://localhost:8000\"\n\n# .env.production\nAPI_URL=\"https://api.example.com\"\n```\n\n### Step 2: Set the Environment\n\nSet the `STELA_ENV` environment variable to specify which environment to use:\n\n```bash\n# For development\nexport STELA_ENV=development\n\n# For production\nexport STELA_ENV=production\n```\n\n### Step 3: Access Your Settings\n\nYour code remains the same, but Stela will load the appropriate values:\n\n```python\nfrom stela import env\n\n# Will be \"http://localhost:8000\" when STELA_ENV=development\n# Will be \"https://api.example.com\" when STELA_ENV=production\nAPI_URL = env.API_URL\n```\n\n## Advanced: Custom Data Sources\n\nStela isn't limited to dotenv files. You can load settings from any source:\n\n### Step 1: Configure a Final Loader\n\nAdd a final loader in your `.stela` configuration file:\n\n```ini\n# .stela\n[stela]\nfinal_loader = \"path.to.my.final_loader\"\n```\n\n### Step 2: Create Your Loader Function\n\n```python\n# my_loaders.py\nfrom typing import Any\nfrom stela.config import StelaOptions\n\n\ndef final_loader(options: StelaOptions, env_data: dict[str, Any]) -\u003e dict[str, Any]:\n    \"\"\"Load settings from a custom source and merge into env_data.\n\n    Args:\n        options: Stela configuration options (includes current_environment).\n        env_data: Data already loaded from dotenv files.\n\n    Returns:\n        Updated data dictionary.\n    \"\"\"\n    # Example: pretend we fetched data from an external source\n    external = {\"API_TIMEOUT\": \"5\", \"FEATURE_FLAG\": \"true\"}\n\n    # Merge/override values\n    env_data.update(external)\n    return env_data\n```\n\n### Step 3: Use Your Settings as Usual\n\n```python\nfrom stela import env\n\n# Values can come from dotenv files or your custom source\nAPI_URL = env.API_URL\nDB_PASSWORD = env.DB_PASSWORD\nAPI_TIMEOUT = env.API_TIMEOUT  # From custom loader\n```\n\n## Need Help?\n\n- **Documentation**: For detailed guides and examples, visit [the documentation](https://megalus.github.io/stela/)\n- **Issues**: Found a bug? Have a question? [Open an issue](https://github.com/megalus/stela/issues)\n- **Contribute**: Pull requests are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegalus%2Fstela","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegalus%2Fstela","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegalus%2Fstela/lists"}