{"id":15969620,"url":"https://github.com/thombashi/appconfigpy","last_synced_at":"2025-05-07T06:22:00.369Z","repository":{"id":57411023,"uuid":"83957934","full_name":"thombashi/appconfigpy","owner":"thombashi","description":"A Python library to create/load an application configuration file.","archived":false,"fork":false,"pushed_at":"2023-07-16T10:13:54.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-27T07:36:55.693Z","etag":null,"topics":["application-configuration","configuration","python-library"],"latest_commit_sha":null,"homepage":null,"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/thombashi.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,"governance":null}},"created_at":"2017-03-05T09:09:58.000Z","updated_at":"2023-03-11T02:02:46.000Z","dependencies_parsed_at":"2022-09-09T16:01:50.171Z","dependency_job_id":null,"html_url":"https://github.com/thombashi/appconfigpy","commit_stats":{"total_commits":203,"total_committers":2,"mean_commits":101.5,"dds":"0.059113300492610876","last_synced_commit":"4f55d7735fe255acdfa93763591d38b5706bf6a5"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fappconfigpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fappconfigpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fappconfigpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fappconfigpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thombashi","download_url":"https://codeload.github.com/thombashi/appconfigpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252825100,"owners_count":21809894,"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":["application-configuration","configuration","python-library"],"created_at":"2024-10-07T19:40:39.941Z","updated_at":"2025-05-07T06:22:00.349Z","avatar_url":"https://github.com/thombashi.png","language":"Python","readme":".. contents:: **appconfigpy**\n   :backlinks: top\n   :local:\n\n\nSummary\n=======\nA Python library to create/load an application configuration file.\n\n\n.. image:: https://badge.fury.io/py/appconfigpy.svg\n    :target: https://badge.fury.io/py/appconfigpy\n    :alt: PyPI package version\n\n.. image:: https://img.shields.io/pypi/pyversions/appconfigpy.svg\n    :target: https://pypi.org/project/appconfigpy\n    :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/implementation/appconfigpy.svg\n    :target: https://pypi.org/project/appconfigpy\n    :alt: Supported Python implementations\n\n.. image:: https://github.com/thombashi/appconfigpy/actions/workflows/lint_and_test.yml/badge.svg\n    :target: https://github.com/thombashi/appconfigpy/actions/workflows/lint_and_test.yml\n    :alt: CI status of Linux/macOS/Windows\n\n\nInstallation\n============\n\nInstall from PyPI\n------------------------------\n::\n\n    pip install appconfigpy\n\nInstall from PPA (for Ubuntu)\n------------------------------\n::\n\n    sudo add-apt-repository ppa:thombashi/ppa\n    sudo apt update\n    sudo apt install python3-appconfigpy\n\n\nUsage\n=====\n\nCreate a configuration file from user inputs\n-------------------------------------------------------\n.. code:: python\n\n    # configure.py\n\n    from appconfigpy import ConfigItem, ConfigManager, DefaultDisplayStyle\n\n    app_config_mgr = ConfigManager(\n        config_name=\"example\",\n        config_items=[\n            ConfigItem(\n                name=\"token\",\n                initial_value=None,\n                prompt_text=\"API Token\",\n                default_display_style=DefaultDisplayStyle.PART_VISIBLE,\n            ),\n            ConfigItem(name=\"path\", prompt_text=\"ABC Path\", initial_value=\".\"),\n        ],\n    )\n\n    app_config_mgr.configure()\n\n\n.. code::\n\n    $ ./configure.py\n    API Token: abcdefghijklmn\n    ABC Path [.]:\n    $ cat ~/.example\n    {\n        \"path\": \".\",\n        \"token\": \"abcdefghijklmn\"\n    }\n\nLoad a configuration file\n-------------------------------------------------------\n.. code:: python\n\n    # load.py\n\n    from appconfigpy import ConfigItem, ConfigManager, DefaultDisplayStyle\n\n    app_config_mgr = ConfigManager(\n        config_name=\"example\",\n        config_items=[\n            ConfigItem(\n                name=\"token\",\n                initial_value=None,\n                prompt_text=\"API Token\",\n                default_display_style=DefaultDisplayStyle.PART_VISIBLE,\n            ),\n            ConfigItem(name=\"path\", prompt_text=\"ABC Path\", initial_value=\".\"),\n        ],\n    )\n\n    print(app_config_mgr.load())\n\n.. code::\n\n    $ ./load.py\n    {'token': 'abcdefghijklmn', 'path': '.'}\n\n\nDependencies\n============\nPython 3.7+\n\nOptional Dependencies\n------------------------------------\n- `click \u003chttps://palletsprojects.com/p/click/\u003e`__\n- `loguru \u003chttps://github.com/Delgan/loguru\u003e`__\n    - Used for logging if the package installed\n- `pathvalidate \u003chttps://github.com/thombashi/pathvalidate\u003e`__\n- `typepy \u003chttps://github.com/thombashi/typepy\u003e`__\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthombashi%2Fappconfigpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthombashi%2Fappconfigpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthombashi%2Fappconfigpy/lists"}