{"id":22985846,"url":"https://github.com/kokofixcomputers/configurationlib","last_synced_at":"2026-02-11T11:02:18.354Z","repository":{"id":260175171,"uuid":"880527513","full_name":"kokofixcomputers/configurationlib","owner":"kokofixcomputers","description":"A simple configuration manager for python","archived":false,"fork":false,"pushed_at":"2025-08-16T19:59:24.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T02:51:59.394Z","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/kokofixcomputers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"kokofixcomputers"}},"created_at":"2024-10-29T22:14:10.000Z","updated_at":"2025-08-16T19:58:08.000Z","dependencies_parsed_at":"2025-08-15T20:31:39.658Z","dependency_job_id":"a33ac874-d969-47e7-ba72-c7c4166a0334","html_url":"https://github.com/kokofixcomputers/configurationlib","commit_stats":null,"previous_names":["kokofixcomputers/configurationlib"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kokofixcomputers/configurationlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokofixcomputers%2Fconfigurationlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokofixcomputers%2Fconfigurationlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokofixcomputers%2Fconfigurationlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokofixcomputers%2Fconfigurationlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kokofixcomputers","download_url":"https://codeload.github.com/kokofixcomputers/configurationlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokofixcomputers%2Fconfigurationlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29332292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12-15T03:35:09.977Z","updated_at":"2026-02-11T11:02:18.339Z","avatar_url":"https://github.com/kokofixcomputers.png","language":"Python","funding_links":["https://github.com/sponsors/kokofixcomputers"],"categories":[],"sub_categories":[],"readme":"# Configurationlib\n[![Python Tests](https://github.com/kokofixcomputers/configurationlib/actions/workflows/python-tests.yaml/badge.svg)](https://github.com/kokofixcomputers/configurationlib/actions/workflows/python-tests.yaml)\n\nA simple configuration manager for Python that allows you to easily manage nested configurations using JSON files.\n\n## Features\n\n- Load and save configurations from/to a JSON, YAML or .env file.\n- Create nested dictionaries dynamically.\n- Retrieve configuration values easily.\n\n## Installation\n\nYou can install the package via pip:\n\n```bash\npip install configurationlib\n```\n\n## Note\nIf the file specified does not exist, it will be created.\n\n## Usage\n\n\n\u003e [!WARNING]\n\u003e Please do note, if you specify the wrong file with the wrong format, it may load incorrectly or may break your file.\n\n\nHere is a simple example of the usage of this module:\n```python\nimport configurationlib\n\n# Create an instance of the configuration manager\nconfig = configurationlib.Instance(file=\"config.json\") # Choose any file name you like! The file will be created if it does not exist.\n\n# Use save() to get access to the current configuration and set values\nconfig.save()[\"dic1\"] = {}  # Initialize a new dictionary\nconfig.save()[\"dic1\"][\"afewmoredic\"] = {}  # Initialize a nested dictionary\nconfig.save()[\"dic1\"][\"afewmoredic\"][\"key\"] = \"value\"  # Set a value\nconfig.save()['weird'] = True\n\n# Retrieve values from nested dictionaries using get()\nretrieved_value = config.get()[\"dic1\"][\"afewmoredic\"][\"key\"] # Use config.get to retrieve the value\nprint(retrieved_value)  # Output: value\n\n# Save changes after modifying (optional, since save is called after every modification)\nconfig.save()\n```\n### Changing formats\nIf you want, You can change the format of the saved file (YAML, JSON, dotENV) the default already is JSON so if you want json, you don't need to do anything.\nHere is how you can change it to YAML:\n```python\nimport configurationlib\n\n# Create an instance of the configuration manager\nconfig = configurationlib.Instance(file=\"config.json\", format=configurationlib.Format.YAML) # Use Yaml. Change this to ENV to use env\n\n# Use save() to get access to the current configuration and set values\nconfig.save()[\"dic1\"] = {}  # Initialize a new dictionary\nconfig.save()[\"dic1\"][\"afewmoredic\"] = {}  # Initialize a nested dictionary\nconfig.save()[\"dic1\"][\"afewmoredic\"][\"key\"] = \"value\"  # Set a value\n\n# Retrieve values from nested dictionaries using get()\nretrieved_value = config.get()[\"dic1\"][\"afewmoredic\"][\"key\"] # Use config.get to retrieve the value\nprint(retrieved_value)  # Output: value\n\n# Save changes after modifying (optional, since save is called after every modification)\nconfig.save()\n```\nThe only line that changes is `config = configurationlib.Instance(file=\"config.json\", format=configurationlib.Format.YAML` nothing else changes. It will automatically save the data into the data you'd like! If you remove format argument, it will default to `JSON`.\n\n### Hot Reloading\n\u003e [!NOTE]\n\u003e Hot reloading is disabled by default\n\nIf you want to enable hot reloading, Use this:\n```python\nconfig = configurationlib.Instance(file=\"config.json\", format=configurationlib.Format.YAML, hot_reloading=True)\n```\nHot reloading will check the file for changes and update the variable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokofixcomputers%2Fconfigurationlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkokofixcomputers%2Fconfigurationlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokofixcomputers%2Fconfigurationlib/lists"}