loadconfig


Nameloadconfig JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryTool to simplify config management in a program
upload_time2025-10-07 23:26:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseThe MIT License (MIT) Copyright (c) 2015-2025, Daniel Mizyrycki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords config yaml clg command-line argparse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # loadconfig

[![Docs](https://readthedocs.org/projects/loadconfig/badge/?version=latest&style=flat)](https://loadconfig.readthedocs.org)
[![Pypi package](https://img.shields.io/pypi/pyversions/loadconfig.svg)](https://pypi.python.org/pypi/loadconfig)
[![Tests](https://github.com/mzdaniel/loadconfig/actions/workflows/release.yml/badge.svg)](https://github.com/mzdaniel/loadconfig/actions/workflows/release.yml)

---


## A tool to simplify configuration management

We live in an incredible moment in software history. As never before, the
quality and quantity of excellent open source software have unleashed massive
advances in pretty much all fields of human knowledge. It is overwhelming to
have such vast posibilities, and often having a hard time trying to understand
how the pieces fit together. More importantly, we are concern on how can we use
the software for things that matter to us.

Plenty of times we find what is really needed is a small custom configuration
we can easily understand and a handful ways to run the software. And although
we barely think about it as we are too busy trying to understand all the bells
and whistles, the interface and documentation is at the center of any software.

loadconfig syntax is designed to be clean and DRY, to foster descriptive
programming, and to leverage version control systems. loadconfig can be used
as a light wrapper around programs to make them behave and to document them
the way we designed.

    >>> from loadconfig import Config
    >>> c = Config('greeter: Hi there')
    >>> c
    {greeter: Hi there}

    >>> c.greeter
    'Hi there'

    $ loadconfig -E="greeter: Welcome to the loadconfig documentation"
    export GREETER="Welcome to the loadconfig documentation"


## Technical description

loadconfig dynamically creates a python configuration ordered dictionary from
sources like the command line, configuration files and yaml strings that can
be used in python code and shell scripts. Dependencies are pyyaml and clg.


## Installation

Installation is straightforward using a wheel from pypi:

    pip install loadconfig

Alternatively, install from github:

    pip install git+https://github.com/mzdaniel/loadconfig


## Local test and build

Assumptions for this section: A unix system, python >= 3.11, and pip >= 24.3

loadconfig is hosted on github:

    # Download the project using git
    git clone https://github.com/mzdaniel/loadconfig
    cd loadconfig

    # or from the source tarball from github, first finding the latest tag
    # released on https://github.com/mzdaniel/loadconfig/releases/latest
    wget -O- https://github.com/mzdaniel/loadconfig/archive/0.2.0.tar.gz | tar xz
    cd loadconfig

!!! note ""
	loadconfig tests are exhaustive and also tests described in the documentation
	are exercised to have confidence loadconfig code is as reliable as posible.

	python programs and libraries depend on the environment where it is run.
	At a minimun, it is adviced to run the tests and build process in a
	venv (python virtual environment)

<!-- -->

    # Create and activate venv (python virtual environment)
    python -m venv build/venv
    source build/venv/bin/activate

    # Install loadconfig dependencies and pytest with coverage and linting
    pip install 'clg>=3.3' 'PyYAML>=6.0.2' 'pytest-cov>=6.2.1' 'pytest-ruff>=0.5'

    # Run the tests
    pytest


Building loadconfig pip installable wheel (on build/wheel) is as easy as:

    pip wheel -w build/wheel .


To test and build (on build/site) loadconfig documentation:

    pip install 'mkdocs>=1.6.1' 'mkdocs-codeinclude-plugin>=0.2.1'
    mkdocs build

If you are curious, since loadconfig 0.1.2, [github actions CI][] continuos integration
server shows the test runs for each commit and pull requests done in the loadconfig repo.

[github actions CI]: https://github.com/mzdaniel/loadconfig/actions/workflows/test.yml


## Security

Disclosure: loadconfig is meant for both flexibility and productivity.
It does not attempt to be safe with untrusted input. There are ways (linux
containers, PyPy’s sandboxing) that can be implemented for such environments
and left for the user to consider.


## Thanks!

* [Guido van Rossum][] and [Linus Torvalds][]
* [Raymond Hettinger][] and Armin Ronacher for [OrderedDict][]
* Clark Evans and Kirill Simonov for [YAML][] and [PyYAML][] implementation
* Steven Bethard and François Ménabé for [argparse][] and [CLG][] implementations
* Holger Krekel for [pytest][]
* David Goodger and Georg Brandl for [reStructuredText][] and [Sphinx][]
* John Gruber and Tom Christie for [markdown][] and [Mkdocs][]
* Solomon Hykes, Jerome Petazzoni and Sam Alba for [Docker][]
* The awesome Python, Linux and Git communities


[Guido van Rossum]: http://en.wikipedia.org/wiki/Guido_van_Rossum
[Linus Torvalds]: http://en.wikipedia.org/wiki/Linus_Torvalds
[Raymond Hettinger]: https://www.youtube.com/watch?v=p33CVV29OG8
[yaml]: https://yaml.org/spec/1.1
[pyyaml]: http://pyyaml.org/wiki/PyYAMLDocumentation
[OrderedDict]: https://www.python.org/dev/peps/pep-0372
[argparse]: https://docs.python.org/3/library/argparse.html
[CLG]: https://clg.readthedocs.org
[docker]: https://www.docker.com
[pytest]: https://docs.pytest.org
[reStructuredText]: http://sphinx-doc.org/rest.html
[Sphinx]: http://sphinx-doc.org/tutorial.html
[markdown]: https://daringfireball.net/projects/markdown
[Mkdocs]: https://www.mkdocs.org

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "loadconfig",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "config, yaml, clg, command-line, argparse",
    "author": null,
    "author_email": "Daniel Mizyrycki <mzdaniel@glidelink.net>",
    "download_url": null,
    "platform": null,
    "description": "# loadconfig\n\n[![Docs](https://readthedocs.org/projects/loadconfig/badge/?version=latest&style=flat)](https://loadconfig.readthedocs.org)\n[![Pypi package](https://img.shields.io/pypi/pyversions/loadconfig.svg)](https://pypi.python.org/pypi/loadconfig)\n[![Tests](https://github.com/mzdaniel/loadconfig/actions/workflows/release.yml/badge.svg)](https://github.com/mzdaniel/loadconfig/actions/workflows/release.yml)\n\n---\n\n\n## A tool to simplify configuration management\n\nWe live in an incredible moment in software history. As never before, the\nquality and quantity of excellent open source software have unleashed massive\nadvances in pretty much all fields of human knowledge. It is overwhelming to\nhave such vast posibilities, and often having a hard time trying to understand\nhow the pieces fit together. More importantly, we are concern on how can we use\nthe software for things that matter to us.\n\nPlenty of times we find what is really needed is a small custom configuration\nwe can easily understand and a handful ways to run the software. And although\nwe barely think about it as we are too busy trying to understand all the bells\nand whistles, the interface and documentation is at the center of any software.\n\nloadconfig syntax is designed to be clean and DRY, to foster descriptive\nprogramming, and to leverage version control systems. loadconfig can be used\nas a light wrapper around programs to make them behave and to document them\nthe way we designed.\n\n    >>> from loadconfig import Config\n    >>> c = Config('greeter: Hi there')\n    >>> c\n    {greeter: Hi there}\n\n    >>> c.greeter\n    'Hi there'\n\n    $ loadconfig -E=\"greeter: Welcome to the loadconfig documentation\"\n    export GREETER=\"Welcome to the loadconfig documentation\"\n\n\n## Technical description\n\nloadconfig dynamically creates a python configuration ordered dictionary from\nsources like the command line, configuration files and yaml strings that can\nbe used in python code and shell scripts. Dependencies are pyyaml and clg.\n\n\n## Installation\n\nInstallation is straightforward using a wheel from pypi:\n\n    pip install loadconfig\n\nAlternatively, install from github:\n\n    pip install git+https://github.com/mzdaniel/loadconfig\n\n\n## Local test and build\n\nAssumptions for this section: A unix system, python >= 3.11, and pip >= 24.3\n\nloadconfig is hosted on github:\n\n    # Download the project using git\n    git clone https://github.com/mzdaniel/loadconfig\n    cd loadconfig\n\n    # or from the source tarball from github, first finding the latest tag\n    # released on https://github.com/mzdaniel/loadconfig/releases/latest\n    wget -O- https://github.com/mzdaniel/loadconfig/archive/0.2.0.tar.gz | tar xz\n    cd loadconfig\n\n!!! note \"\"\n\tloadconfig tests are exhaustive and also tests described in the documentation\n\tare exercised to have confidence loadconfig code is as reliable as posible.\n\n\tpython programs and libraries depend on the environment where it is run.\n\tAt a minimun, it is adviced to run the tests and build process in a\n\tvenv (python virtual environment)\n\n<!-- -->\n\n    # Create and activate venv (python virtual environment)\n    python -m venv build/venv\n    source build/venv/bin/activate\n\n    # Install loadconfig dependencies and pytest with coverage and linting\n    pip install 'clg>=3.3' 'PyYAML>=6.0.2' 'pytest-cov>=6.2.1' 'pytest-ruff>=0.5'\n\n    # Run the tests\n    pytest\n\n\nBuilding loadconfig pip installable wheel (on build/wheel) is as easy as:\n\n    pip wheel -w build/wheel .\n\n\nTo test and build (on build/site) loadconfig documentation:\n\n    pip install 'mkdocs>=1.6.1' 'mkdocs-codeinclude-plugin>=0.2.1'\n    mkdocs build\n\nIf you are curious, since loadconfig 0.1.2, [github actions CI][] continuos integration\nserver shows the test runs for each commit and pull requests done in the loadconfig repo.\n\n[github actions CI]: https://github.com/mzdaniel/loadconfig/actions/workflows/test.yml\n\n\n## Security\n\nDisclosure: loadconfig is meant for both flexibility and productivity.\nIt does not attempt to be safe with untrusted input. There are ways (linux\ncontainers, PyPy\u2019s sandboxing) that can be implemented for such environments\nand left for the user to consider.\n\n\n## Thanks!\n\n* [Guido van Rossum][] and [Linus Torvalds][]\n* [Raymond Hettinger][] and Armin Ronacher for [OrderedDict][]\n* Clark Evans and Kirill Simonov for [YAML][] and [PyYAML][] implementation\n* Steven Bethard and Fran\u00e7ois M\u00e9nab\u00e9 for [argparse][] and [CLG][] implementations\n* Holger Krekel for [pytest][]\n* David Goodger and Georg Brandl for [reStructuredText][] and [Sphinx][]\n* John Gruber and Tom Christie for [markdown][] and [Mkdocs][]\n* Solomon Hykes, Jerome Petazzoni and Sam Alba for [Docker][]\n* The awesome Python, Linux and Git communities\n\n\n[Guido van Rossum]: http://en.wikipedia.org/wiki/Guido_van_Rossum\n[Linus Torvalds]: http://en.wikipedia.org/wiki/Linus_Torvalds\n[Raymond Hettinger]: https://www.youtube.com/watch?v=p33CVV29OG8\n[yaml]: https://yaml.org/spec/1.1\n[pyyaml]: http://pyyaml.org/wiki/PyYAMLDocumentation\n[OrderedDict]: https://www.python.org/dev/peps/pep-0372\n[argparse]: https://docs.python.org/3/library/argparse.html\n[CLG]: https://clg.readthedocs.org\n[docker]: https://www.docker.com\n[pytest]: https://docs.pytest.org\n[reStructuredText]: http://sphinx-doc.org/rest.html\n[Sphinx]: http://sphinx-doc.org/tutorial.html\n[markdown]: https://daringfireball.net/projects/markdown\n[Mkdocs]: https://www.mkdocs.org\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)\n        \n        Copyright (c) 2015-2025, Daniel Mizyrycki\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy of\n        this software and associated documentation files (the \"Software\"), to deal in\n        the Software without restriction, including without limitation the rights to\n        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n        of the Software, and to permit persons to whom the Software is furnished to do\n        so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Tool to simplify config management in a program",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://loadconfig.readthedocs.org",
        "Repository": "https://github.com/loadconfig"
    },
    "split_keywords": [
        "config",
        " yaml",
        " clg",
        " command-line",
        " argparse"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "98050d16c66d49f78610407cda6a18c6ef2c262accb3501aef2eebd214b9ea99",
                "md5": "36614c9864cc8dd339ac627f2c5dda0c",
                "sha256": "1941248f3c6bda43ef7d9808a5fd95eac595a13ead5d8e5f55430f1bbccef194"
            },
            "downloads": -1,
            "filename": "loadconfig-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "36614c9864cc8dd339ac627f2c5dda0c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 13489,
            "upload_time": "2025-10-07T23:26:59",
            "upload_time_iso_8601": "2025-10-07T23:26:59.235592Z",
            "url": "https://files.pythonhosted.org/packages/98/05/0d16c66d49f78610407cda6a18c6ef2c262accb3501aef2eebd214b9ea99/loadconfig-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-07 23:26:59",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "loadconfig"
}
        
Elapsed time: 1.77584s