{"id":24640027,"url":"https://github.com/mrjohannchang/aioconfig.py","last_synced_at":"2025-03-20T11:17:48.015Z","repository":{"id":49357605,"uuid":"228644059","full_name":"mrjohannchang/aioconfig.py","owner":"mrjohannchang","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-25T02:16:24.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T09:52:24.575Z","etag":null,"topics":["asynchronous","asyncio","database","key-value","library","python","storage"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aioconfig/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrjohannchang.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":"2019-12-17T15:18:25.000Z","updated_at":"2025-02-20T18:39:44.000Z","dependencies_parsed_at":"2022-09-04T23:02:06.348Z","dependency_job_id":null,"html_url":"https://github.com/mrjohannchang/aioconfig.py","commit_stats":null,"previous_names":["johannchangpro/aioconfig.py","changyuheng/aioconfig.py","mrjohannchang/aioconfig.py"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjohannchang%2Faioconfig.py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjohannchang%2Faioconfig.py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjohannchang%2Faioconfig.py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjohannchang%2Faioconfig.py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrjohannchang","download_url":"https://codeload.github.com/mrjohannchang/aioconfig.py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244600725,"owners_count":20479307,"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":["asynchronous","asyncio","database","key-value","library","python","storage"],"created_at":"2025-01-25T11:30:20.007Z","updated_at":"2025-03-20T11:17:47.989Z","avatar_url":"https://github.com/mrjohannchang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aioconfig\n\n`aioconfig` **efficiently** and **thread-safely** stores configurations in the\nbackground (**asynchronously**).\n\n## Installation\n\n```sh\npip install aioconfig\n```\n\n## Usage\n\nThe interface of `aioconfig` is dramatically easy to use.\nFor example, both `set(key, value)` and `await set(key, value)` store a pair of\nkey/value, which the former one is a fire-and-forget asynchronous function call\nwhile the latter one blocks until the data written onto the disk.\n\n### Init\n\n```py\nimport aioconfig\nstorage = aioconfig.get_storage(await aioconfig.attach('example.db'))\nsection = await aioconfig.get('default')\n```\n\n### Delete\n\n```py\nsection.delete(key='foo')\n```\n\n#### Blocking delete (wait until it's done)\n\n```py\nawait section.delete(key='foo')\n```\n\n### Get\n\n```py\nvalue1 = await section.get(key='foo', default='bar')\nvalue2 = await section.get(key='baz', default=12.3)\n```\n\n### Get all\n\n```py\nvalue = await section.get_all()\n```\n\n### Set (fire-and-forget)\n\n```py\nsection.set(key='foo', value='bar')\nsection.set(key='baz', value=12.3)\n```\n\n#### Blocking set (wait until it's done)\n\n```py\nawait section.set(key='foo', value='bar')\nawait section.set(key='baz', value=12.3)\n```\n\n### Batch set (fire-and-forget) (TBD)\n\n```py\nwith storage.transation():\n    storage.set(\n        key='foo', value='bar',\n        section='default_section')\n    storage.set(\n        key='baz', value=12.3,\n        section='default_section')\n```\n\n#### Blocking batch set (wait until it's done) (TBD)\n\n```py\nasync with storage.transation():\n    storage.set(\n        key='foo', value='bar',\n        section='default_section')\n    storage.set(\n        key='baz', value=12.3,\n        section='default_section')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjohannchang%2Faioconfig.py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrjohannchang%2Faioconfig.py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjohannchang%2Faioconfig.py/lists"}