A lightning-fast, feature-rich embedded database designed for modern Python applications.
Project description
ApexBase
🚀 A lightning-fast, feature-rich embedded database designed for modern Python applications.
Features
✨ High Performance
- Built on SQLite with optimized configurations
- Efficient batch operations support
- Automatic performance optimization
- Concurrent access support
🔍 Powerful Query Capabilities
- SQL-like query syntax
- Full-text search with case-insensitive support
- Complex queries with multiple conditions
- JSON field support
📊 Data Framework Integration
- Seamless integration with Pandas
- Native support for PyArrow
- Built-in Polars compatibility
🎯 Multi-table Support
- Multiple table management
- Easy table switching
- Automatic table creation and deletion
🛡️ Data Integrity
- ACID compliance
- Transaction support
- Automatic error handling
- Data consistency guarantees
🔧 Developer Friendly
- Simple and intuitive API
- Minimal configuration required
- Comprehensive documentation
- Extensive test coverage
Installation
pip install apexbase
Quick Start
from apexbase import ApexClient
# Initialize the database
client = ApexClient("my_database")
# Store single record
record = {"name": "John", "age": 30, "tags": ["python", "rust"]}
id_ = client.store(record)
# Store multiple records
records = [
{"name": "Jane", "age": 25},
{"name": "Bob", "age": 35}
]
ids = client.store(records)
# Query records
results = client.query("age > 25")
for record in results:
print(record)
# Full-text search
client.set_searchable("name", True)
results = client.search_text("John")
# Import from Pandas
import pandas as pd
df = pd.DataFrame({"name": ["Alice", "Bob"], "age": [28, 32]})
client.from_pandas(df)
Advanced Usage
Multi-table Operations
# Create and switch tables
client.create_table("users")
client.create_table("orders")
client.use_table("users")
# Store user data
user = {"name": "John", "email": "john@example.com"}
user_id = client.store(user)
# Switch to orders table
client.use_table("orders")
order = {"user_id": user_id, "product": "Laptop"}
client.store(order)
Complex Queries
# Multiple conditions
results = client.query("age > 25 AND city = 'New York'")
# Range queries
results = client.query("score >= 85.0 AND score <= 90.0")
# LIKE queries
results = client.query("name LIKE 'J%'")
Performance Optimization
# Disable automatic FTS updates for batch operations
client.set_auto_update_fts(False)
# Store large batch of records
records = [{"id": i, "value": i * 2} for i in range(10000)]
ids = client.store(records)
# Manually rebuild search index
client.rebuild_search_index()
Requirements
- Python >= 3.9
- Dependencies:
- orjson
- pandas
- pyarrow
- polars
- numpy
- psutil
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apexbase-0.0.1.tar.gz.
File metadata
- Download URL: apexbase-0.0.1.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea49cbbffe651e7b3cf53783daf940cac3b722ac02f2f7e8efc1b6ff547cca25
|
|
| MD5 |
ae44ddc2a85f004ed92ac9345fc2d026
|
|
| BLAKE2b-256 |
7079a57b378c75e901e64fcb62145f8f1d00165c7bd1f1a3d1c1d5cb142c2789
|
File details
Details for the file apexbase-0.0.1-py3-none-any.whl.
File metadata
- Download URL: apexbase-0.0.1-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e395c26951deab8025d5547b45ad5e252f4fb01dfe5b2e64785ad5adc6f92b7
|
|
| MD5 |
9a095ee8bac0aa4d71e3b3236a7e17da
|
|
| BLAKE2b-256 |
6c112938029e418946b6d64927279a91a40c9597ddf82e6bc012615a700d4da4
|