{"id":23891611,"url":"https://github.com/dev-techmoe/python-catconfig","last_synced_at":"2026-04-20T04:02:03.703Z","repository":{"id":62561026,"uuid":"305351234","full_name":"dev-techmoe/python-catconfig","owner":"dev-techmoe","description":"🐱Make more easy for reading/validating/updating config for python app","archived":false,"fork":false,"pushed_at":"2020-10-28T07:39:47.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T11:43:18.022Z","etag":null,"topics":["config","configuration-management","json","pypi","python","pythonmodule","toml","yaml"],"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/dev-techmoe.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-10-19T10:46:59.000Z","updated_at":"2020-10-28T07:39:49.000Z","dependencies_parsed_at":"2022-11-03T15:00:36.134Z","dependency_job_id":null,"html_url":"https://github.com/dev-techmoe/python-catconfig","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/dev-techmoe%2Fpython-catconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-techmoe%2Fpython-catconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-techmoe%2Fpython-catconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-techmoe%2Fpython-catconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-techmoe","download_url":"https://codeload.github.com/dev-techmoe/python-catconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240272645,"owners_count":19775080,"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-management","json","pypi","python","pythonmodule","toml","yaml"],"created_at":"2025-01-04T12:59:55.387Z","updated_at":"2026-04-20T04:01:58.678Z","avatar_url":"https://github.com/dev-techmoe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CatConfig\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/catconfig) \n![PyPI - License](https://img.shields.io/pypi/l/catconfig)\n![test](https://github.com/dev-techmoe/python-catconfig/workflows/test/badge.svg)\n\n🐱Make more easy for reading/validating/updating config for python app\n\n## Install \n\n```\npip install catconfig\n```\n\nIf you want to use validation feature, install `cerberus` module for your project to use it normally.  \n\nInstall `toml` or `pyyaml` module for toml/yaml format parsing.\n\n## Quickstart\n\n```python\n# Example.py\nfrom catconfig import CatConfig, ValidationError\n\n# Load\n# Load config from string\nc = CatConfig()\nc.load_from_string(\"\"\"\n{\n    \"foo\": \"bar\"\n}\n\"\"\")\n# Load config when initalizing CatConfig object\nc = CatConfig(data={\n    'foo': 'bar'\n})\n# load config from file\nc = CatConfig()\nc.load_from_file('./tests/assests/test.json')\n# Specify config type when initalizing CatConfig object\nc = CatConfig(format='json')\nc.load_from_file('./tests/assests/test.json')\n# Specify config type when loading config file\nc = CatConfig()\nc.load_from_file('./tests/assests/test.json', format='json')\n\n# Get item\nprint(c.foo)\n# Print: bar\nprint(bool(c.some.value.does.nt.exists))\n# Print: False\nprint(str(c.some.value.does.nt.exists))\n# Print: None\nprint(c['foo'])\n# Print: bar\nprint(c.get('foo'))\n# Print: bar\n\n# Validation\n# visit https://docs.python-cerberus.org/en/stable/usage.html for more info of schema\nschema = {\n    'foo': {\n        'type': 'integer'\n    },\n    'some_field': {\n        'type': 'string'\n    }\n}\nc = CatConfig(validator_schema=schema)\ntry:\n    c.load_from_file('./tests/assests/test.json')\nexcept ValidationError as err:\n    print(err.message)\n    # Print:\n    # arr: unknown field\n    # foo: must be of integer type\n```\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-techmoe%2Fpython-catconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-techmoe%2Fpython-catconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-techmoe%2Fpython-catconfig/lists"}