aioconfig
aioconfig efficiently and thread-safely stores configurations in the
background (asynchronously).
Installation
pip install aioconfig
Usage
The interface of aioconfig is dramatically easy to use.
For example, both set(key, value) and await set(key, value) store a pair of
key/value, which the former one is a fire-and-forget asynchronous function call
while the latter one blocks until the data written onto the disk.
Init
import aioconfig
storage = aioconfig.get_storage(await aioconfig.attach('example.db'))
section = await aioconfig.get('default')
Delete
section.delete(key='foo')
Blocking delete (wait until it's done)
await section.delete(key='foo')
Get
value1 = await section.get(key='foo', default='bar')
value2 = await section.get(key='baz', default=12.3)
Get all
value = await section.get_all()
Set (fire-and-forget)
section.set(key='foo', value='bar')
section.set(key='baz', value=12.3)
Blocking set (wait until it's done)
await section.set(key='foo', value='bar')
await section.set(key='baz', value=12.3)
Batch set (fire-and-forget) (TBD)
with storage.transation():
storage.set(
key='foo', value='bar',
section='default_section')
storage.set(
key='baz', value=12.3,
section='default_section')
Blocking batch set (wait until it's done) (TBD)
async with storage.transation():
storage.set(
key='foo', value='bar',
section='default_section')
storage.set(
key='baz', value=12.3,
section='default_section')
Metadata
Release files for aioconfig 0.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aioconfig-0.4.8.tar.gz | 8.8 kB | Without provenance | Details for aioconfig-0.4.8.tar.gz |
Release files / aioconfig-0.4.8.tar.gz
| Download URL | aioconfig-0.4.8.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2977b5249fa2c109de2e3c9b0c6c277c1915a1aa481de1c52302f1ba9873a438
|
|
BLAKE2b-256 checksum How to use checksums |
0d645a66f10f35c7ab0ce97f71b8f7be4dc827b456bbcded9b159010eb0d2fcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.4 Windows/10
|
Security for aioconfig 0.4.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.