Metadata-Version: 2.4
Name: phonedb-client
Version: 1.0.0
Summary: Python PEP 249 database driver for Phone-as-Database mobile engine
Home-page: https://github.com/YOUR_USERNAME/phone-database
Author: Manish
Keywords: database,sqlite,mobile,android,driver,pep249
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: requires-python
Dynamic: summary

# PhoneDB Python Client Driver

A PEP 249 (Python Database API Specification v2.0) compliant database driver for the **Phone-as-Database** distributed mobile database engine.

Connect to, authenticate with, and query SQLite databases running directly on an Android mobile device from anywhere in the world.

---

## Installation

```bash
pip install phonedb
```

Or directly from GitHub:
```bash
pip install git+https://github.com/YOUR_USERNAME/phone-database.git#subdirectory=client
```

---

## Quickstart

```python
import phonedb

# 1. Connect to your phone
conn = phonedb.connect(
    host="https://your-service.onrender.com",  # Or http://localhost:8000
    database="ecommerce",
    username="admin",
    password="secretpassword123"
)

cursor = conn.cursor()

# 2. Create table & insert data
cursor.execute("""
    CREATE TABLE IF NOT EXISTS users (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name TEXT,
        age INTEGER
    )
""")

cursor.execute("INSERT INTO users (name, age) VALUES (?, ?)", ("Alice", 25))
print(f"Rows affected: {cursor.rowcount}")

# 3. Query records
cursor.execute("SELECT id, name, age FROM users WHERE age >= ?", (21,))

for row in cursor:
    # Access as object attributes or dictionary keys
    print(row.id, row.name, row.age)

cursor.close()
conn.close()
```

---

## Features

- **PEP 249 Compliant**: Implements `Connection`, `Cursor`, `execute()`, `fetchall()`, `fetchone()`, `description`, and standard exceptions (`AuthenticationError`, `OperationalError`).
- **Multi-Tenant Authentication**: Isolated databases protected by username and password.
- **Secure by Default**: Automatically works with HTTPS and WSS (secure WebSockets).
- **Parameterized Queries**: Safe value substitution with `?` placeholders.
