Core Python package for building ZOBI backend extensions and integrations
Project description
zobi-core
The official core package for building Zobi backend extensions and integrations. This package provides essential building blocks including base classes, API utilities, type definitions, and decorators for both the host application and extensions.
📦 Installation
pip install zobi-core
🏗️ Package Structure
src/zobi_core/
├── common/
├── extensions/
├── mcp/
├── queries/
├── rest_api/
├── tasks/
└── __init__.py
🚀 Quick Start
Basic Extension API
from flask_appbuilder.api import expose, permission_name, protect, safe
from zobi_core.rest_api.api import RestApi
from zobi_core.rest_api.decorators import api
@api(id="dataset_references", name="Dataset References API")
class DatasetReferencesAPI(RestApi):
@expose("/metadata", methods=("POST",))
@protect()
@safe
@permission_name("read")
def metadata(self) -> Response:
# ... endpoint implementation
Background Tasks
from zobi_core.tasks.decorators import task
from zobi_core.tasks.types import TaskScope
@task(name="generate_report", scope=TaskScope.SHARED)
def generate_report(chart_id: int) -> None:
# ... task implementation
MCP Tools
from zobi_core.mcp.decorators import tool
@tool(name="my_tool", description="Custom business logic", tags=["extension"])
def my_extension_tool(param: str) -> dict:
# ... tool implementation
MCP Prompts
from zobi_core.mcp.decorators import prompt
@prompt(name="my_prompt", title="My Prompt", description="Interactive prompt", tags={"extension"})
async def my_prompt_handler(ctx: Context) -> str:
# ... prompt implementation
📄 License
Licensed under the MIT. See LICENSE for details.
🔗 Links
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 zobi_core-1.0.0.tar.gz.
File metadata
- Download URL: zobi_core-1.0.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f04615ece5d486aa373299650f7919b78b570a516128a5a1f6f98ee83bb6dcda
|
|
| MD5 |
43054866b292e1e13b48aabf0df55816
|
|
| BLAKE2b-256 |
995e1a00203f91f4454d3ecd1fe1152fe95686a3a16b00024f4f81454dc9673a
|
File details
Details for the file zobi_core-1.0.0-py3-none-any.whl.
File metadata
- Download URL: zobi_core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c130bc6cc14eeddbf38208e4f2007da3a16545ea16f58cac81b28da0c3d2ff8c
|
|
| MD5 |
656248131a6083664db906da29b45881
|
|
| BLAKE2b-256 |
4a0d487f080372a533574e584f2c4dfcec0baf6ea9bc936bee8993c687b6ad5a
|