Skip to main content

cjm-source-provider

Install

pip install cjm_source_provider

Project Structure

nbs/
├── models.ipynb    # Data types for source records, source blocks, and selected source references.
└── protocols.ipynb # Protocol definitions for extensible content source providers.

Total: 2 notebooks

Module Dependencies

graph LR
    models[models<br/>Models]
    protocols[protocols<br/>Protocols]

    protocols --> models

1 cross-module dependencies detected

CLI Reference

No CLI commands found in this project.

Module Overview

Detailed documentation for each module in the project:

Models (models.ipynb)

Data types for source records, source blocks, and selected source references.

Import

from cjm_source_provider.models import (
    SourceRecord,
    SelectedSource,
    SourceBlock
)

Classes

class SourceRecord(TypedDict):
    "Standard record format for source providers."
class SelectedSource(TypedDict):
    "A selected source reference in a queue."
@dataclass
class SourceBlock:
    "A content block fetched from a source provider for processing."
    
    id: str  # Unique identifier (e.g., job_id, file path hash)
    provider_id: str  # Source provider identifier
    text: str  # Raw content text
    media_path: Optional[str]  # Path to source media file
    metadata: Dict[str, Any] = field(...)  # Additional metadata from source
    
    def to_dict(self) -> Dict[str, Any]:  # Dictionary representation
            """Convert to dictionary for JSON serialization."""
            return asdict(self)
        
        @classmethod
        def from_dict(
            cls,
            data: Dict[str, Any]  # Dictionary representation
        ) -> 'SourceBlock':  # Reconstructed SourceBlock
        "Convert to dictionary for JSON serialization."
    
    def from_dict(
            cls,
            data: Dict[str, Any]  # Dictionary representation
        ) -> 'SourceBlock':  # Reconstructed SourceBlock
        "Create from dictionary."

Protocols (protocols.ipynb)

Protocol definitions for extensible content source providers.

Import

from cjm_source_provider.protocols import (
    SourceProvider
)

Classes

@runtime_checkable
class SourceProvider(Protocol):
    "Protocol for content source providers."
    
    def provider_id(self) -> str:  # Unique identifier for this provider instance
            """Unique identifier for this provider instance."""
            ...
        
        @property
        def provider_name(self) -> str:  # Human-readable name for display
        "Unique identifier for this provider instance."
    
    def provider_name(self) -> str:  # Human-readable name for display
            """Human-readable name for display."""
            ...
        
        @property
        def provider_type(self) -> str:  # Provider type category
        "Human-readable name for display."
    
    def provider_type(self) -> str:  # Provider type category
            """Provider type category (e.g., 'transcription_db', 'local_file', 'video_source')."""
            ...
        
        def query_records(
            self,
            limit: int = 100  # Maximum number of records to return
        ) -> List['SourceRecord']:  # List of source records
        "Provider type category (e.g., 'transcription_db', 'local_file', 'video_source')."
    
    def query_records(
            self,
            limit: int = 100  # Maximum number of records to return
        ) -> List['SourceRecord']:  # List of source records
        "Query available records from this provider."
    
    def get_source_block(
            self,
            record_id: str  # Record identifier
        ) -> Optional['SourceBlock']:  # SourceBlock or None if not found
        "Fetch a specific record as a SourceBlock for processing."

Metadata

Release files for cjm-source-provider 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cjm-source-provider 0.0.1
File Size Uploaded Provenance
cjm_source_provider-0.0.1.tar.gz 9.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cjm-source-provider 0.0.1
File Interpreter ABI Platform
cjm_source_provider-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / cjm_source_provider-0.0.1.tar.gz

Download URL cjm_source_provider-0.0.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
77f8e8ad6b82fdd7bcd509cd8b4c6ae2fa38556d49955cae0406ab37c4afc227
BLAKE2b-256 checksum
How to use checksums
ba5fa7d6d202a23fd951b9c6fdc5a82c0265b815ee72ddabb6b0b289dcf48075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / cjm_source_provider-0.0.1-py3-none-any.whl

Download URL cjm_source_provider-0.0.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b32ed2f9bceb830e16feff57d10b05ec53f8ed7ff40144125b7e0501b493e187
BLAKE2b-256 checksum
How to use checksums
445d7d84afae727eaa7a4be4539c632d2311be0846ccda2393bdb5d408d2e8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for cjm-source-provider 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page