powerfull DB for your project.
Project description
Database Library
A simple Python library for managing data with file-based storage.
Installation
You can install the library via pip:
pip install database-library
Usage
from database import Database
# Initialize the database with options
db = Database({
'path': 'data/db.json', # Path to the JSON file
'logs': True # Enable logging (optional, default is True)
})
# Set data
db.set('key', 'value')
# Get data
data = db.get('key')
# Add numeric values
db.add('numeric_key', 5)
# Remove numeric values
db.remove('numeric_key', 2)
# Push value to an array
db.push('array_key', 'new_value')
# Remove value from an array
db.unpush('array_key', 'value_to_remove')
Methods
set(name, value): Set a key-value pair in the database.get(name): Get the value associated with a key from the database.add(name, value): Add a numeric value to an existing numeric value in the database.remove(name, value): Remove a numeric value from an existing numeric value in the database.push(name, value): Push a value to an array stored in the database.unpush(name, value): Remove a value from an array stored in the database.
Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.
License
This library is licensed under the MIT License.
This README provides installation instructions, usage examples, methods overview, contribution guidelines, and licensing information for the database library in English.
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
monsdatabase-0.1.tar.gz
(2.5 kB
view details)
File details
Details for the file monsdatabase-0.1.tar.gz.
File metadata
- Download URL: monsdatabase-0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90fdf3162d036c9f6a66f142a5ebb8cade811425a07992fe4760577e642b18da
|
|
| MD5 |
47050f2e1c4dbdcb5575baa09f765923
|
|
| BLAKE2b-256 |
ed9bf57e9145aa14857ac5b5fe90858f24662bc3d704a054293c6b0061b5144d
|