
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
jsondb-python
Advanced tools
A simple, lightweight, and file-based JSON database library for Python, now with proper error handling, a modular structure, and a powerful interactive REPL.
jsondb-python provides two ways to manage your data:
pip install jsondb-python
For the best REPL experience with auto-completion and history, it is recommended to install prompt_toolkit:
pip install prompt-toolkit
from jsondb import JsonDB
# Initialize the database
db = JsonDB('my_database.json')
try:
# Create a table
db.create_table('users')
# Insert data
db.insert_data('users', {'id': 1, 'name': 'Alice', 'role': 'admin'})
db.insert_data('users', {'id': 2, 'name': 'Bob', 'role': 'user'})
# Update data where role is 'user'
db.update_data(
'users',
condition=lambda user: user.get('role') == 'user',
new_data={'id': 2, 'name': 'Bob', 'role': 'member'}
)
# Delete data where id is 1
db.delete_data('users', condition=lambda user: user.get('id') == 1)
# Show final data
db.show_data('users')
except db.TableExistsError as e:
print(f"Setup failed because a table already exists: {e}")
except db.Error as e: # Catch any library-specific error
print(f"An error occurred with the database: {e}")
except Exception as e:
print(f"A general error occurred: {e}")
The library includes a powerful interactive REPL (Read-Eval-Print Loop) to manage your databases from the command line.
Launching the REPL:
# Start the REPL in the main menu
jsondb
# Or open a database file directly
jsondb ./path/to/your/database.json
Key Features:
Tab to get suggestions for commands, file paths, and table names..help in any mode to see a list of available commands.Example Session:
$ jsondb
🌟 JsonDB >>> .build
📁 Enter database path (example: data/mydb.json): users.json
✅ Database 'users.json' created/opened successfully!
💡 Use '.create <table_name>' to create a new table
📦 [users.json] >>> .create people
✅ Table 'people' created successfully!
📦 [users.json] >>> .use people
✅ Successfully selected table 'people'!
💡 Use '.insert' to add data
📋 [people] >>> .insert
# ... interactive prompt to add data ...
✅ Data added successfully!
📋 [people] >>> .show
# ... displays table data ...
📋 [people] >>> .exit
💾 Performing auto-save before exiting...
👋 Thank you for using JsonDB REPL!
💾 Your data has been safely saved
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A simple, lightweight, and file-based JSON database library for Python.
We found that jsondb-python 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.