settngs


Namesettngs JSON
Version 0.11.1 PyPI version JSON
download
home_pagehttps://github.com/lordwelch/settngs
SummaryA library for managing settings
upload_time2025-08-31 03:44:20
maintainerNone
docs_urlNone
authorTimmy Welch
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![CI](https://github.com/lordwelch/settngs/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/lordwelch/settngs/actions/workflows/build.yaml)
[![GitHub release (latest by date)](https://img.shields.io/github/downloads/lordwelch/settngs/latest/total)](https://github.com/lordwelch/settngs/releases/latest)
[![PyPI](https://img.shields.io/pypi/v/settngs)](https://pypi.org/project/settngs/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/settngs)](https://pypistats.org/packages/settngs)
[![PyPI - License](https://img.shields.io/pypi/l/settngs)](https://opensource.org/licenses/MIT)

# Settngs

This library is an attempt to merge reading flags/options from the commandline (argparse) and settings from a file (json).

It is a modified argparse inspired by how [flake8] loads their settings. Note that this does not attempt to be a drop-in replacement for argparse.

Install with pip
```console
pip install settngs
```


A trivial example is included at the bottom of settngs.py with the output below (using bash). For a more complete example see [ComicTagger].
```console
$ python -m settngs
Hello world
$ python -m settngs --hello lordwelch
Hello lordwelch
$ python -m settngs --hello lordwelch -s
Hello lordwelch
Successfully saved settings to settings.json
$ python -m settngs
Hello lordwelch
$ python -m settngs -v
Hello lordwelch
merged_namespace.values.Example_Group__verbose=True
$ python -m settngs -v -s
Hello lordwelch
Successfully saved settings to settings.json
merged_namespace.values.Example_Group__verbose=True
$ python -m settngs
Hello lordwelch
merged_namespace.values.Example_Group__verbose=True
$ cat >settings.json << EOF
{
  "example": {
    "hello": "lordwelch",
    "verbose": true
  },
  "persistent": {
    "test": false,
    "hello": "world"
  }
}
EOF
$ python -m settngs --no-verbose
Hello lordwelch
$ python -m settngs --no-verbose -s
Hello lordwelch
Successfully saved settings to settings.json
$ python -m settngs --hello world --no-verbose -s
Hello world
Successfully saved settings to settings.json
$ python -m settngs
Hello world
```

settngs.json at the end:
```json
{
  "Example Group": {
    "hello": "world",
    "verbose": false
  },
  "persistent": false,
  "hello": "world"
}
```

## What happened to the 'i'?
PyPi wouldn't let me use 'settings'

[flake8]: https://github.com/PyCQA/flake8
[ComicTagger]: https://github.com/comictagger/comictagger

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lordwelch/settngs",
    "name": "settngs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Timmy Welch",
    "author_email": "timmy@narnian.us",
    "download_url": "https://files.pythonhosted.org/packages/29/b2/c09272be3353bd3ead2d439f849212c80ea2f873c739ca524002cded0081/settngs-0.11.1.tar.gz",
    "platform": null,
    "description": "[![CI](https://github.com/lordwelch/settngs/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/lordwelch/settngs/actions/workflows/build.yaml)\n[![GitHub release (latest by date)](https://img.shields.io/github/downloads/lordwelch/settngs/latest/total)](https://github.com/lordwelch/settngs/releases/latest)\n[![PyPI](https://img.shields.io/pypi/v/settngs)](https://pypi.org/project/settngs/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/settngs)](https://pypistats.org/packages/settngs)\n[![PyPI - License](https://img.shields.io/pypi/l/settngs)](https://opensource.org/licenses/MIT)\n\n# Settngs\n\nThis library is an attempt to merge reading flags/options from the commandline (argparse) and settings from a file (json).\n\nIt is a modified argparse inspired by how [flake8] loads their settings. Note that this does not attempt to be a drop-in replacement for argparse.\n\nInstall with pip\n```console\npip install settngs\n```\n\n\nA trivial example is included at the bottom of settngs.py with the output below (using bash). For a more complete example see [ComicTagger].\n```console\n$ python -m settngs\nHello world\n$ python -m settngs --hello lordwelch\nHello lordwelch\n$ python -m settngs --hello lordwelch -s\nHello lordwelch\nSuccessfully saved settings to settings.json\n$ python -m settngs\nHello lordwelch\n$ python -m settngs -v\nHello lordwelch\nmerged_namespace.values.Example_Group__verbose=True\n$ python -m settngs -v -s\nHello lordwelch\nSuccessfully saved settings to settings.json\nmerged_namespace.values.Example_Group__verbose=True\n$ python -m settngs\nHello lordwelch\nmerged_namespace.values.Example_Group__verbose=True\n$ cat >settings.json << EOF\n{\n  \"example\": {\n    \"hello\": \"lordwelch\",\n    \"verbose\": true\n  },\n  \"persistent\": {\n    \"test\": false,\n    \"hello\": \"world\"\n  }\n}\nEOF\n$ python -m settngs --no-verbose\nHello lordwelch\n$ python -m settngs --no-verbose -s\nHello lordwelch\nSuccessfully saved settings to settings.json\n$ python -m settngs --hello world --no-verbose -s\nHello world\nSuccessfully saved settings to settings.json\n$ python -m settngs\nHello world\n```\n\nsettngs.json at the end:\n```json\n{\n  \"Example Group\": {\n    \"hello\": \"world\",\n    \"verbose\": false\n  },\n  \"persistent\": false,\n  \"hello\": \"world\"\n}\n```\n\n## What happened to the 'i'?\nPyPi wouldn't let me use 'settings'\n\n[flake8]: https://github.com/PyCQA/flake8\n[ComicTagger]: https://github.com/comictagger/comictagger\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library for managing settings",
    "version": "0.11.1",
    "project_urls": {
        "Homepage": "https://github.com/lordwelch/settngs"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f08bc6b47d12ee6aa683455cb76503a3bed904ee2cbf19b0fca4b461b786b10c",
                "md5": "af5e7ac6a7fb4240627490632c91ad6e",
                "sha256": "755d646c45fd734d10622d43712ad2cf02651ac48fee3477ea3a4b9e13182511"
            },
            "downloads": -1,
            "filename": "settngs-0.11.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af5e7ac6a7fb4240627490632c91ad6e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 12768,
            "upload_time": "2025-08-31T03:44:19",
            "upload_time_iso_8601": "2025-08-31T03:44:19.630872Z",
            "url": "https://files.pythonhosted.org/packages/f0/8b/c6b47d12ee6aa683455cb76503a3bed904ee2cbf19b0fca4b461b786b10c/settngs-0.11.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "29b2c09272be3353bd3ead2d439f849212c80ea2f873c739ca524002cded0081",
                "md5": "074026d900ff59f08c3742f413ae1cbd",
                "sha256": "e0032724586143e5ef247fa523f4a258b78c2a37d45ab033eec4d986bab5771e"
            },
            "downloads": -1,
            "filename": "settngs-0.11.1.tar.gz",
            "has_sig": false,
            "md5_digest": "074026d900ff59f08c3742f413ae1cbd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 23469,
            "upload_time": "2025-08-31T03:44:20",
            "upload_time_iso_8601": "2025-08-31T03:44:20.722325Z",
            "url": "https://files.pythonhosted.org/packages/29/b2/c09272be3353bd3ead2d439f849212c80ea2f873c739ca524002cded0081/settngs-0.11.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-31 03:44:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lordwelch",
    "github_project": "settngs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "settngs"
}
        
Elapsed time: 2.01715s