SmartKDB v5 🧠
The Easiest Database for Python
SmartKDB is a local-first database that's as easy as a Python dictionary, but with superpowers:
- 🚀 No setup - Works instantly
- 💾 ACID Transactions - Bank-grade safety
- 🧠 AI-Powered - Learns from your usage
- ⏰ Time-Travel - Query past data
- 📦 Pure Python - No dependencies
🎯 Install in 10 Seconds
pip install smartkdb
⚡ Use in 30 Seconds
from smartkdb import SmartKDB
# Create database
db = SmartKDB("mydb.kdb")
# Create table
users = db.create_table("users")
# Add data
users.insert({"name": "Alice", "age": 25})
users.insert({"name": "Bob", "age": 30})
# Query data
results = users.query().where("age", ">", 25).execute()
print(results) # [{'name': 'Bob', 'age': 30}]
That's it! 🎉
📚 Learn in 5 Minutes
Run our interactive tutorial:
python -c "from smartkdb import SmartKDB; help(SmartKDB)"
Or check our example files:
🚀 What Makes SmartKDB Special?
1. Zero Configuration
No servers, no config files, no complexity. Just pip install and code.
2. ACID Transactions
tx = db.tx_manager.begin()
try:
users.insert({"name": "Charlie"}, transaction_id=tx)
db.tx_manager.commit(tx)
except:
db.tx_manager.rollback(tx)
3. AI Brain 🧠
The database learns from your queries and suggests optimizations:
db.brain.suggest_indexes("users")
# Returns: ['Create index on email for faster queries']
4. Time-Travel Queries ⏰
See your data as it was in the past:
history = db.version_manager.get_history("users", "user_123")
# Shows all versions of the record
📖 Complete Documentation
| Guide | Description |
|---|---|
| 📘 User Guide | For beginners - Step-by-step tutorials |
| 🛠️ Developer Guide | For advanced users - API deep dive |
| 🏗️ Architecture | How SmartKDB works internally |
| 🔌 API Reference | Complete method documentation |
| 📦 Installation | Detailed installation guide |
Full Documentation: https://smartkdb.readthedocs.io/
💡 More Examples
Example 1: E-Commerce Store
db = SmartKDB("store.kdb")
products = db.create_table("products", indexes=["category"])
products.insert({
"name": "Laptop",
"price": 999,
"category": "Electronics"
})
# Find all electronics under $1000
cheap_electronics = products.query()\
.where("category", "==", "Electronics")\
.where("price", "<", 1000)\
.execute()
Example 2: User Management
users = db.create_table("users", pk="email", indexes=["role"])
users.insert({"email": "admin@company.com", "role": "admin"})
# Update user
users.update("admin@company.com", {"role": "superadmin"})
# Delete user
users.delete("old_user@company.com")
See more in our examples folder!
🎮 Try It Now
# Clone and run examples
git clone https://github.com/alhdrawiz6-ai/smartkdb
cd smartkdb
python examples/quickstart.py
python examples/transactions.py
python examples/ai_features.py
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md
📄 License
MIT License - See LICENSE
🌟 Why SmartKDB?
| Feature | SmartKDB | SQLite | MongoDB |
|---|---|---|---|
| Easy to use | ✅ Python dict-like | ⚠️ SQL required | ⚠️ Schema complex |
| No setup | ✅ | ✅ | ❌ Server needed |
| ACID | ✅ | ✅ | ⚠️ Partial |
| AI Features | ✅ Brain & Optimization | ❌ | ❌ |
| Time-Travel | ✅ Built-in | ❌ | ❌ |
| Pure Python | ✅ | ❌ C extension | ❌ Server |
Perfect for:
- 🎯 Prototypes & MVPs
- 📱 Desktop applications
- 🤖 AI/ML projects
- 📊 Data analysis scripts
- 🧪 Testing & experiments
🔗 Links
- PyPI: https://pypi.org/project/smartkdb/
- Documentation: https://smartkdb.readthedocs.io/
- GitHub: https://github.com/alhdrawiz6-ai/smartkdb
- Issues: https://github.com/alhdrawiz6-ai/smartkdb/issues
- Changelog: https://smartkdb.readthedocs.io/en/latest/CHANGELOG.html
Made with ❤️ by Alhdrawi
Star ⭐ this repo if you find it useful!
Metadata
Release files for smartkdb 5.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smartkdb-5.0.5.tar.gz | 32.0 kB | Without provenance | Details for smartkdb-5.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smartkdb-5.0.5-py3-none-any.whl | Python 3 | none | any | Details for smartkdb-5.0.5-py3-none-any.whl |
Total release size: 52.9 kB
Release files / smartkdb-5.0.5.tar.gz
| Download URL | smartkdb-5.0.5.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc52ca39ad8a4d822f1815bac3afc9b092df82705e391efcb231e4626cf7e56a
|
|
BLAKE2b-256 checksum How to use checksums |
b412e17d5092c23836f527f13fb7ab714b6e12fcc8316f972d37197c4ec1525d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / smartkdb-5.0.5-py3-none-any.whl
| Download URL | smartkdb-5.0.5-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f902366c19d8526ef6c14adff37e449ae49cdb718c52e2287aa85e4d72bc3104
|
|
BLAKE2b-256 checksum How to use checksums |
391e42f6a2064e8af56710b9d97f424237f224463baac38e35e2e102e97610ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for smartkdb 5.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.