Skip to main content

Standalone Python database with tables, CRUD, and JSON persistence

Project description

PhaseDB v2

PhaseDB v2 is a standalone, pure-Python database system with tables, auto-increment IDs, CRUD operations, and JSON persistence.
It allows you to work with databases without SQLite or any external dependency. Optional ORM-style models let you define tables as Python classes.


📦 Installation

1. Local installation

If you have the PhaseDB folder locally:

pip install .

2. PyPI (after uploading)

pip install phasedb

⚡ Usage

Import and connect

import phasedb

# Create or load a database file
db = phasedb.PhaseDB("mydb.pdb")

Create a table

db.create_table("users")

Insert data

db.insert("users", {"name":"Alice","coins":100})
db.insert("users", {"name":"Bob","coins":200})

Select data

all_users = db.select("users")
rich_users = db.select("users", condition=lambda r: r["coins"] > 150)

print(all_users)
print(rich_users)

Update data

db.update("users", {"coins":999}, condition=lambda r: r["name"]=="Alice")

Delete data

db.delete("users", condition=lambda r: r["name"]=="Bob")

🧱 Using Models (ORM-style)

from phasedb.models import BaseModel

class User(BaseModel):
    table_name = "users"
    columns = ["name", "coins", "level"]

user_model = User(db)

# Insert using model
user_model.insert(name="Charlie", coins=500, level=1)

# Select using model
print(user_model.select())

# Update
user_model.update({"coins":600}, condition=lambda r: r["name"]=="Charlie")

# Delete
user_model.delete(condition=lambda r: r["name"]=="Charlie")

🔹 Features

  • Fully standalone (no SQLite)
  • Tables with auto-increment IDs
  • Pythonic CRUD: insert, select, update, delete
  • JSON persistence for saving/loading data
  • Optional ORM-style models for cleaner table management
  • Simple, readable Python API

🔧 Requirements

  • Python 3.8+
  • No external dependencies

📌 License

MIT License

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

phasedb-2.0.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

phasedb-2.0.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file phasedb-2.0.2.tar.gz.

File metadata

  • Download URL: phasedb-2.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for phasedb-2.0.2.tar.gz
Algorithm Hash digest
SHA256 22f01ca9c51d799d345b7e3b1bcb27893a019671fd0e8a7083b7c493596b0cd1
MD5 b52a6cedc3f58376d7146e5c5546a1b0
BLAKE2b-256 b1f5621320d02ad463aeddcd16ddcee35a6840614c59717a81761185703c61ec

See more details on using hashes here.

File details

Details for the file phasedb-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: phasedb-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for phasedb-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9f803c4cd581eb865466e43f95d371b99cef896001af27023c211315050aa206
MD5 a3a03b8b4e038417144128f1e5740c95
BLAKE2b-256 77615774ce6de4aa60ad108da95840ac7343c5e5af5d4c080fbd2321b3e0bc82

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