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.dev7.tar.gz (54.8 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.dev7-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file pysimdb-0.1.dev7.tar.gz.

File metadata

  • Download URL: pysimdb-0.1.dev7.tar.gz
  • Upload date:
  • Size: 54.8 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.dev7.tar.gz
Algorithm Hash digest
SHA256 a23594c200f090ad37fec62f54e6b7b6902db9803330f941ae0e2732ef654324
MD5 47b22f9e73fcbe285d9dec184c6cdc9c
BLAKE2b-256 ce9ba4b6f9a1ad3e264366d295e01d053c638a11a29dbc19b16cfe965da391ae

See more details on using hashes here.

File details

Details for the file pysimdb-0.1.dev7-py3-none-any.whl.

File metadata

  • Download URL: pysimdb-0.1.dev7-py3-none-any.whl
  • Upload date:
  • Size: 32.4 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.dev7-py3-none-any.whl
Algorithm Hash digest
SHA256 5a389f1cdbae0f50353cf1404d4694c96af8b1cd02f18962616be0f51b9cb232
MD5 3530565fc9c5570e0d3bdccc6fed9f8c
BLAKE2b-256 3a1b343efeac0b4cd4fb09f8086f72029ede0be03ea3e8b51185d472f347ba68

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