{"id":23061814,"url":"https://github.com/rrwen/kwconfig","last_synced_at":"2025-04-03T07:19:58.232Z","repository":{"id":62574877,"uuid":"92036223","full_name":"rrwen/kwconfig","owner":"rrwen","description":"A Python module for managing config files in keyword style json format.","archived":false,"fork":false,"pushed_at":"2017-08-16T17:36:55.000Z","size":244,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T00:08:28.979Z","etag":null,"topics":["config","file","json","key","keyvalue","keyword","manage","module","path","value","word"],"latest_commit_sha":null,"homepage":"https://rrwen.github.io/kwconfig","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rrwen.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-22T09:32:04.000Z","updated_at":"2017-08-15T09:28:24.000Z","dependencies_parsed_at":"2022-11-03T18:51:16.375Z","dependency_job_id":null,"html_url":"https://github.com/rrwen/kwconfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrwen%2Fkwconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrwen%2Fkwconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrwen%2Fkwconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrwen%2Fkwconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rrwen","download_url":"https://codeload.github.com/rrwen/kwconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246952278,"owners_count":20859813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","file","json","key","keyvalue","keyword","manage","module","path","value","word"],"created_at":"2024-12-16T03:18:33.441Z","updated_at":"2025-04-03T07:19:58.215Z","avatar_url":"https://github.com/rrwen.png","language":"Python","readme":"kwconfig\n========\n\n| Richard Wen\n| rrwen.dev@gmail.com\n\n* `Documentation \u003chttps://rrwen.github.io/kwconfig\u003e`_\n* `PyPi Package \u003chttps://pypi.python.org/pypi/kwconfig\u003e`_\n\nA Python module for managing config files in keyword style json format.\n\n.. image:: https://badge.fury.io/py/kwconfig.svg\n    :target: https://badge.fury.io/py/kwconfig\n.. image:: https://img.shields.io/github/issues/rrwen/kwconfig.svg\n    :target: https://github.com/rrwen/kwconfig/issues\n.. image:: https://travis-ci.org/rrwen/kwconfig.svg?branch=master\n    :target: https://travis-ci.org/rrwen/kwconfig\n.. image:: https://coveralls.io/repos/github/rrwen/kwconfig/badge.svg?branch=master\n    :target: https://coveralls.io/github/rrwen/kwconfig?branch=master\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n    :target: https://raw.githubusercontent.com/rrwen/kwconfig/master/LICENSE\n.. image:: https://img.shields.io/github/forks/rrwen/kwconfig.svg\n    :target: https://github.com/rrwen/kwconfig/network\n.. image:: https://img.shields.io/github/stars/rrwen/kwconfig.svg\n    :target: https://github.com/rrwen/kwconfig/stargazers\n.. image:: https://img.shields.io/twitter/url/https/github.com/rrwen/kwconfig.svg?style=social\n    :target: https://twitter.com/intent/tweet?text=simple%20%23python%20%23package%20for%20keyword%20%23json%20%23configuration:%20https://github.com/rrwen/kwconfig\n\nInstall\n-------\n\n1. Install `Python \u003chttps://www.python.org/downloads/\u003e`_\n2. Install `kwconfig \u003chttps://pypi.python.org/pypi/kwconfig\u003e`_ via ``pip``\n\n::\n  \n  pip install kwconfig\n  \nFor the latest developer version, see `Developer Install`_.\n  \nUsage\n-----\n\n.. code-block:: python\n  \n  import kwconfig\n  \n  # Specify a file path for creating kwconfig object\n  config = kwconfig.manage('config.json', defaults={'key0': 'value0'})\n  \n  # Update the config file with a key and value dict\n  config.update({'key1': 'value1', 'key2': 'value2'})\n  \n  # Add a keyword dict to existing config file\n  # If a key exists, it will be updated\n  # If a key does not exist, it will be added\n  other_config = {'key3': 'value3'}\n  other_config = config.add(other_config)\n  \n  # Write new values using keyword dict\n  config.overwrite({\n    'new_key1': 'new_value1',\n    'new_key2': 'new_value2'\n  })\n  \n  # Obtain a dict of the config file contents\n  kw = config.read()\n  \n  # Remove the key named \"key1\"\n  config.remove('key1')\n  \n  # Reset to defaults\n  config.reset()\n  \n  # Parsing a keyword list into dict ----\n  \n  # Create a sample list of keyword arguments\n  argv = ['--key1=value1', '--key2=value2']\n  \n  # Parse into a keyword dict\n  kwdict = kwconfig.parse(argv)\n  \n  # View the values of key1 and key2\n  print('key1: ' + kwdict['key1'])\n  print('key2: ' + kwdict['key2'])\n  \nFor more usage details, see the `Documentation \u003chttps://rrwen.github.io/kwconfig\u003e`_.\n\nDeveloper Notes\n---------------\n\nDeveloper Install\n*****************\n\nInstall the latest developer version with ``pip`` from github::\n  \n  pip install git+https://github.com/rrwen/kwconfig\n  \nInstall from ``git`` cloned source:\n\n1. Ensure `git \u003chttps://git-scm.com/\u003e`_ is installed\n2. Clone into current path\n3. Install via ``pip``\n\n::\n\n  git clone https://github.com/rrwen/kwconfig\n  cd kwconfig\n  pip install . -I\n  \nTests\n*****\n\n1. Clone into current path ``git clone https://github.com/rrwen/kwconfig``\n2. Enter into folder ``cd kwconfig``\n3. Ensure `unittest \u003chttps://docs.python.org/2.7/library/unittest.html\u003e`_ is available\n4. Run tests\n\n::\n  \n  pip install . -I\n  python -m unittest\n\nDocumentation Maintenance\n*************************\n\n1. Ensure `sphinx \u003chttps://github.com/sphinx-doc/sphinx/\u003e`_ is installed ``pip install -U sphinx``\n2. Update the documentation in ``docs/``\n\n::\n  \n  pip install . -I\n  sphinx-build -b html docs/source docs\n  \nUpload to Github\n****************\n\n1. Ensure `git \u003chttps://git-scm.com/\u003e`_ is installed\n2. Add all files and commit changes\n3. Push to github\n\n::\n  \n  git add .\n  git commit -a -m \"Generic update\"\n  git push\n  \nUpload to PyPi\n**************\n\n1. Ensure `twine \u003chttps://pypi.python.org/pypi/twine\u003e`_ is installed ``pip install twine``\n2. Ensure `sphinx \u003chttps://github.com/sphinx-doc/sphinx/\u003e`_ is installed ``pip install -U sphinx``\n3. Run tests and check for OK status\n4. Delete ``dist`` directory\n5. Update the version in ``kwconfig/__init__.py``\n6. Update the documentation in ``docs/``\n7. Create source distribution\n8. Upload to `PyPi \u003chttps://pypi.python.org/pypi\u003e`_\n\n::\n  \n  pip install . -I\n  python -m unittest\n  sphinx-build -b html docs/source docs\n  python setup.py sdist\n  twine upload dist/*\n  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrwen%2Fkwconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frrwen%2Fkwconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrwen%2Fkwconfig/lists"}