A lightweight database system for Python
Project description
Storify
Storify is a dead-simple, lightweight Python database library that uses msgpack for efficient data serialization.
It provides a framework for data storage and retrieval, with an optional ORM model for interaction with data.
Storify supports automatic backups and error handling, ensuring data integrity and reliability.
Features
- Create and manage multiple msgpack-based databases with ease.
- Lightweight ORM-esque model for easy interaction with data.
- Automatic backups and data flushing to prevent data loss.
- Built-in error handling to automatically recover from database corruption and loading issues.
- Configurable save intervals for optimized performance.
Installation
pip install storify
Usage
Here's a simplified example of how to use the storify package:
from storify import Storify
# Initialize Storify
storify = Storify(root="example_data")
db_name = "example_db"
# Check if the database exists
if storify.db_exists(db_name):
print(f"Database '{db_name}' exists. It will be loaded.")
# Initialize a new database
db = storify.get_db(name=db_name)
# Add some data to the database
db["key1"] = "value1"
db["key2"] = "value2"
# Get some data from the database
print(f"key1: {db['key1']}")
print(f"key2: {db['key2']}")
# Flush all databases (force save)
storify.flush()
For more complete examples, including how to use the ORM, please check the examples folder.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file storify-0.0.11.tar.gz.
File metadata
- Download URL: storify-0.0.11.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4160e3ffe37a3129898cf502b3b16e02ff16c33f23357cb517f6f88aa3559c09
|
|
| MD5 |
e0d614b7f75bc6fb378da840bd10c9cc
|
|
| BLAKE2b-256 |
27101c85e2ee7ac7e68be5439a7053942effaaec58b9e3ad786db17d61d1b94d
|
File details
Details for the file storify-0.0.11-py3-none-any.whl.
File metadata
- Download URL: storify-0.0.11-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
607db35affb4aa037fede9adda9372238bed06716daa6020f0b90e0510b763ef
|
|
| MD5 |
a23182e891799ef406ccf98819b2810b
|
|
| BLAKE2b-256 |
d1b7318d52bb1f335b533dcc82e56095d65c192f0413db126bfff483830d30a0
|