Skip to main content

A lightweight, JSON-based database library for Python

Project description

PySimDB

A lightweight, JSON-based database library for Python that provides a simple yet powerful interface for storing and querying structured data.

Features

  • Schema Validation: Enforce data types and required fields
  • CRUD Operations: Create, Read, Update, Delete records
  • Query Builder: Flexible querying with WHERE, ORDER BY, LIMIT, OFFSET
  • Joins: Join related data from multiple tables
  • Transactions: Atomic operations with rollback support
  • Indexing: Secondary indexes for improved query performance
  • Lightweight: Pure Python implementation with minimal dependencies
  • High Performance: Uses pysimdjson for fast JSON parsing

Installation

pip install pysimdb

Quick Start

from pysimdb import JsonDatabase, TableSchema

# Initialize database
db = JsonDatabase("data")

# Define a schema
user_schema = TableSchema({
    "id": int,
    "name": str,
    "age": int,
    "email": str
}, primary_key="id")

# Create table
db.create_table("users", user_schema)

# Insert data
user = {"id": 1, "name": "John Doe", "age": 30, "email": "john@example.com"}
db.insert("users", user)

# Query data
users = db.query("users").where("age", ">", 25).all()
print(users)

Performance

PySimDB uses pysimdjson for high-performance JSON parsing, which significantly improves read performance compared to the standard library's json module.

License

This project is licensed under the GNU General Public License v3.0.

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

pysimdb-0.1.0.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

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

pysimdb-0.1.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file pysimdb-0.1.0.tar.gz.

File metadata

  • Download URL: pysimdb-0.1.0.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pysimdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2a5df14052b383a8194be3ddef109f0e448468b07a3e2ee66a3d00db25483bee
MD5 a1b8c81fd864419d1b43233fd55950ef
BLAKE2b-256 f53f3d6b468412010b285d9952e32a6e7c67ff79af5eee493a5dddc5396a4871

See more details on using hashes here.

File details

Details for the file pysimdb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysimdb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pysimdb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2320dfdf6b90681b933e132483918942b3de1bf12ad8b88b4328b13e6ee5483d
MD5 b1965a834500d1b985961e6c2829f558
BLAKE2b-256 cbf5dccf04cecfa05352df809e1670e448f7fd3918017bc1002b8cb35fed7497

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