{"id":13936402,"url":"https://github.com/idlesign/envbox","last_synced_at":"2025-05-05T03:43:01.012Z","repository":{"id":57426597,"uuid":"107745545","full_name":"idlesign/envbox","owner":"idlesign","description":"Detect environment type and work within.","archived":false,"fork":false,"pushed_at":"2022-06-08T13:29:15.000Z","size":76,"stargazers_count":25,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T03:42:37.253Z","etag":null,"topics":["12factorapp","app-config","config","configuration","configuration-management","django","dotenv","envfile","environment","environment-configuration","environments","python","settings"],"latest_commit_sha":null,"homepage":"https://github.com/idlesign/envbox","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlesign.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-21T02:37:44.000Z","updated_at":"2024-12-26T04:06:31.000Z","dependencies_parsed_at":"2022-09-19T06:00:45.193Z","dependency_job_id":null,"html_url":"https://github.com/idlesign/envbox","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fenvbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fenvbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fenvbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fenvbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlesign","download_url":"https://codeload.github.com/idlesign/envbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252436240,"owners_count":21747467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["12factorapp","app-config","config","configuration","configuration-management","django","dotenv","envfile","environment","environment-configuration","environments","python","settings"],"created_at":"2024-08-07T23:02:38.168Z","updated_at":"2025-05-05T03:43:00.995Z","avatar_url":"https://github.com/idlesign.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"envbox\n======\nhttps://github.com/idlesign/envbox\n\n|release| |lic| |coverage|\n\n.. |release| image:: https://img.shields.io/pypi/v/envbox.svg\n    :target: https://pypi.python.org/pypi/envbox\n\n.. |lic| image:: https://img.shields.io/pypi/l/envbox.svg\n    :target: https://pypi.python.org/pypi/envbox\n\n.. |coverage| image:: https://img.shields.io/coveralls/idlesign/envbox/master.svg\n    :target: https://coveralls.io/r/idlesign/envbox\n\n\nDescription\n-----------\n\n*Detect environment type and work within.*\n\n\nFeatures\n~~~~~~~~\n\n* Environment type detection (extendable system);\n* Support for ``.env`` files;\n* Convenient ``os.environ`` proxying (with optional values casting into Python natives);\n* Automatic submodule-for-environment import tool;\n* Cosy per-thread settings container with environment var support;\n* CLI for environment probing.\n\n\nCode sample\n~~~~~~~~~~~\n\n.. code-block:: python\n\n    from envbox import get_environment\n\n    # Detect current environment type\n    # and get its object.\n    #\n    # Default detection sources:\n    # 1. ``PYTHON_ENV`` env variable\n    # 2. ``environment`` file contents\n    #\n    # By default this function will also try to read env variables from .env files.\n    env = get_environment()\n\n    env.name\n    # \u003e\u003e development\n\n    env.is_production\n    # \u003e\u003e False\n\n    env.get('HOME')\n    # The same as env['HOME'] and env.HOME\n    # \u003e\u003e /home/idle/\n\n    env.getmany('PYTHON')\n    # {'UNBUFFERED': '1', 'IOENCODING': 'UTF-8', 'PATH': ...}\n\nNow you may want to put your environment vars into ``.env`` files\n(e.g.: ``.env``, ``.env.development`` ``.env.production``)\nto be read by ``envbox``:\n\n.. code-block::\n\n    MY_VAR_1 = value1\n    HOME = /home/other/\n\n    # comments are ignored, just as lines without definitions\n\n    # mathing quotes (\" and ') are stripped\n    MY_QUOTED = \"some quoted \"\n\n    # ${VARNAME} will be replaced by value from env (if available)\n    MY_VAR_2 = ${MY_QUOTED}\n\n    # multiline with dangling quotes\n    MULTI_1 = \"\n    line1\n    line2\n    \"\n\n    # multiline classic\n    MULTI_2 = \"line1\n    line2\n    line3\"\n\n    # multiline as one line\n    MULTI_3 = \"one\\ntwo\"\n\nRead the docs for more examples.\n\n\nCLI\n~~~\n\n.. code-block:: bash\n\n    $ envbox probe\n    # \u003e\u003e Detected environment type: development (Development)\n\n    $ envbox show\n    # \u003e\u003e [...]\n    # \u003e\u003e SHELL = /bin/bash\n    # \u003e\u003e [...]\n\n\n**Note:** ``envbox`` CLI requires ``click`` package available.\n\n\nDocumentation\n-------------\n\nhttp://envbox.readthedocs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fenvbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlesign%2Fenvbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fenvbox/lists"}