configcraft


Nameconfigcraft JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA Python library for DRY configuration management with inheritance patterns and secure configuration merging.
upload_time2025-08-17 21:59:50
maintainerSanhe Hu
docs_urlNone
authorSanhe Hu
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            
.. image:: https://readthedocs.org/projects/configcraft/badge/?version=latest
    :target: https://configcraft.readthedocs.io/en/latest/
    :alt: Documentation Status

.. image:: https://github.com/MacHu-GWU/configcraft-project/actions/workflows/main.yml/badge.svg
    :target: https://github.com/MacHu-GWU/configcraft-project/actions?query=workflow:CI

.. image:: https://codecov.io/gh/MacHu-GWU/configcraft-project/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/MacHu-GWU/configcraft-project

.. image:: https://img.shields.io/pypi/v/configcraft.svg
    :target: https://pypi.python.org/pypi/configcraft

.. image:: https://img.shields.io/pypi/l/configcraft.svg
    :target: https://pypi.python.org/pypi/configcraft

.. image:: https://img.shields.io/pypi/pyversions/configcraft.svg
    :target: https://pypi.python.org/pypi/configcraft

.. image:: https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github
    :target: https://github.com/MacHu-GWU/configcraft-project/blob/main/release-history.rst

.. image:: https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
    :target: https://github.com/MacHu-GWU/configcraft-project

------

.. image:: https://img.shields.io/badge/Link-API-blue.svg
    :target: https://configcraft.readthedocs.io/en/latest/py-modindex.html

.. image:: https://img.shields.io/badge/Link-Install-blue.svg
    :target: `install`_

.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg
    :target: https://github.com/MacHu-GWU/configcraft-project

.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg
    :target: https://github.com/MacHu-GWU/configcraft-project/issues

.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg
    :target: https://github.com/MacHu-GWU/configcraft-project/issues

.. image:: https://img.shields.io/badge/Link-Download-blue.svg
    :target: https://pypi.org/pypi/configcraft#files


Welcome to ``configcraft`` Documentation
==============================================================================
.. image:: https://configcraft.readthedocs.io/en/latest/_static/configcraft-logo.png
    :target: https://configcraft.readthedocs.io/en/latest/

A Python library for DRY (Do not repeat yourself) configuration management with inheritance patterns and secure configuration merging.

📚 Full documentation is available at `HERE <https://configcraft.readthedocs.io/en/latest/>`_

**Key Features:**

- **🔄 Configuration Inheritance**: Use ``_shared`` sections to eliminate duplication across environments
- **🔒 Secure Config Merging**: Safely combine non-sensitive config with secrets without exposing credentials
- **🎯 JSON Path Patterns**: Apply defaults with flexible ``*.field`` and ``env.field`` patterns
- **📋 List Merging**: Intelligently merge lists by position to maintain data relationships
- **🛡️ Type Safety**: Structure-aware merging with validation and clear error messages


Quick Example
------------------------------------------------------------------------------
**Configuration Inheritance:**

.. code-block:: python

    from configcraft.api import apply_inheritance

    config = {
        "_shared": {
            "*.port": 8080,
            "*.timeout": 30
        },
        "dev": {
            "host": "localhost"
        },
        "prod": {
            "host": "api.company.com", 
            "port": 443
        }
    }

    apply_inheritance(config)
    # Result:
    # {
    #     "dev": {
    #         "host": "localhost", 
    #         "port": 8080, 
    #         "timeout": 30
    #     },
    #     "prod": {
    #         "host": "api.company.com", 
    #         "port": 443, 
    #         "timeout": 30
    #     }
    # }

**Secure Configuration Merging:**

.. code-block:: python

    from configcraft.api import deep_merge

    # config.json (safe to commit)
    base_config = {
        "database": {
            "host": "prod-db.com", 
            "port": 5432
        }
    }

    # secrets.json (never commit)
    secrets = {
        "database": {
            "password": "secret123"
        }
    }

    final_config = deep_merge(base_config, secrets)
    # Result:
    # {
    #     "database": {
    #         "host": "prod-db.com", 
    #         "port": 5432,
    #         "password": "secret123"
    #     }
    # }


