{"id":17442449,"url":"https://github.com/hanhwanglim/dotem","last_synced_at":"2025-09-07T06:36:31.182Z","repository":{"id":215322959,"uuid":"737893972","full_name":"hanhwanglim/dotem","owner":"hanhwanglim","description":"A environment variable loader written in Python","archived":false,"fork":false,"pushed_at":"2024-12-30T17:44:51.000Z","size":42,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T22:07:33.649Z","etag":null,"topics":["dotenv","python","shell","toml"],"latest_commit_sha":null,"homepage":"","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/hanhwanglim.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-01T21:54:28.000Z","updated_at":"2024-11-07T17:49:35.000Z","dependencies_parsed_at":"2024-05-03T18:24:44.800Z","dependency_job_id":"a4403655-3cf9-442b-b010-2517c6e7b369","html_url":"https://github.com/hanhwanglim/dotem","commit_stats":null,"previous_names":["hanhwanglim/dotem"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanhwanglim%2Fdotem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanhwanglim%2Fdotem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanhwanglim%2Fdotem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanhwanglim%2Fdotem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanhwanglim","download_url":"https://codeload.github.com/hanhwanglim/dotem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241414597,"owners_count":19959241,"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":["dotenv","python","shell","toml"],"created_at":"2024-10-17T16:06:14.816Z","updated_at":"2025-03-01T19:31:02.676Z","avatar_url":"https://github.com/hanhwanglim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotem\n\ndotem is a simple Python package designed to streamline the process of loading environment variables into your shell from a `.env.toml` file. It aims to make the configuration of your development environment easier and more consistent.\n\n## Motivation\n\nManaging environment variables is a common task in software development, and it can become cumbersome, especially when dealing with multiple configurations for different environments.\n\nAn example of a project with many different `.env` files:\n\n```text\nproject/\n|-- env/\n|   |-- .env\n|   |-- .env.local\n|   |-- .env.development\n|   |-- .env.staging\n|   |-- .env.uat\n|   |-- .env.prod\n|   `-- ...\n`-- ...\n```\n\ndotem was created with the following motivations:\n\n- Simplicity: Provide a straightforward solution for loading environment variables, reducing the complexity of managing configurations using a single file `.env.toml`.\n- Consistency: Establish a consistent approach to handling environment variables across projects, using a standardized `.env.toml` file format.\n- Ease of Use: Make it easy for developers to \"source\" their environment variables in a single command call.\n\n## Installation\n\n\u003e [!WARNING]  \n\u003e `dotem` is supported in Linux and Darwin machines only!\n\nYou can install `dotem` using pip. Run the following command:\n\n```bash\npip install dotem\n```\n\nThen, in your `.bashrc` or `.zshrc` file, add the following line:\n\n```bash\neval \"$(\"dotem-cli\" hook)\"\n```\n\n## Features\n\n- Loading and unloading environment variables from a `.env.toml` file.\n- Simple and lightweight.\n- Support TOML format for easy configuration.\n- Loading and unloading environment variables with inheritance.\n\n## Usage\n\n1. Create a `.env.toml` file with your environment variables.\n\n    ```toml\n    [development]\n    API_KEY = \"...\"\n    DATABASE_URL = \"...\"\n\n    [production]\n    API_KEY = \"...\"\n    DATABASE_URL = \"...\"\n    ```\n\n2. In your shell, use `dotem load [profile]` to load the environment variable into your shell.\n\n    ```bash\n    dotem load development\n    ```\n\n    This will load the environment variables of that profile in your shell.\n\n### Commands\n\n- `dotem load [profile]` - Loads the environment variables defined in the profile.\n- `dotem unload [profle]` - Unsets the environment variables defined in the profile.\n- `dotem edit` - Edits the `.env.toml` file in the `$EDITOR`\n- `dotem hook` - A script to hook up `dotem`\n- `dotem --help` - Help\n- `dotem [COMMAND] --help` - Command help\n\n## Configuration\n\n### `.env.toml` search path\n\nBy default, `dotem` will look for the `.env.toml` file in the current working directory. If there are no `.env.toml` in the current working directory, it will check in the following order:\n\n1. Current working directory (`./env.toml`).\n2. Parent directory (`../.env.toml`)\n3. `$XDG_CONFIG_HOME/.config/dotem/.env.toml` or `$HOME/.config/dotem/.env.toml` if `$XDG_CONFIG_HOME` is not defined.\n4. `$HOME/.env.toml`\n\n### Default profiles\n\n#### The `[global]` profile\n\nThe `global` profile is a profile that always gets loaded whenever you call `dotem load [profile]`.\n\n#### The `[default]` profile\n\nIf the profile in `dotem load [profile]` is empty, dotem will load the `default` profile. If a `default` profile is not set, it will raise an error.\n\n### Environment variable inheritance\n\n`dotem` supports environment variable inheritance. Suppose we have the following `.env.toml` file:\n\n```toml\n[development]\nAPI_KEY = \"...\"\nDATABASE_URL = \"...\"\n\n[development.zone-a]\nZONE_A_SECRET_USERNAME = \"...\"\nZONE_A_SECRET_PASSWORD = \"...\"\n\n[development.zone-b]\nZONE_B_SECRET_USERNAME = \"...\"\nZONE_B_SECRET_PASSWORD = \"...\"\n```\n\nRunning the command `dotem load development.zone-a` will load the parent's environment variables `development` and the child `zone-a`:\n\n- `API_KEY = \"...\"`\n- `DATABASE_URL = \"...\"`\n- `ZONE_A_SECRET_USERNAME = \"...\"`\n- `ZONE_A_SECRET_PASSWORD = \"...\"`\n\n\u003e [!NOTE]  \n\u003e If two of the same environment variable is set in the parent and child profile, dotem will use the environment variable set in the child's profile instead.\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Please feel free to submit a pull request or open an issue.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanhwanglim%2Fdotem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanhwanglim%2Fdotem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanhwanglim%2Fdotem/lists"}