{"id":32178408,"url":"https://github.com/qwigo/envs","last_synced_at":"2026-02-18T22:02:26.293Z","repository":{"id":45865199,"uuid":"62333689","full_name":"qwigo/envs","owner":"qwigo","description":"Easy access of environment variables from Python with support for typing (ex. booleans, strings, lists, tuples, integers, floats, and dicts). Now with CLI settings file converter.","archived":false,"fork":false,"pushed_at":"2023-06-28T21:02:58.000Z","size":94,"stargazers_count":26,"open_issues_count":4,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-14T07:37:19.053Z","etag":null,"topics":["boolean","dict","environment-variables","lists","python","strings","tuples"],"latest_commit_sha":null,"homepage":"https://capless.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qwigo.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"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}},"created_at":"2016-06-30T18:29:45.000Z","updated_at":"2025-08-13T05:40:08.000Z","dependencies_parsed_at":"2024-01-13T21:11:09.585Z","dependency_job_id":null,"html_url":"https://github.com/qwigo/envs","commit_stats":null,"previous_names":["qwigo/envs","capless/envs","bjinwright/envs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/qwigo/envs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwigo%2Fenvs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwigo%2Fenvs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwigo%2Fenvs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwigo%2Fenvs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qwigo","download_url":"https://codeload.github.com/qwigo/envs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qwigo%2Fenvs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["boolean","dict","environment-variables","lists","python","strings","tuples"],"created_at":"2025-10-21T20:55:09.211Z","updated_at":"2026-02-18T22:02:26.288Z","avatar_url":"https://github.com/qwigo.png","language":"Python","readme":"# envs\nEasy access of environment variables from Python with support for booleans, strings, lists, tuples, integers, floats, and dicts.\n\n## Use Case\n\nIf you need environment variables for your settings but need an easy way of using Python objects instead of just strings. For example, if you need a list of strings.\n\n## Features\n\n- CLI to convert settings\n- CLI to list and check environment variables\n- Use strings, lists, tuples, integers, floats or dicts. **IMPORTANT:** When setting the variables in your environmenet (ex. in .env file) wrap them in single or double quotes (ex. `\"['some','list']\"`) \n\n[![Build Status](https://travis-ci.org/capless/envs.svg?branch=master)](https://travis-ci.org/capless/envs)\n\n## Quick Start\n### Install\n#### Install without CLI Requirements\n\n```commandline\npip install envs\n```\n#### Install with CLI Requirements\n\n```commandline\npip install envs[\"cli\"]\n```\n### Run Convert Settings\n\n**IMPORTANT:** Don't name this file the same as the original module (you have added the imports back yet).  \n```commandline\nenvs convert_settings --settings-file your.settings.module\n```\n\n### Copy and Paste the Imports and Logic Code From Original File\n\nEnvs does not copy and paste your imports from your original code, so you have to do this manually.\n\n### Run List Envs\n\nThis tells you what envs have default v\n```commandline\nenvs list_envs --settings-file your.settings.module\n```\n## General API\n\n```python\nfrom envs import env\n\nenv('SOMEVAR','default value for that var',var_type='string',allow_none=True)\n```\n\n### Strings\n\n**Environment Variable Example:** SECRET_KEY='adfadfadfafasf'\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('SECRET_KEY','default secret key here')\n'adfadfadfafasf'\n```\n\n### Lists\n**Environment Variable Example:** SERVER_NAMES=\"['coastal','inland','western']\"\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('SERVER_NAMES',var_type='list')\n['coastal','inland','western']\n```\n\n### Tuples\n**Environment Variable Example:** SERVER_NAMES=\"('coastal','inland','western')\"\n\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('SERVER_NAMES',var_type='tuple')\n('coastal','inland','western')\n```\n\n### Dicts\n**Environment Variable Example:** DATABASE=\"{'USER':'name','PASSWORD':'password'}\"\n\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('DATABASE',var_type='dict')\n{'USER':'name','PASSWORD':'password'}\n```\n\n### Integers\n\n**Environment Variable Example:** NO_SERVERS=12\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('NO_SERVERS',var_type='integer')\n12\n```\n\n### Floats\n\n**Environment Variable Example:** INDEX_WEIGHT=0.9\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('INDEX_WEIGHT',var_type='float')\n0.9\n```\n\n### Booleans\n**Environment Variable Example:** USE_PROFILE=false\n```python\n\u003e\u003e\u003efrom envs import env\n\n\u003e\u003e\u003eenv('USE_PROFILE',var_type='boolean')\nFalse\n```\n\n### Decimals\n**Environment Variable Example:** HALF_SEVEN=3.5\n```python\n\u003e\u003e\u003e from envs import env\n\n\u003e\u003e\u003e env('HALF_SEVEN', var_type='decimal')\nDecimal('3.5')\n```\n\n## Command Line Utils\n\n**IMPORTANT:** All of the command arguments will fallback to becoming prompts if not set when calling the commands.\n\n### Convert Module (convert_module)\n\nConverts an existing settings file so it uses envs. **IMPORTANT:** This command does not copy your **import** stataements to the new module. \n\n#### Arguments\n\n- **settings-file:** - Dot notated import string for settings file\n\n```commandline\nenvs convert_module --settings-file your.settings\n```\n\n### List Envs (list_envs)\n\nShows a list of env instances set in a settings file.\n\n- **settings-file:** - Dot notated import string for settings file\n- **keep-result:** - Keep the .env_results file generated by this command (**default:** False)\n\n```commandline\nenvs list_envs --settings-file your.settings --keep-result False\n```\n\n### Check Envs (check_envs)\n\nMake sure that the defined envs with no default value have a value set in the environment. This command will raise an **EnvsValueException** if there is environment variable that should be set that is not. This command is meant for use with a CI/CD tool as a way to halt the build if there isn't a value for an environment variable.\n\n- **settings-file:** - Dot notated import string for settings file\n\n```commandline\nenvs check_envs --settings-file your.settings\n```\n\n### Author\n\n**Twitter:**:[@brianjinwright](https://twitter.com/brianjinwright)\n**Github:** [bjinwright](https://github.com/bjinwright)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqwigo%2Fenvs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqwigo%2Fenvs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqwigo%2Fenvs/lists"}