https://github.com/tagoworks/pyjondb
A lightweight, encrypted JSON-based database with support for collections, document operations, and aggregation.
https://github.com/tagoworks/pyjondb
aggregation collections database document encryption file-based json-database linkage local nested-data nosql python quary secure-storage tree-structure
Last synced: 11 months ago
JSON representation
A lightweight, encrypted JSON-based database with support for collections, document operations, and aggregation.
- Host: GitHub
- URL: https://github.com/tagoworks/pyjondb
- Owner: tagoWorks
- License: mit
- Created: 2024-05-30T22:55:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-01T16:24:54.000Z (over 1 year ago)
- Last Synced: 2025-03-07T11:47:58.702Z (11 months ago)
- Topics: aggregation, collections, database, document, encryption, file-based, json-database, linkage, local, nested-data, nosql, python, quary, secure-storage, tree-structure
- Language: Python
- Homepage: https://pypi.org/project/PyJONDB/
- Size: 19.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PyJONDB
A lightweight, encrypted JSON-based database with support for collections, document operations, and aggregation.





Python JavaScript Object Notation Database (without script since it sounds better)
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.
### Use pip to download the latest release
```sh
pip install pyjondb
```
### Create a user with admin role
```python
# 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 and create the database
```python
# 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)
```
### Writing data to the database
```python
# Create a collection
db.create_collection('my_collection', session_id)
# Add a document
db.add_document('my_collection', {'name': 'example'}, session_id)
```
### Read the data
```python
# 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](https://github.com/t-a-g-o/PyJONDB)
# License & Contact 📃
This project is published under the [MIT license](./LICENSE)
If you are interested in working together, or want to get in contact with me please email me at santiago@tago.works