Skip to main content

libdb

Easy Management and Creation of Database Based on JSON Format with High Speed and Optimized.



Installation

Install With pip in Windows:

pip install libdb

Install With pip3 in Linux:

# if not installed pip3
sudo apt-get update&&sudo apt-get install python3-pip 
# Install With pip3 command
pip3 install libdb

Install With Git

git clone https://github.com/libdb/libdb
cd libdb

Git Option's

Windows (python)

# Install Libdb in windows
python install.py
# Just upgrade libdb in windows
python install.py upgrade

Linux (python3)

# Install Libdb in Linux
python3 install.py
# Just upgrade libdb in Linux
python3 install.py upgrade

Usage

Here are some examples to demonstrate how to use the LibDB package.

Initializing the Database:

from libdb import JSONDatabase
# Initialize the database
db = JSONDatabase('mydb.json')

Creating a New Entry

db.create('name', 'Alice')
print(db.read('name'))  # Output: Alice

Bulk Creating Entries

items = {
    'name': 'Alice',
    'age': 30,
    'city': 'Wonderland'
}
db.bulk_create(items)
print(db.read('age'))  # Output: 30
print(db.read('city'))  # Output: Wonderland

Updating an Entry

db.update('name', 'Bob')
print(db.read('name'))  # Output: Bob

Deleting an Entry

db.delete('name')
print(db.read('name'))  # Output: None

Listing All Keys

list_keys = db.list_keys()
print(list_keys)  # Output: ['age', 'city']

Clearing the Database

db.clear()
print(db.list_keys())  # Output: []

Searching for Entries

users = {
    'user1': {'name': 'Alice', 'age': 30},
    'user2': {'name': 'Bob', 'age': 25},
    'user3': {'name': 'Charlie', 'age': 30}
}
db.bulk_create(users)
result = db.search('age', 30)
print(result)  # Output: {'user1': {'name': 'Alice', 'age': 30}, 'user3': {'name': 'Charlie', 'age': 30}}

Running Tests

You can run the tests to ensure everything is working correctly:

python -m unittest discover tests

Release files for libdb 4.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libdb 4.6.0
File Size Uploaded
libdb-4.6.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libdb 4.6.0
File Interpreter ABI Platform
libdb-4.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / libdb-4.6.0.tar.gz

Download URL libdb-4.6.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
665aa59b5a97cc192d2dd91d37ea476801406af927c93d16d2fbef953b5e73d8
BLAKE2b-256 checksum
How to use checksums
102d512e029a5b9595fcba2a3197785ff238de3e059fcfd553e9043f0111c59f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / libdb-4.6.0-py3-none-any.whl

Download URL libdb-4.6.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6cd9aef48e0be09387a760a82535861225871e002494858fbaf8508c5dabd9f
BLAKE2b-256 checksum
How to use checksums
e4a231f4ce4b722087c7f497b4eb2ecf57168dc8125302135878601a1584f916
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

4.6.0 This release

2 release files

4.3.6

2 release files

4.3.3

2 release files

4.3.0

2 release files

4.0.6

2 release files

4.0.3

2 release files

4.0.0

2 release files

1.6.6

2 release files

1.6.3

2 release files

1.6.0

2 release files

1.3.6

2 release files

1.3.3

2 release files

1.3.0

2 release files

1.0.6

2 release files

1.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page