Skip to main content

Zero-config NoSQL backend database as a Python package

Project description

dbini

Zero-config NoSQL backend database as a Python package

Python PyPI Stars Forks Issues License


๐Ÿ“‹ Table of Contents


๐Ÿš€ 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+
  • ๐Ÿ“Š CRUD operations for collections and documents
  • ๐Ÿ–ผ๏ธ File storage and retrieval
  • โšก Real-time WebSocket updates for WAL events
  • ๐Ÿ” Query with filters and limits

๐Ÿ› ๏ธ Installation

Prerequisites

  • Python 3.9+
  • pip

Quick Start

# Install from PyPI
pip install dbini

# Or install from local repo
# 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 document
  • POST /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 collection
  • files/ โ†’ stores images or other files uploaded
  • meta/project.json โ†’ optional project settings

๐Ÿ—๏ธ Built With

  • Python - Core language
  • FastAPI - REST API server
  • Uvicorn - ASGI server

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the Project
  2. Create your Feature Branch git checkout -b feature/AmazingFeature
  3. Commit your Changes git commit -m "Add AmazingFeature"
  4. Push to the Branch git push origin feature/AmazingFeature
  5. 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

PyPI Link: https://pypi.org/project/dbini


๐Ÿ™ Acknowledgments

  • Thanks to all contributors who helped this project grow
  • Built with โค๏ธ and lots of โ˜•
  • Inspired by Firebase and modern local-first backends

โฌ† Back to Top

Made with โค๏ธ by Binidu01

โญ Star this repo if you find it useful!

Project details


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.2.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbini-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file dbini-0.1.2.tar.gz.

File metadata

  • Download URL: dbini-0.1.2.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dbini-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cd6e5cfce92d1838e1f420a02d74c976db6f8bb49e6cc83b4da3ae3f7e7ef29f
MD5 6d2ebef4f2a0e61524d098a5c590ca70
BLAKE2b-256 caa4fb892063c70656c650781e8feaefdec00afb9b15529888f160badf01b23c

See more details on using hashes here.

File details

Details for the file dbini-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dbini-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dbini-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a9dd17b3c825ac29a1d4ced68619d2850a49276d2765d2101fc32533ceea342
MD5 46e61fc0b2a20cc3d4768e2fc550f32c
BLAKE2b-256 7163db743df18d9dbdd38542af424a33d0b2dcb27aef2de70f0348bc364d5337

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page