kaiju-config-validator


Namekaiju-config-validator JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/violet-black/kaiju-config-validator
SummaryApplication config validation library using JSONSchema
upload_time2024-04-25 12:37:48
maintainerNone
docs_urlNone
authorvioletblackdev@gmail.com
requires_python>=3.12
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![pypi](https://img.shields.io/pypi/v/kaiju-config-validator.svg)](https://pypi.python.org/pypi/kaiju-config-validator/)
[![codecov](https://codecov.io/gh/violet-black/kaiju-config-validator/graph/badge.svg?token=FEUUMQELFX)](https://codecov.io/gh/violet-black/kaiju-config-validator)
[![tests](https://github.com/violet-black/kaiju-config-validator/actions/workflows/tests.yaml/badge.svg)](https://github.com/violet-black/kaiju-config-validator/actions/workflows/tests.yaml)
[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

[![python](https://img.shields.io/pypi/pyversions/kaiju-config-validator.svg)](https://pypi.python.org/pypi/kaiju-config-validator/)

**kaiju-config-validator** is designed to work with [kaiju-app](https://kaiju-app.readthedocs.io) library to validate
project configuration dictionary for a set of application service classes. It analyzes `__init__` methods of services
to check the input data before creating an app object.

[fastjsonschema](https://github.com/horejsek/python-fastjsonschema) library is used to validate JSONSchema files.

# Installation

With pip and python 3.12+:

```bash
pip3 install kaiju-config-validator
```

# How to use

The configuration process is straightforward.
Use the standard application configuration process as described in the [kaiju-app documentation](https://kaiju-app.readthedocs.io).

```python
from kaiju_config_validator import ConfigValidator
from kaiju_app import Application, ApplicationLoader, Configurator

loader = ApplicationLoader()
loader.service_classes[...] = ...
config = Configurator().create_configuration([...], [...])
```

As soon as a project config dict is produced you can pass it to the validator method along with service classes
map and an application class. The validator will either raise a `InvalidConfiguration` or return `None` if everything
is fine.

```python
ConfigValidator().validate_project_config(Application, loader.service_classes, config)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/violet-black/kaiju-config-validator",
    "name": "kaiju-config-validator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": null,
    "author": "violetblackdev@gmail.com",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "[![pypi](https://img.shields.io/pypi/v/kaiju-config-validator.svg)](https://pypi.python.org/pypi/kaiju-config-validator/)\n[![codecov](https://codecov.io/gh/violet-black/kaiju-config-validator/graph/badge.svg?token=FEUUMQELFX)](https://codecov.io/gh/violet-black/kaiju-config-validator)\n[![tests](https://github.com/violet-black/kaiju-config-validator/actions/workflows/tests.yaml/badge.svg)](https://github.com/violet-black/kaiju-config-validator/actions/workflows/tests.yaml)\n[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[![python](https://img.shields.io/pypi/pyversions/kaiju-config-validator.svg)](https://pypi.python.org/pypi/kaiju-config-validator/)\n\n**kaiju-config-validator** is designed to work with [kaiju-app](https://kaiju-app.readthedocs.io) library to validate\nproject configuration dictionary for a set of application service classes. It analyzes `__init__` methods of services\nto check the input data before creating an app object.\n\n[fastjsonschema](https://github.com/horejsek/python-fastjsonschema) library is used to validate JSONSchema files.\n\n# Installation\n\nWith pip and python 3.12+:\n\n```bash\npip3 install kaiju-config-validator\n```\n\n# How to use\n\nThe configuration process is straightforward.\nUse the standard application configuration process as described in the [kaiju-app documentation](https://kaiju-app.readthedocs.io).\n\n```python\nfrom kaiju_config_validator import ConfigValidator\nfrom kaiju_app import Application, ApplicationLoader, Configurator\n\nloader = ApplicationLoader()\nloader.service_classes[...] = ...\nconfig = Configurator().create_configuration([...], [...])\n```\n\nAs soon as a project config dict is produced you can pass it to the validator method along with service classes\nmap and an application class. The validator will either raise a `InvalidConfiguration` or return `None` if everything\nis fine.\n\n```python\nConfigValidator().validate_project_config(Application, loader.service_classes, config)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Application config validation library using JSONSchema",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/violet-black/kaiju-config-validator"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3acdf16f5aa0d554215fdb775bf59be11e3e4eacd5ddff820e8481bee26fa18d",
                "md5": "74eb85b7265f0e22091db62d98f0ac76",
                "sha256": "4130bc887aa5f4292d60d7ad6921338cc72720efa76c2d20cba24fb606a0fc64"
            },
            "downloads": -1,
            "filename": "kaiju_config_validator-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "74eb85b7265f0e22091db62d98f0ac76",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 3874,
            "upload_time": "2024-04-25T12:37:48",
            "upload_time_iso_8601": "2024-04-25T12:37:48.573170Z",
            "url": "https://files.pythonhosted.org/packages/3a/cd/f16f5aa0d554215fdb775bf59be11e3e4eacd5ddff820e8481bee26fa18d/kaiju_config_validator-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 12:37:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "violet-black",
    "github_project": "kaiju-config-validator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "kaiju-config-validator"
}
        
Elapsed time: 0.56590s