confit2canard


Nameconfit2canard JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryMinimalistic configuration library with encryption and a tasty name
upload_time2024-11-06 13:46:57
maintainerBenjamin Hirschfield
docs_urlNone
authorBenjamin Hirschfield
requires_python<4.0,>=3.9
licenseMIT
keywords configuration
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![CircleCI](https://dl.circleci.com/status-badge/img/gh/dolead/confit2canard/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/dolead/confit2canard/tree/main) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/76833f3568f2479d8470a7320429cbfe)](https://app.codacy.com/gh/dolead/confit2canard/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

# Confit2Canard 🦆

Minimalistic library to load settings from JSON and YAML files that also
provides configuration encryption with AES-GCM.

[The history of the confit de canard](https://en.wikipedia.org/wiki/Duck_confit).

## How to use

Configuration files written to a relative path:
```yaml
# app.yml
title: How to cook?
```

```yaml
# production/tokens.yml
api:
  token: AZERTY1234
```

```yaml
# production/secrets.yml
$Vault;UZXhoxTumLPE6zkT;kRg9bGtmKFn/BeFODX5+;zFgpPMrgxAaVQW6Wv5Q6Ow==
```

The script:

```python
# main.py
from confit2canard import Config

passkey = "ThisIsSupposedToBeAKey0000000000"
configuration_files = ["app.yml",
                       "production/tokens.yml",
                       "production/secrets.yml"]
configuration = Config(configuration_files, passkey=passkey)

print(configurgation.title)
print(configurgation.find("api.token"))
```

The configuration files can be JSON or YAML.

## Command line tool

The `VAULT_PASSKEY` environment variable must be set to write encrypted
configuration with a AES-GCM key:

```shell
VAULT_PASSKEY="ThisIsSupposedToBeAKey0000000000" python \
  -m confit2canard production/secrets.yml
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "confit2canard",
    "maintainer": "Benjamin Hirschfield",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "benjamin.hirschfield@dolead.com",
    "keywords": "configuration",
    "author": "Benjamin Hirschfield",
    "author_email": "benjamin.hirschfield@dolead.com",
    "download_url": "https://files.pythonhosted.org/packages/6b/09/ecda26c7ce554fcd97779bdef0b096a2d2ae05b36c1f7a511337916b07d9/confit2canard-0.1.1.tar.gz",
    "platform": null,
    "description": "[![CircleCI](https://dl.circleci.com/status-badge/img/gh/dolead/confit2canard/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/dolead/confit2canard/tree/main) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/76833f3568f2479d8470a7320429cbfe)](https://app.codacy.com/gh/dolead/confit2canard/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n\n# Confit2Canard \ud83e\udd86\n\nMinimalistic library to load settings from JSON and YAML files that also\nprovides configuration encryption with AES-GCM.\n\n[The history of the confit de canard](https://en.wikipedia.org/wiki/Duck_confit).\n\n## How to use\n\nConfiguration files written to a relative path:\n```yaml\n# app.yml\ntitle: How to cook?\n```\n\n```yaml\n# production/tokens.yml\napi:\n  token: AZERTY1234\n```\n\n```yaml\n# production/secrets.yml\n$Vault;UZXhoxTumLPE6zkT;kRg9bGtmKFn/BeFODX5+;zFgpPMrgxAaVQW6Wv5Q6Ow==\n```\n\nThe script:\n\n```python\n# main.py\nfrom confit2canard import Config\n\npasskey = \"ThisIsSupposedToBeAKey0000000000\"\nconfiguration_files = [\"app.yml\",\n                       \"production/tokens.yml\",\n                       \"production/secrets.yml\"]\nconfiguration = Config(configuration_files, passkey=passkey)\n\nprint(configurgation.title)\nprint(configurgation.find(\"api.token\"))\n```\n\nThe configuration files can be JSON or YAML.\n\n## Command line tool\n\nThe `VAULT_PASSKEY` environment variable must be set to write encrypted\nconfiguration with a AES-GCM key:\n\n```shell\nVAULT_PASSKEY=\"ThisIsSupposedToBeAKey0000000000\" python \\\n  -m confit2canard production/secrets.yml\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Minimalistic configuration library with encryption and a tasty name",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "configuration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e313d92645e3419b490dfd66ccf406c005cfb8068cc3c6659e5e90de430c3aa3",
                "md5": "b514c80ac587d90d1f495419b2cdb414",
                "sha256": "48054e22acb447d5390d570ab7257aed5c1f48fed63d753a7be75ec6a2927967"
            },
            "downloads": -1,
            "filename": "confit2canard-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b514c80ac587d90d1f495419b2cdb414",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 6234,
            "upload_time": "2024-11-06T13:46:56",
            "upload_time_iso_8601": "2024-11-06T13:46:56.386685Z",
            "url": "https://files.pythonhosted.org/packages/e3/13/d92645e3419b490dfd66ccf406c005cfb8068cc3c6659e5e90de430c3aa3/confit2canard-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b09ecda26c7ce554fcd97779bdef0b096a2d2ae05b36c1f7a511337916b07d9",
                "md5": "aba7e0550012b60b9586b936e4ea1297",
                "sha256": "bc99113311bd62c9fc41827e85a790e39656b521b1eab9f1f9efc545766d784e"
            },
            "downloads": -1,
            "filename": "confit2canard-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "aba7e0550012b60b9586b936e4ea1297",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 4896,
            "upload_time": "2024-11-06T13:46:57",
            "upload_time_iso_8601": "2024-11-06T13:46:57.817503Z",
            "url": "https://files.pythonhosted.org/packages/6b/09/ecda26c7ce554fcd97779bdef0b096a2d2ae05b36c1f7a511337916b07d9/confit2canard-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-06 13:46:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "confit2canard"
}
        
Elapsed time: 0.32131s