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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysimdb-0.1.14.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.14.tar.gz
Algorithm Hash digest
SHA256 9946ebd9f06b8498cc71d3bfb9d032c33fface7d00845be4c0f9133f98b92b9e
MD5 30e8320649126e9ce2e3d3d3f53c495e
BLAKE2b-256 7718b7e41c4fdddba412823ee192604e95a23a8160e3994829e581597ab46cf7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysimdb-0.1.14-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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 aab63b9990994a8d48b42742a98a23c2d66dbabf2794fdf9ca535ce42d929c32
MD5 fed64aed43c951f27ebc51b635765c57
BLAKE2b-256 545285f588d298e7c5105cdf6f8d9d67a3da1d003e58be7c909bd2d983efaab2

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