Metadata-Version: 2.4
Name: treechain-adapters
Version: 1.0.0
Summary: TreeChain database adapters — drop-in encryption for MongoDB, PostgreSQL, MySQL, Redis, SQLite, Supabase. Patent Pending — EP26025007.1
Author-email: TreeChain Labs <security@treechain.ai>
License: Proprietary
Project-URL: Homepage, https://treechain.ai
Project-URL: Documentation, https://api-eu.treechain.ai/docs
Keywords: encryption,database,mongodb,postgresql,mysql,redis,steganography,hipaa,zero-knowledge
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Topic :: Database
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: treechain>=4.0.0
Requires-Dist: httpx>=0.24.0
Provides-Extra: mongodb
Requires-Dist: motor>=3.0.0; extra == "mongodb"
Provides-Extra: postgresql
Requires-Dist: asyncpg>=0.27.0; extra == "postgresql"
Provides-Extra: mysql
Requires-Dist: aiomysql>=0.1.1; extra == "mysql"
Provides-Extra: sqlite
Requires-Dist: aiosqlite>=0.19.0; extra == "sqlite"
Provides-Extra: redis
Requires-Dist: redis>=5.0.0; extra == "redis"
Provides-Extra: supabase
Requires-Dist: supabase>=1.0.0; extra == "supabase"
Provides-Extra: all
Requires-Dist: treechain-adapters[mongodb,mysql,postgresql,redis,sqlite,supabase]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Dynamic: license-file

# TreeChain Database Adapters

**Patent Pending — EP26025007.1**

Drop-in encryption for any database. Three lines of code.
Every field auto-encrypts with the Polyglottal Cipher.
Your database stays exactly as is — TreeChain wraps it transparently.

## Supported Databases

- **MongoDB** (via Motor async client)
- **PostgreSQL** (via asyncpg)
- **MySQL** (via aiomysql)
- **SQLite** (via aiosqlite)
- **Redis** (via redis-py async)
- **Supabase** (via supabase-py)

## Installation

```bash
pip install treechain-adapters

# With specific database support:
pip install treechain-adapters[mongodb]
pip install treechain-adapters[postgresql]
pip install treechain-adapters[all]
```

## Usage

```python
# Before TreeChain:
client = AsyncIOMotorClient(MONGO_URI)
db = client.mydb

# After TreeChain (3 lines changed):
from treechain_adapters import MongoDBAdapter

tc = MongoDBAdapter(api_key="gj_live_...", customer_id="jordan")
db = tc.wrap(client.mydb)

# Everything else stays identical.
# Every write auto-encrypts via GlyphJammer.
# Every read auto-decrypts transparently.
# Portal populates in real time.
await db.patients.insert_one({"name": "John Smith", "ssn": "123-45-6789"})
# Stored as: {"name": "馏𜽡㌎𬵃...", "ssn": "𘫙𡢽甎똂..."}
```

## What Happens Under the Hood

1. You write data to your database as normal
2. The adapter intercepts string fields and encrypts them with GlyphJammer
3. Your database stores multilingual poetry instead of plaintext
4. On read, fields are transparently decrypted back
5. Your TreeChain portal shows all records in real time
6. DuckDB local copy created for redundancy

## Performance

- Zero blocking on writes — encryption runs in-line, portal population is fire-and-forget
- 68ms average encrypt latency on primary node
- Your application code does not change

## Links

- Website: [treechain.ai](https://treechain.ai)
- API Docs: [api-eu.treechain.ai/docs](https://api-eu.treechain.ai/docs)
- Support: security@treechain.ai

## License

Proprietary — TreeChain Labs
Patent Pending — EP26025007.1

See [LICENSE](LICENSE) for full terms.
