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.15.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.15-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysimdb-0.1.15.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.15.tar.gz
Algorithm Hash digest
SHA256 e4d754acbfc1cc5406952420aa2a85ff4e739cecb19479917a389082536214be
MD5 fff6dafa1ecce595287398cca8c8fe40
BLAKE2b-256 55a567137b4e53a2e1f7ea658a7fd06ac302b17be13382735811ea7ab312adf3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysimdb-0.1.15-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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 9a753c48d6b18a4f78e002a4a2c4376124296ad445146508809240fd6b0672ce
MD5 a725374bdf0d689a8399abb8648846f7
BLAKE2b-256 7aa74c965d4c8a85f980ebbeee819f6c8b22ee7a6f4f62814d6912cc73cff90d

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