Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.