# 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
```bash
pip install apexbase
```
## Quick Start
```python
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
```python
# 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
```python
# 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
```python
# 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](LICENSE) file for details.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Raw data
{
"_id": null,
"home_page": null,
"name": "apexbase",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "database, embedded-database, sqlite, full-text-search",
"author": null,
"author_email": "Birch Kwok <birchkwok@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/40/6c/a9515eca8deb2d752956e3697ea11b21c6a8564d338074ca78caec4225b3/apexbase-0.0.2.tar.gz",
"platform": null,
"description": "# ApexBase\n\n\ud83d\ude80 A lightning-fast, feature-rich embedded database designed for modern Python applications.\n\n## Features\n\n\u2728 **High Performance**\n- Built on SQLite with optimized configurations\n- Efficient batch operations support\n- Automatic performance optimization\n- Concurrent access support\n\n\ud83d\udd0d **Powerful Query Capabilities**\n- SQL-like query syntax\n- Full-text search with case-insensitive support\n- Complex queries with multiple conditions\n- JSON field support\n\n\ud83d\udcca **Data Framework Integration**\n- Seamless integration with Pandas\n- Native support for PyArrow\n- Built-in Polars compatibility\n\n\ud83c\udfaf **Multi-table Support**\n- Multiple table management\n- Easy table switching\n- Automatic table creation and deletion\n\n\ud83d\udee1\ufe0f **Data Integrity**\n- ACID compliance\n- Transaction support\n- Automatic error handling\n- Data consistency guarantees\n\n\ud83d\udd27 **Developer Friendly**\n- Simple and intuitive API\n- Minimal configuration required\n- Comprehensive documentation\n- Extensive test coverage\n\n## Installation\n\n```bash\npip install apexbase\n```\n\n## Quick Start\n\n```python\nfrom apexbase import ApexClient\n\n# Initialize the database\nclient = ApexClient(\"my_database\")\n\n# Store single record\nrecord = {\"name\": \"John\", \"age\": 30, \"tags\": [\"python\", \"rust\"]}\nid_ = client.store(record)\n\n# Store multiple records\nrecords = [\n {\"name\": \"Jane\", \"age\": 25},\n {\"name\": \"Bob\", \"age\": 35}\n]\nids = client.store(records)\n\n# Query records\nresults = client.query(\"age > 25\")\nfor record in results:\n print(record)\n\n# Full-text search\nclient.set_searchable(\"name\", True)\nresults = client.search_text(\"John\")\n\n# Import from Pandas\nimport pandas as pd\ndf = pd.DataFrame({\"name\": [\"Alice\", \"Bob\"], \"age\": [28, 32]})\nclient.from_pandas(df)\n```\n\n## Advanced Usage\n\n### Multi-table Operations\n\n```python\n# Create and switch tables\nclient.create_table(\"users\")\nclient.create_table(\"orders\")\nclient.use_table(\"users\")\n\n# Store user data\nuser = {\"name\": \"John\", \"email\": \"john@example.com\"}\nuser_id = client.store(user)\n\n# Switch to orders table\nclient.use_table(\"orders\")\norder = {\"user_id\": user_id, \"product\": \"Laptop\"}\nclient.store(order)\n```\n\n### Complex Queries\n\n```python\n# Multiple conditions\nresults = client.query(\"age > 25 AND city = 'New York'\")\n\n# Range queries\nresults = client.query(\"score >= 85.0 AND score <= 90.0\")\n\n# LIKE queries\nresults = client.query(\"name LIKE 'J%'\")\n```\n\n### Performance Optimization\n\n```python\n# Disable automatic FTS updates for batch operations\nclient.set_auto_update_fts(False)\n\n# Store large batch of records\nrecords = [{\"id\": i, \"value\": i * 2} for i in range(10000)]\nids = client.store(records)\n\n# Manually rebuild search index\nclient.rebuild_search_index()\n```\n\n## Requirements\n\n- Python >= 3.9\n- Dependencies:\n - orjson\n - pandas\n - pyarrow\n - polars\n - numpy\n - psutil\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A lightning-fast, feature-rich embedded database designed for modern Python applications.",
"version": "0.0.2",
"project_urls": {
"Bug Tracker": "https://github.com/BirchKwok/ApexBase/issues",
"Documentation": "https://github.com/BirchKwok/ApexBase#readme",
"Homepage": "https://github.com/BirchKwok/ApexBase",
"Repository": "https://github.com/BirchKwok/ApexBase"
},
"split_keywords": [
"database",
" embedded-database",
" sqlite",
" full-text-search"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "788131fd3fcc0e216f4eedad8c48c608f17806af404a09f439f1d1999e8eaf00",
"md5": "1f6013f1c71ef8da6fc29cf5f75b7cdd",
"sha256": "1bc50399ea6e977a3fbb03d8c529727694cd8e1435d7bf9a66176d6af5141cf1"
},
"downloads": -1,
"filename": "apexbase-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1f6013f1c71ef8da6fc29cf5f75b7cdd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 21301,
"upload_time": "2025-01-25T11:26:00",
"upload_time_iso_8601": "2025-01-25T11:26:00.401514Z",
"url": "https://files.pythonhosted.org/packages/78/81/31fd3fcc0e216f4eedad8c48c608f17806af404a09f439f1d1999e8eaf00/apexbase-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "406ca9515eca8deb2d752956e3697ea11b21c6a8564d338074ca78caec4225b3",
"md5": "5e0869734ef0a7589e895d5ef557a0c3",
"sha256": "0283b5a9c283c3fba3fc37063062b69bb5e35412924e036af3dc4ba3d6fc34d1"
},
"downloads": -1,
"filename": "apexbase-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "5e0869734ef0a7589e895d5ef557a0c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 27199,
"upload_time": "2025-01-25T11:26:02",
"upload_time_iso_8601": "2025-01-25T11:26:02.220166Z",
"url": "https://files.pythonhosted.org/packages/40/6c/a9515eca8deb2d752956e3697ea11b21c6a8564d338074ca78caec4225b3/apexbase-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-25 11:26:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "BirchKwok",
"github_project": "ApexBase",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
">=",
"1.24.0"
]
]
},
{
"name": "pandas",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "pyarrow",
"specs": [
[
">=",
"14.0.1"
]
]
},
{
"name": "polars",
"specs": [
[
">=",
"0.20.0"
]
]
},
{
"name": "psutil",
"specs": [
[
">=",
"5.9.0"
]
]
}
],
"lcname": "apexbase"
}