Skip to main content

Core components for the Sayou Data Platform

Project description

sayou-core

PyPI version License Docs

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:

  1. Unified Component Architecture: Every plugin (Fetcher, Parser, Refiner) inherits from BaseComponent, guaranteeing standardized logging and lifecycle management.
  2. Strict Data Contracts: Defines Pydantic schemas like SayouPacket and SayouBlock to ensure type safety between modules.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sayou_core-0.1.6.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sayou_core-0.1.6-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file sayou_core-0.1.6.tar.gz.

File metadata

  • Download URL: sayou_core-0.1.6.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sayou_core-0.1.6.tar.gz
Algorithm Hash digest
SHA256 608e76ee123607e5875fa6b46c81c76b3b1c6164a47a9e7f9628882d2141c5a8
MD5 552b89f4570f12a1d5be83d2a43a7e92
BLAKE2b-256 64f89d35ee9b6294797da90b890fa1a9e1e04ef6c057b00201c58dde548ed65b

See more details on using hashes here.

File details

Details for the file sayou_core-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sayou_core-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sayou_core-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 77c01cf590c4b2cd8483a931eeee692c9069b73e9fa3ed86aa90c86122228845
MD5 fca222de441758f2bcb011bdc799747e
BLAKE2b-256 72b6b882627a42c82d1d0a6cc9cb96f998c77f855c3e9fc6b06ac2581d27aa8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page