A lightweight, encrypted JSON-based database with support for collections, document operations, and aggregation.
This package provides a lightweight, encrypted JSON-based database with support for collections, document operations, and aggregation. It uses the cryptography library for encryption and decryption of data, ensuring secure storage of your sensitive information. The PyPI package includes docstrings for each function to make it easier to learn.
pip install pyjondb
# Initialize authentication
auth = session.start()
auth.create_user('admin', 'adminpass', roles=['admin'])
# Authenticate and get a session ID
session_id = auth.authenticate('admin', 'adminpass')
if not session_id:
raise PermissionError("Authentication failed")
# Initialize the database
# The database function has optional values:
# pyjondb.database("database", "mypassword", debug=True/False, absolute=True/False)
db = database.init("database", "mydatabasekey", auth)
# Create the database
# Note: you should only create the database if it doesn't already exist
db.create(session_id)
# Create a collection
db.create_collection('my_collection', session_id)
# Add a document
db.add_document('my_collection', {'name': 'example'}, session_id)
# Get all documents in a collection
print(db.read_collection('my_collection', session_id))
PyJONDB gets way more advanced than writing simple data. To learn more about collections, documents, aggregation, linking, and tree structures read the docs
This project is published under the MIT license
If you are interested in working together, or want to get in contact with me please email me at santiago@tago.works