Mostly Invisible Database. A database access layer that acts like python in-memory objects.
Project description
Mostly Invisible Database
A database access layer that acts like python in-memory objects.
Disclaimer: Only minimal attempts have been made at speed. And mainly intended for personal projects. Deeply nested data structures will likely be slow.
Example:
>>> import midb
>>> root = midb.get_root('db_file.db')
>>> root['test'] = 1
>>> root['test2'] = {'test3': 3}
>>> exit()
later ...
>>> import midb
>>> root = midb.get_root('db_file.db')
>>> root['test']
1
>>> root['test2']['test3']
3
>>> root['test2']
PDict({'test3': 3}, _backend=SQLiteBackend(filename="db_file.db"), _id=1, _temp=None)
>>> root['test2'].in_memory()
{'test3': 3}
>>> exit()
What's currently supported?
Currently, the types that are supported are:
- str
- None
- bool
- int
- float
- datetime.datetime
- datetime.date
- datetime.time
- dict (silently converted to PDict, must not contain unsupported types)
- tuple (silently convert to PTuple, must not contain unsupported types, currently can't be used as PDict keys.)
- list (silently convert to PList, must not contain unsupported types)
Up Next:
- Support for custom objects.
Future:
- Support for hashable tuples as dict keys.
- Support for and/or documentation of additional or custom serializers.
- More examples and documentation
Bugs
Please report bugs at https://gitlab.com/gossrock/midb/-/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
midb-0.3.0.tar.gz
(15.9 kB
view hashes)
Built Distribution
midb-0.3.0-py3-none-any.whl
(25.2 kB
view hashes)