
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Easy Management and Creation of Database Based on JSON Format with High Speed and Optimized
Easy Management and Creation of Database Based on JSON Format with High Speed and Optimized.
pip
in Windows:pip install libdb
pip3
in Linux:# if not installed pip3
sudo apt-get update&&sudo apt-get install python3-pip
# Install With pip3 command
pip3 install libdb
git clone https://github.com/libdb/libdb
cd libdb
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
Here are some examples to demonstrate how to use the LibDB package.
from libdb import JSONDatabase
# Initialize the database
db = JSONDatabase('mydb.json')
db.create('name', 'Alice')
print(db.read('name')) # Output: Alice
items = {
'name': 'Alice',
'age': 30,
'city': 'Wonderland'
}
db.bulk_create(items)
print(db.read('age')) # Output: 30
print(db.read('city')) # Output: Wonderland
db.update('name', 'Bob')
print(db.read('name')) # Output: Bob
db.delete('name')
print(db.read('name')) # Output: None
list_keys = db.list_keys()
print(list_keys) # Output: ['age', 'city']
db.clear()
print(db.list_keys()) # Output: []
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}}
You can run the tests to ensure everything is working correctly:
python -m unittest discover tests
FAQs
Easy Management and Creation of Database Based on JSON Format with High Speed and Optimized
We found that libdb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.