Zero-config NoSQL backend database as a Python package
Project description
๐ Table of Contents
- ๐ Features
- ๐ ๏ธ Installation
- ๐ป Usage
- ๐ Project Structure
- ๐๏ธ Built With
- ๐ค Contributing
- ๐ License
- ๐ Contact
- ๐ Acknowledgments
๐ Features
- โจ Zero-config backend database
- ๐ฅ Store JSON documents and files inside the project folder
- ๐ก๏ธ Secure atomic writes for data and files
- ๐ REST API & WebSocket support for any language
- ๐ฆ Self-contained Python package
- โก Works in Python 3.9+
๐ ๏ธ Installation
Prerequisites
- Python 3.9+
- pip
Quick Start
# Clone the repository
git clone https://github.com/Binidu01/dbini.git
# Navigate to project directory
cd dbini
# (Optional) Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package locally
pip install .
# Run a test script
python examples/test_dbini.py
๐ป Usage
As Local Database
from dbini import DBini
db = DBini("myproject")
user_id = db.collection("users").add({"name": "Alice", "age": 22})
print("Created user:", user_id)
# Query documents
for doc in db.collection("users").find({"age": 22}):
print(doc)
# Save image/file
file_id = db.save_file("avatar.png")
db.collection("users").update(user_id, {"avatar": file_id})
As API Server
from dbini.server import DBiniServer
server = DBiniServer("myproject")
server.serve(port=8080)
Endpoints Example:
POST /v1/{collection}/documentsโ Create documentPOST /v1/filesโ Upload file- All data stays inside the project folder.
๐ Project Structure
Example project layout when using dbini:
myproject/
โโ data/
โ โโ collections/
โ โโ users/
โ โโ <uuid>.json
โโ files/
โ โโ <uuid>.png
โโ meta/
โโ project.json
collections/โ stores JSON documents per collectionfiles/โ stores images or other files uploadedmeta/project.jsonโ optional project settings
๐๏ธ Built With
- Python - Core language
- FastAPI - REST API server
- Uvicorn - ASGI server
๐ค Contributing
Contributions are welcome!
- Fork the Project
- Create your Feature Branch
git checkout -b feature/AmazingFeature - Commit your Changes
git commit -m "Add AmazingFeature" - Push to the Branch
git push origin feature/AmazingFeature - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file.
๐ Contact
Binidu01 - GitHub Profile
Project Link: https://github.com/Binidu01/dbini
๐ Acknowledgments
- Thanks to all contributors who helped this project grow
- Built with โค๏ธ and lots of โ
- Inspired by Firebase and modern local-first backends
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dbini-0.1.0.tar.gz
(4.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
dbini-0.1.0-py3-none-any.whl
(5.2 kB
view details)
File details
Details for the file dbini-0.1.0.tar.gz.
File metadata
- Download URL: dbini-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12db917a2460cba6a25e4d8f92a7d56331de5b99ad1cf04376973bf24a4f7ff8
|
|
| MD5 |
91eac3375cab56322de51d1f2cc72da1
|
|
| BLAKE2b-256 |
d3bbe9222e2c9f05ff289fdeaa48a997cf531bd6fd3e7802a5ab0156a480f520
|
File details
Details for the file dbini-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dbini-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c23ab155434bc9911cfbaecfcdc1abb5cfbc788d19f3604ad65ea59c807d1738
|
|
| MD5 |
4d1bdbe30421a6356fbde63eee66d73e
|
|
| BLAKE2b-256 |
ee9f5e59e22d8f56fa39c133d3be1e38107c7886c4a8e146a16fe3f6b308a398
|