.. _install:

Install
------------------------------------------------------------------------------

``configcraft`` is released on PyPI, so all you need is to:

.. code-block:: console

    $ pip install configcraft

To upgrade to latest version:

.. code-block:: console

    $ pip install --upgrade configcraft


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "configcraft",
    "maintainer": "Sanhe Hu",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "husanhe@email.com",
    "keywords": null,
    "author": "Sanhe Hu",
    "author_email": "husanhe@email.com",
    "download_url": "https://files.pythonhosted.org/packages/a2/06/eb2228536dd209008a34e0268060597b8896c36fc54404db493a334d9f4c/configcraft-0.1.1.tar.gz",
    "platform": null,
    "description": "\n.. image:: https://readthedocs.org/projects/configcraft/badge/?version=latest\n    :target: https://configcraft.readthedocs.io/en/latest/\n    :alt: Documentation Status\n\n.. image:: https://github.com/MacHu-GWU/configcraft-project/actions/workflows/main.yml/badge.svg\n    :target: https://github.com/MacHu-GWU/configcraft-project/actions?query=workflow:CI\n\n.. image:: https://codecov.io/gh/MacHu-GWU/configcraft-project/branch/main/graph/badge.svg\n    :target: https://codecov.io/gh/MacHu-GWU/configcraft-project\n\n.. image:: https://img.shields.io/pypi/v/configcraft.svg\n    :target: https://pypi.python.org/pypi/configcraft\n\n.. image:: https://img.shields.io/pypi/l/configcraft.svg\n    :target: https://pypi.python.org/pypi/configcraft\n\n.. image:: https://img.shields.io/pypi/pyversions/configcraft.svg\n    :target: https://pypi.python.org/pypi/configcraft\n\n.. image:: https://img.shields.io/badge/\u270d\ufe0f_Release_History!--None.svg?style=social&logo=github\n    :target: https://github.com/MacHu-GWU/configcraft-project/blob/main/release-history.rst\n\n.. image:: https://img.shields.io/badge/\u2b50_Star_me_on_GitHub!--None.svg?style=social&logo=github\n    :target: https://github.com/MacHu-GWU/configcraft-project\n\n------\n\n.. image:: https://img.shields.io/badge/Link-API-blue.svg\n    :target: https://configcraft.readthedocs.io/en/latest/py-modindex.html\n\n.. image:: https://img.shields.io/badge/Link-Install-blue.svg\n    :target: `install`_\n\n.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg\n    :target: https://github.com/MacHu-GWU/configcraft-project\n\n.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg\n    :target: https://github.com/MacHu-GWU/configcraft-project/issues\n\n.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg\n    :target: https://github.com/MacHu-GWU/configcraft-project/issues\n\n.. image:: https://img.shields.io/badge/Link-Download-blue.svg\n    :target: https://pypi.org/pypi/configcraft#files\n\n\nWelcome to ``configcraft`` Documentation\n==============================================================================\n.. image:: https://configcraft.readthedocs.io/en/latest/_static/configcraft-logo.png\n    :target: https://configcraft.readthedocs.io/en/latest/\n\nA Python library for DRY (Do not repeat yourself) configuration management with inheritance patterns and secure configuration merging.\n\n\ud83d\udcda Full documentation is available at `HERE <https://configcraft.readthedocs.io/en/latest/>`_\n\n**Key Features:**\n\n- **\ud83d\udd04 Configuration Inheritance**: Use ``_shared`` sections to eliminate duplication across environments\n- **\ud83d\udd12 Secure Config Merging**: Safely combine non-sensitive config with secrets without exposing credentials\n- **\ud83c\udfaf JSON Path Patterns**: Apply defaults with flexible ``*.field`` and ``env.field`` patterns\n- **\ud83d\udccb List Merging**: Intelligently merge lists by position to maintain data relationships\n- **\ud83d\udee1\ufe0f Type Safety**: Structure-aware merging with validation and clear error messages\n\n\nQuick Example\n------------------------------------------------------------------------------\n**Configuration Inheritance:**\n\n.. code-block:: python\n\n    from configcraft.api import apply_inheritance\n\n    config = {\n        \"_shared\": {\n            \"*.port\": 8080,\n            \"*.timeout\": 30\n        },\n        \"dev\": {\n            \"host\": \"localhost\"\n        },\n        \"prod\": {\n            \"host\": \"api.company.com\", \n            \"port\": 443\n        }\n    }\n\n    apply_inheritance(config)\n    # Result:\n    # {\n    #     \"dev\": {\n    #         \"host\": \"localhost\", \n    #         \"port\": 8080, \n    #         \"timeout\": 30\n    #     },\n    #     \"prod\": {\n    #         \"host\": \"api.company.com\", \n    #         \"port\": 443, \n    #         \"timeout\": 30\n    #     }\n    # }\n\n**Secure Configuration Merging:**\n\n.. code-block:: python\n\n    from configcraft.api import deep_merge\n\n    # config.json (safe to commit)\n    base_config = {\n        \"database\": {\n            \"host\": \"prod-db.com\", \n            \"port\": 5432\n        }\n    }\n\n    # secrets.json (never commit)\n    secrets = {\n        \"database\": {\n            \"password\": \"secret123\"\n        }\n    }\n\n    final_config = deep_merge(base_config, secrets)\n    # Result:\n    # {\n    #     \"database\": {\n    #         \"host\": \"prod-db.com\", \n    #         \"port\": 5432,\n    #         \"password\": \"secret123\"\n    #     }\n    # }\n\n\n.. _install:\n\nInstall\n------------------------------------------------------------------------------\n\n``configcraft`` is released on PyPI, so all you need is to:\n\n.. code-block:: console\n\n    $ pip install configcraft\n\nTo upgrade to latest version:\n\n.. code-block:: console\n\n    $ pip install --upgrade configcraft\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for DRY configuration management with inheritance patterns and secure configuration merging.",
    "version": "0.1.1",
    "project_urls": {
        "Changelog": "https://github.com/MacHu-GWU/configcraft-project/blob/main/release-history.rst",
        "Documentation": "https://configcraft.readthedocs.io/en/latest/",
        "Download": "https://pypi.org/pypi/configcraft#files",
        "Homepage": "https://github.com/MacHu-GWU/configcraft-project",
        "Issues": "https://github.com/MacHu-GWU/configcraft-project/issues",
        "Repository": "https://github.com/MacHu-GWU/configcraft-project"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "89e542d07b274a4e09b509318729dd36fa29a75b3b2410155c2998d69ad93d1c",
                "md5": "954aa09bfd2b3728e4e5a28434fab1c9",
                "sha256": "c7de7de7dee51a196c4528bc190b028a86de381e0ae235c8c59cdde64f6726d2"
            },
            "downloads": -1,
            "filename": "configcraft-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "954aa09bfd2b3728e4e5a28434fab1c9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 14437,
            "upload_time": "2025-08-17T21:59:49",
            "upload_time_iso_8601": "2025-08-17T21:59:49.029802Z",
            "url": "https://files.pythonhosted.org/packages/89/e5/42d07b274a4e09b509318729dd36fa29a75b3b2410155c2998d69ad93d1c/configcraft-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a206eb2228536dd209008a34e0268060597b8896c36fc54404db493a334d9f4c",
                "md5": "8d65ebf7cef0dc17563efa4e69fa797c",
                "sha256": "10ade1a8dab3e67b556a3d92cc4e0d4bb20ae0e7151f75175ef54a198f2bbd6c"
            },
            "downloads": -1,
            "filename": "configcraft-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8d65ebf7cef0dc17563efa4e69fa797c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 13851,
            "upload_time": "2025-08-17T21:59:50",
            "upload_time_iso_8601": "2025-08-17T21:59:50.465233Z",
            "url": "https://files.pythonhosted.org/packages/a2/06/eb2228536dd209008a34e0268060597b8896c36fc54404db493a334d9f4c/configcraft-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 21:59:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MacHu-GWU",
    "github_project": "configcraft-project",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "configcraft"
}
        
Elapsed time: 1.12342s