{"id":18892978,"url":"https://github.com/dongjunlee/hb-config","last_synced_at":"2025-04-15T00:13:42.182Z","repository":{"id":57436893,"uuid":"101467544","full_name":"DongjunLee/hb-config","owner":"DongjunLee","description":"hb-config: easy to configure your python project especially Deep Learning experiments","archived":false,"fork":false,"pushed_at":"2018-10-20T16:39:23.000Z","size":36,"stargazers_count":21,"open_issues_count":4,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T00:13:27.735Z","etag":null,"topics":["config","configuration","experiment","python","singleton"],"latest_commit_sha":null,"homepage":"","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/DongjunLee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-26T06:29:03.000Z","updated_at":"2022-12-02T08:09:06.000Z","dependencies_parsed_at":"2022-09-09T23:24:50.716Z","dependency_job_id":null,"html_url":"https://github.com/DongjunLee/hb-config","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/DongjunLee%2Fhb-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fhb-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fhb-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fhb-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DongjunLee","download_url":"https://codeload.github.com/DongjunLee/hb-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981271,"owners_count":21193147,"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","configuration","experiment","python","singleton"],"created_at":"2024-11-08T08:06:54.405Z","updated_at":"2025-04-15T00:13:42.166Z","avatar_url":"https://github.com/DongjunLee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/logo.png\" width=250\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\n  \u003ca href=\"https://github.com/DongjunLee/kino-bot\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Python3.6-Config-brightgreen.svg\" alt=\"Project Introduction\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://badge.fury.io/py/hb-config\"\u003e\n    \u003cimg src=\"https://badge.fury.io/py/hb-config.svg\" alt=\"PyPI version\" height=\"18\"\u003e\n  \u003c/a\u003e\n\n  \u003cbr/\u003e\n\n  \u003ca href=\"https://travis-ci.org/badges/shields\"\u003e\n    \u003cimg src=\"https://travis-ci.org/DongjunLee/hb-config.svg?branch=master\" alt=\"build status\"\u003e    \n  \u003c/a\u003e\n  \u003ca href=\"https://requires.io/github/DongjunLee/hb-config/requirements/?branch=master\"\u003e\n    \u003cimg src=\"https://requires.io/github/DongjunLee/hb-config/requirements.svg?branch=master\" alt=\"Requirements Status\" /\u003e\n  \u003c/a\u003e\n \u003ca href='https://dependencyci.com/github/DongjunLee/hb-config'\u003e\n   \u003cimg src='https://dependencyci.com/github/DongjunLee/hb-config/badge' alt='Dependency Status' /\u003e\n \u003c/a\u003e\n\n  \u003cbr/\u003e\n\n  \u003ca href=\"https://codecov.io/gh/DongjunLee/hb-config\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/DongjunLee/hb-config/branch/master/graph/badge.svg\" alt=\"Codecov\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.codacy.com/app/humanbrain.djlee/hb-config?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=DongjunLee/hb-config\u0026amp;utm_campaign=Badge_Grade\"\u003e\n    \u003cimg src=\"https://api.codacy.com/project/badge/Grade/c47cdac8f087492aaeb593bd68ca2f3f\"/\u003e\n  \u003c/a\u003e\n\n\n\u003c/p\u003e\n\n# hb-config: easy to configure your python packge\n\n\nhb-config is utility for easy to configure your python project especially **Deep Learning experiments**.  \n\n## Feature\n\n- Do not use any **boilerplate code**\n- **Singleton** Class (immediately use anywhere)\n- Supports formats: **.json and .yaml**\n- Access property using **\\_\\_getattr\\_\\_** function ```Config.TOKEN```\n- Edit property using **\\_\\_setattr\\_\\_** function ```Config.TOKEN = \"{token}\"```\n- every config data's type is **dict**\n\n\n## Install\n\nusing pip\n\n```\n$ pip install hb-config\n```\n\nor clone repository\n\n```\ngit clone https://github.com/hb-research/hb-config.git\npython setup.py install\n```\n\n## Usage\n\n- base path : config/\n- config3.yml example\n\n```yml\nproject: hb-config\nexample: true\nbot:\n  in_bot:\n    test: haha\n    simple: wow\n```\n\n- Using like dict\n\t- only one difference : Config[\"project\"] -\u003e Config.project\n\t- using get Config.get(\"project\"), Config.get(\"project\", {})\n\t- using set Config.project = \"set value\" \n- Add description with python annotation. `#` \n\n### Load config\n\n```python\n\u003e\u003e\u003e from hbconfig import Config\n\u003e\u003e\u003e Config(\"config3\")\n\u003e\u003e\u003e Config\nRead config file name: config3.yml\n{\n    \"project\": \"hb-config\",\n    \"example\": true,\n    \"bot\": {\n        \"in_bot\": {\n            \"test\": \"haha\",\n            \"simple\": \"wow\"\n        }\n    }\n}\n```\n\n### Get\n```\n\u003e\u003e\u003e Config.bot.in_bot\n{\n    \"test\": \"haha\"\n    \"simple\": \"wow\"\n}\n\n\u003e\u003e\u003e Config.project\n'hb-config'\n\n\u003e\u003e\u003e Config.bot.in_bot.get(\"simple\")\n'wow'\n\n\u003e\u003e\u003e Config.bot.in_bot.get(\"not_exist_key\", \"default_value\")\n'default_value'\n```\n\n### Set \n\n- The config file does not change.\n\n```\n\u003e\u003e\u003e Config.bot.in_bot\n{\n    \"test\": \"haha\"\n    \"simple\": \"wow\"\n}\n\n\u003e\u003e\u003e Config.bot.in_bot = \"hello\"\n\u003e\u003e\u003e Config.bot.in_bot\n'hello'\n\n```\n\n### Description\n\n- example config\n\n```yml\nproject: hb-config    # project name\nexample: true         # is it example?\nbot:\n  in_bot:\n    test: haha\n    simple: wow\n```\n\n```\n\u003e\u003e\u003e Config\nRead config file name: ./config/config\n{\n    \"project\": \"hb-config\",\n    \"example\": true,\n    \"bot\": {\n        \"in_bot\": {\n            \"test\": \"haha\",\n            \"simple\": \"wow\"\n        }\n    }\n}\n\u003e\u003e\u003e Config.description\n{'example': 'is it example?', 'project': 'project name'}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongjunlee%2Fhb-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongjunlee%2Fhb-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongjunlee%2Fhb-config/lists"}