# Enventory
**Enventory** is a lightweight Python utility for accessing environment variables from the system with optional type casting, defaults, and required flags.
---
## Features
* Access environment variables from the system with simple, clean API.
* Retrieve environment variables with default values, type casting, and required checks.
* Helper functions for casting strings to booleans or lists.
* Raises clear errors when required environment variables are missing.
* Compatible with Python 3.8+.
---
## Installation
Once published to PyPI, you can install Enventory via pip:
```bash
pip install enventory
```
Or for local development:
```bash
git clone https://github.com/yourusername/enventory.git
cd enventory
pip install -e .
```
---
## Usage
### Access Environment Variables
```python
from enventory import getenv, to_boolean, to_list
# Get a variable with optional default
db_host = getenv("DB_HOST", default="localhost")
# Get a required variable (raises ValueError if missing)
secret_key = getenv("SECRET_KEY", required=True)
# Cast a variable to boolean
debug_mode = getenv("DEBUG", default="False", cast=to_boolean)
# Cast a comma-separated variable to a list
allowed_hosts = getenv("ALLOWED_HOSTS", default="", cast=to_list)
```
### Helper Functions
```python
from enventory import to_boolean, to_list
to_boolean("yes") # True
to_boolean("0") # False
to_list("a,b,c") # ['a', 'b', 'c']
to_list("a;b;c", separator=";") # ['a', 'b', 'c']
```
---
## Error Handling
* `ValueError` is raised by `getenv` if a required environment variable is missing.
---
## Project Structure
```
enventory/
├── setup.py
├── pyproject.toml
├── README.md
└── enventory/
├── __init__.py # exposes env.py
└── env.py # main environment utility
```
---
## Contributing
Contributions, issues, and feature requests are welcome!
1. Fork the repository
2. Create a new branch (`git checkout -b feature-name`)
3. Make your changes
4. Submit a pull request
---
## License
MIT License © Your Name
---
---
## Compatibility
* Python 3.8 and above
Raw data
{
"_id": null,
"home_page": "https://github.com/becurrie/enventory",
"name": "enventory",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "environment, env, dotenv, configuration, settings, environment-variables, config, utilities",
"author": "Bec",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/19/1e/15e911cbb82b1b164d66d5a7a92de6c521a157d6223dd00f645db887c3ec/enventory-0.0.3.tar.gz",
"platform": null,
"description": "# Enventory\n\n**Enventory** is a lightweight Python utility for accessing environment variables from the system with optional type casting, defaults, and required flags.\n\n---\n\n## Features\n\n* Access environment variables from the system with simple, clean API.\n* Retrieve environment variables with default values, type casting, and required checks.\n* Helper functions for casting strings to booleans or lists.\n* Raises clear errors when required environment variables are missing.\n* Compatible with Python 3.8+.\n\n---\n\n## Installation\n\nOnce published to PyPI, you can install Enventory via pip:\n\n```bash\npip install enventory\n```\n\nOr for local development:\n\n```bash\ngit clone https://github.com/yourusername/enventory.git\ncd enventory\npip install -e .\n```\n\n\n---\n\n## Usage\n\n### Access Environment Variables\n\n```python\nfrom enventory import getenv, to_boolean, to_list\n\n# Get a variable with optional default\ndb_host = getenv(\"DB_HOST\", default=\"localhost\")\n\n# Get a required variable (raises ValueError if missing)\nsecret_key = getenv(\"SECRET_KEY\", required=True)\n\n# Cast a variable to boolean\ndebug_mode = getenv(\"DEBUG\", default=\"False\", cast=to_boolean)\n\n# Cast a comma-separated variable to a list\nallowed_hosts = getenv(\"ALLOWED_HOSTS\", default=\"\", cast=to_list)\n```\n\n### Helper Functions\n\n```python\nfrom enventory import to_boolean, to_list\n\nto_boolean(\"yes\") # True\nto_boolean(\"0\") # False\n\nto_list(\"a,b,c\") # ['a', 'b', 'c']\nto_list(\"a;b;c\", separator=\";\") # ['a', 'b', 'c']\n```\n\n---\n\n## Error Handling\n\n* `ValueError` is raised by `getenv` if a required environment variable is missing.\n\n---\n\n## Project Structure\n\n```\nenventory/\n\u251c\u2500\u2500 setup.py\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 README.md\n\u2514\u2500\u2500 enventory/\n \u251c\u2500\u2500 __init__.py # exposes env.py\n \u2514\u2500\u2500 env.py # main environment utility\n```\n\n---\n\n## Contributing\n\nContributions, issues, and feature requests are welcome!\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature-name`)\n3. Make your changes\n4. Submit a pull request\n\n---\n\n## License\n\nMIT License \u00a9 Your Name\n\n---\n\n\n---\n\n## Compatibility\n\n* Python 3.8 and above\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A lightweight Python utility for loading and retrieving environment variables",
"version": "0.0.3",
"project_urls": {
"Bug Reports": "https://github.com/becurrie/enventory/issues",
"Documentation": "https://github.com/becurrie/enventory#readme",
"Homepage": "https://github.com/becurrie/enventory",
"Source": "https://github.com/becurrie/enventory"
},
"split_keywords": [
"environment",
" env",
" dotenv",
" configuration",
" settings",
" environment-variables",
" config",
" utilities"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e0827b352a3da3fcc55b069efe22805de5d1f33ad42ebf2f2f277a113aa69a3c",
"md5": "f2833490f27661b7a949c2758d72d5b4",
"sha256": "283ea4ffffcf4a8ed08134e80ee31479f63f8f72bc53f730743ceadc8a594ef7"
},
"downloads": -1,
"filename": "enventory-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f2833490f27661b7a949c2758d72d5b4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 3363,
"upload_time": "2025-10-25T12:54:17",
"upload_time_iso_8601": "2025-10-25T12:54:17.109404Z",
"url": "https://files.pythonhosted.org/packages/e0/82/7b352a3da3fcc55b069efe22805de5d1f33ad42ebf2f2f277a113aa69a3c/enventory-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "191e15e911cbb82b1b164d66d5a7a92de6c521a157d6223dd00f645db887c3ec",
"md5": "44a1ebcd0353eb14ad56c6752c0e2306",
"sha256": "94e307dbe9e61c80b722ba539c9f0f57e7842524036bcf82113ebd079b24f5ab"
},
"downloads": -1,
"filename": "enventory-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "44a1ebcd0353eb14ad56c6752c0e2306",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3692,
"upload_time": "2025-10-25T12:54:18",
"upload_time_iso_8601": "2025-10-25T12:54:18.417056Z",
"url": "https://files.pythonhosted.org/packages/19/1e/15e911cbb82b1b164d66d5a7a92de6c521a157d6223dd00f645db887c3ec/enventory-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-25 12:54:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "becurrie",
"github_project": "enventory",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "enventory"
}