{"id":23644,"library":"dump-env","title":"dump-env","description":"A utility tool to create .env files from environment variables or dictionaries. Current version 1.7.0, supports Python 3.10+. Release cadence is irregular with major features added roughly yearly.","status":"active","version":"1.7.0","language":"python","source_language":"en","source_url":"https://github.com/wemake-services/dump-env","tags":["environment","dotenv","cli","configuration"],"install":[{"cmd":"pip install dump-env","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Use 'from dump_env import dump_env' to get the function directly. 'import dump_env' gives you a module, not the function.","wrong":"import dump_env","symbol":"dump_env","correct":"from dump_env import dump_env"}],"quickstart":{"code":"from dump_env import dump_env\nimport os\nos.environ['MY_VAR'] = 'hello'\ndump_env(['MY_VAR'], filename='.env')\nwith open('.env') as f:\n    print(f.read())","lang":"python","description":"Create a .env file from an environment variable."},"warnings":[{"fix":"Upgrade to Python 3.6+ (or Python 3.10+ for v1.7.0) and use dump-env >=1.0.0.","message":"In version 1.0.0, Python 2 support was dropped. If you are still on Python 2, you cannot upgrade beyond 0.2.1.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Pin dependency: 'dump-env<1.6.0' or upgrade to Python 3.10+.","message":"Python 3.9 support was dropped in version 1.6.0. If your project requires Python 3.9, pin to dump-env <1.6.0.","severity":"deprecated","affected_versions":">=1.6.0"},{"fix":"Always pass the 'filename' argument when you intend to write a .env file. Example: dump_env(['KEY'], filename='.env').","message":"dump_env() writes to stdout by default; if you forget to pass 'filename', output goes to console, not to a file.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Pass a list of keys: dump_env(['MY_VAR'], filename='.env').","cause":"Calling dump_env() without providing the 'keys' argument (a list of environment variable names).","error":"TypeError: dump_env() missing 1 required positional argument: 'keys'"},{"fix":"Use 'from dump_env import dump_env' and then call 'dump_env(...)'.","cause":"Tried to import using 'import dump_env' and then calling 'dump_env.dump_env()', but the module name clashes with the function name, leading to confusion.","error":"ImportError: cannot import name 'dump_env' from 'dump_env'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}