alchemy-config


Namealchemy-config JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/IBM/alchemy-config
SummaryConfiguration framework in Python for general configuration use.
upload_time2023-04-25 21:57:01
maintainer
docs_urlNone
authorGabe Goodhart
requires_python
licenseMIT
keywords config
VCS
bugtrack_url
requirements PyYAML
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Alchemy Config
The `aconfig` library provides simple `yaml` configuration in `python` with environment-based overrides.

## Installation

To install, simply use `pip`

```sh
pip install alchemy-config
```

## Quick Start

**config.yaml**
```yaml
foo: 1
bar:
    baz: "bat"
```

**main.py**
```py
import aconfig

if __name__ == "__main__":
    config = aconfig.Config.from_yaml("config.yaml")
    print(config.foo)
    print(config.bar.baz)
```

```sh
export BAR_BAZ="buz"
python3 main.py
```

## Corner-case Behavior

You CAN set builtin method names as attributes on the `config`. However, you should only access/delete them via dictionary access methods.

For example:

```py
import aconfig
cfg = {"update": True}

config = aconfig.Config(cfg)

# DO NOT DO THIS:
config.update

# DO THIS INSTEAD:
config["update"]
```

This is because there is no way in Python to tell whether you want the method or the attribute `"update"` when "getting" it from the object.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/IBM/alchemy-config",
    "name": "alchemy-config",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "config",
    "author": "Gabe Goodhart",
    "author_email": "gabe.l.hart@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/5c/059426cbfaa6f7e3c3859b11e6454dc20f84817223fa5d44eea852a76a2b/alchemy-config-1.1.1.tar.gz",
    "platform": null,
    "description": "# Alchemy Config\nThe `aconfig` library provides simple `yaml` configuration in `python` with environment-based overrides.\n\n## Installation\n\nTo install, simply use `pip`\n\n```sh\npip install alchemy-config\n```\n\n## Quick Start\n\n**config.yaml**\n```yaml\nfoo: 1\nbar:\n    baz: \"bat\"\n```\n\n**main.py**\n```py\nimport aconfig\n\nif __name__ == \"__main__\":\n    config = aconfig.Config.from_yaml(\"config.yaml\")\n    print(config.foo)\n    print(config.bar.baz)\n```\n\n```sh\nexport BAR_BAZ=\"buz\"\npython3 main.py\n```\n\n## Corner-case Behavior\n\nYou CAN set builtin method names as attributes on the `config`. However, you should only access/delete them via dictionary access methods.\n\nFor example:\n\n```py\nimport aconfig\ncfg = {\"update\": True}\n\nconfig = aconfig.Config(cfg)\n\n# DO NOT DO THIS:\nconfig.update\n\n# DO THIS INSTEAD:\nconfig[\"update\"]\n```\n\nThis is because there is no way in Python to tell whether you want the method or the attribute `\"update\"` when \"getting\" it from the object.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Configuration framework in Python for general configuration use.",
    "version": "1.1.1",
    "split_keywords": [
        "config"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5765607a2becc4c54620a8baaa1ebef41229a4e34b052a6952bdde9a92231e68",
                "md5": "8d488761092b0a22a06d68b9cb1dd6f5",
                "sha256": "757d7218c13162d14e8e228abf14b94f0d907892728e5a913426c8c5f093473d"
            },
            "downloads": -1,
            "filename": "alchemy_config-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8d488761092b0a22a06d68b9cb1dd6f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7191,
            "upload_time": "2023-04-25T21:57:00",
            "upload_time_iso_8601": "2023-04-25T21:57:00.159470Z",
            "url": "https://files.pythonhosted.org/packages/57/65/607a2becc4c54620a8baaa1ebef41229a4e34b052a6952bdde9a92231e68/alchemy_config-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c75c059426cbfaa6f7e3c3859b11e6454dc20f84817223fa5d44eea852a76a2b",
                "md5": "259250dc406dc0419d9d41e9d48f6be3",
                "sha256": "ed6b56c4a538056ba2d1cb26878bdb0be6dc466840bebedf654bc12fa0b35aae"
            },
            "downloads": -1,
            "filename": "alchemy-config-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "259250dc406dc0419d9d41e9d48f6be3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10281,
            "upload_time": "2023-04-25T21:57:01",
            "upload_time_iso_8601": "2023-04-25T21:57:01.862068Z",
            "url": "https://files.pythonhosted.org/packages/c7/5c/059426cbfaa6f7e3c3859b11e6454dc20f84817223fa5d44eea852a76a2b/alchemy-config-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-25 21:57:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "IBM",
    "github_project": "alchemy-config",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "PyYAML",
            "specs": [
                [
                    ">=",
                    "5.3.1"
                ]
            ]
        }
    ],
    "lcname": "alchemy-config"
}
        
Elapsed time: 0.53564s