{"id":20128413,"url":"https://github.com/teamhide/confparser","last_synced_at":"2025-04-09T15:50:17.984Z","repository":{"id":53528642,"uuid":"265405517","full_name":"teamhide/confparser","owner":"teamhide","description":"Python config parser library","archived":false,"fork":false,"pushed_at":"2021-03-25T23:45:57.000Z","size":19,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T10:25:11.899Z","etag":null,"topics":[],"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/teamhide.png","metadata":{"files":{"readme":"README.md","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":"2020-05-20T00:42:13.000Z","updated_at":"2020-07-24T12:31:03.000Z","dependencies_parsed_at":"2022-09-22T06:11:12.582Z","dependency_job_id":null,"html_url":"https://github.com/teamhide/confparser","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/teamhide%2Fconfparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhide%2Fconfparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhide%2Fconfparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhide%2Fconfparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teamhide","download_url":"https://codeload.github.com/teamhide/confparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248063781,"owners_count":21041853,"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":[],"created_at":"2024-11-13T20:27:03.654Z","updated_at":"2025-04-09T15:50:17.964Z","avatar_url":"https://github.com/teamhide.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Config Parser Library\n[![license]](/LICENSE)\n[![pypi]](https://pypi.org/project/confparser/)\n[![pyversions]](http://pypi.python.org/pypi/confparser)\n![badge](https://action-badges.now.sh/teamhide/confparser)\n[![Downloads](https://pepy.tech/badge/confparser)](https://pepy.tech/project/confparser)\n\nconfparser is a config parser by yml file or dictionary.\n\nIn confparser, you can easily access to value through dot notation.\n\nLike, `conf.debug`, `conf.server.dev.debug`.\n\n## Installation\n\n```python\npip3 install confparser\n```\n\n## Usage\n\n### Config by .yml file\n\nCreate yml file\n\n```yaml\ndebug: True\nserver:\n  dev:\n    debug: True\n    port: 8000\n  prod:\n    debug: False\n    port: 80\n```\n\nImport confparser and insert your yml file.\n```python\nfrom confparser import ConfParser\n\n\nconfig = ConfParser(path='./config.yml').to_obj()\n\nprint(config)\n# {'debug': True, 'server': {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}}\n\nprint(config.debug)  \n# True\n\nprint(config.server)\n# {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}\n\nprint(config.server.dev)\n# {'debug': True, 'port': 8000}\n\nprint(config.server.dev.debug)  \n# True\n\nprint(config.server.dev.port)  \n# 8000\n\nprint(config.server.prod.debug)  \n# False\n\nprint(config.server.prod.port)  \n# 80\n```\n\n### Config by dictionary\n\nImport confparser and insert your dictionary.\n```python\nfrom confparser import ConfParser\n\nconf_dict = {\n    'debug': True,\n    'server': {\n        'dev': {\n            'debug': True,\n            'port': 8000,\n        },\n        'prod': {\n            'debug': False,\n            'port': 80,\n        },\n    }\n}\nconfig = ConfParser(conf_dict=conf_dict).to_obj()\n\nprint(config)\n# {'debug': True, 'server': {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}}\n\nprint(config.debug)  \n# True\n\nprint(config.server)\n# {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}\n\nprint(config.server.dev)\n# {'debug': True, 'port': 8000}\n\nprint(config.server.dev.debug)  \n# True\n\nprint(config.server.dev.port)  \n# 8000\n\nprint(config.server.prod.debug)  \n# False\n\nprint(config.server.prod.port)  \n# 80\n```\n\n## Note\n\n`path` and `conf_dict` cannot be used at once.\n\n## Dependencies\n\nTo use parsing yml file, `pyyaml` is needed.\n\nBut it will be install automatically with confparser so you don't have to install manually.\n\n\n[license]: https://img.shields.io/badge/License-MIT-yellow.svg\n[pypi]: https://img.shields.io/pypi/v/confparser\n[pyversions]: https://img.shields.io/pypi/pyversions/confparser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamhide%2Fconfparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamhide%2Fconfparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamhide%2Fconfparser/lists"}