Core components for the Sayou Data Platform
Project description
sayou-core
The Fundamental Foundation for Sayou Fabric.
sayou-core provides the shared DNA for all Sayou libraries. It defines the base architecture, standard data protocols, and utility decorators that ensure consistency across the entire ecosystem.
While you might not use sayou-core directly in your application, it acts as the spinal cord connecting Connector, Refinery, Document, and other modules.
💡 Core Philosophy
"Stability through Standardization."
To build a modular and scalable data pipeline, every component must speak the same language and behave predictably. sayou-core enforces this by providing:
- Unified Component Architecture: Every plugin (Fetcher, Parser, Refiner) inherits from
BaseComponent, guaranteeing standardized logging and lifecycle management. - Strict Data Contracts: Defines Pydantic schemas like
SayouPacketandSayouBlockto ensure type safety between modules. - Resilience Patterns: Provides decorators for retries, timing, and safe execution, reducing boilerplate code in downstream libraries.
📦 Installation
sayou-core is automatically installed when you install any Sayou library.
pip install sayou-core
🔑 Key Components
Base Architecture
BaseComponent: The root class for all Sayou objects. It handles logger initialization (self._log) and configuration injection.
Standard Schemas (The Protocol)
SayouTask: Defines a unit of work (e.g., "Download this URL").SayouPacket: The universal container for transporting raw data between pipelines.SayouBlock: The atomic unit of refined content (Text, Markdown, Record) used by Refinery and Chunking.
Decorators (The Safety Net)
@safe_run: Prevents pipeline crashes by catching exceptions and returning a fallback value.@retry: Automatically retries operations (like API calls) with exponential backoff.@measure_time: logs execution duration for performance monitoring.
🤝 Usage Example
If you are building a custom plugin for Sayou Fabric, you will use sayou-core extensively.
from sayou.core.base_component import BaseComponent
from sayou.core.decorators import measure_time, safe_run
from sayou.core.schemas import SayouPacket
class MyCustomPlugin(BaseComponent):
component_name = "MyPlugin"
@measure_time
@safe_run(default_return=None)
def process(self, data) -> SayouPacket:
self._log(f"Processing {data}...")
# Your logic here
return SayouPacket(data="Processed", success=True)
📜 License
Apache 2.0 License © 2025 Sayouzone
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 sayou_core-0.2.1.tar.gz.
File metadata
- Download URL: sayou_core-0.2.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71a1dc444ceceb144d694dd779f14cbb78a1759ec9f5033a0d3e45bf26717714
|
|
| MD5 |
7bc8596839d23e8ceea1e817d1d134bf
|
|
| BLAKE2b-256 |
63b9a6c4306f25b9ab6e5c66d371d813d8188c12a08e8e76bc1b097dbceb7951
|
File details
Details for the file sayou_core-0.2.1-py3-none-any.whl.
File metadata
- Download URL: sayou_core-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82c9a1fe7680b84ef931c3a9ba3415ca85fc6a663224fe7091451d2f34ee278a
|
|
| MD5 |
ba51f05a0db3b622bb4fd60aff3191f8
|
|
| BLAKE2b-256 |
1acd50f49fd32a1c8eb635bf1b75d7b9edf96b1dc9b754fdaa20c1e3cd15a33e
|