Skip to main content

cjm-capability-primitives

Install

pip install cjm_capability_primitives

Project Structure

nbs/
├── forced_alignment.ipynb  # Standardized word-level forced-alignment DTOs — the data noun forced-alignment tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.
├── source_separation.ipynb # Standardized result DTO for the source-separation (audio-preprocessing) task — the data noun source-separation tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.
├── transcription.ipynb     # Standardized result DTO for the transcription task — the data noun tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.
└── vad.ipynb               # Standardized result DTO for the voice-activity-detection task — the data noun VAD tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Total: 4 notebooks

Module Dependencies

graph LR
    forced_alignment["forced_alignment<br/>Forced Alignment Result"]
    source_separation["source_separation<br/>Source Separation Result"]
    transcription["transcription<br/>Transcription Result"]
    vad["vad<br/>VAD Result"]

No cross-module dependencies detected.

CLI Reference

No CLI commands found in this project.

Module Overview

Detailed documentation for each module in the project:

Forced Alignment Result (forced_alignment.ipynb)

Standardized word-level forced-alignment DTOs — the data noun forced-alignment tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Import

from cjm_capability_primitives.forced_alignment import (
    ForcedAlignItem,
    ForcedAlignResult
)

Classes

@dataclass
class ForcedAlignItem:
    "A single word-level alignment result."
    
    text: str  # The aligned word (punctuation typically stripped by model)
    start_time: float  # Start time in seconds
    end_time: float  # End time in seconds
@dataclass
class ForcedAlignResult:
    "Standardized output for all forced alignment capabilities."
    
    items: List[ForcedAlignItem]  # Word-level alignments
    metadata: Dict[str, Any] = field(...)  # Capability-specific metadata
    
    def from_dict(
        "Reconstruct from a wire payload, re-typing nested items.

`items` holds typed `ForcedAlignItem` objects, so the substrate's typed
wire envelope (stage 2) reconstructs them host-side here rather than
leaving bare dicts (which would break attribute access like `it.text`)."

Source Separation Result (source_separation.ipynb)

Standardized result DTO for the source-separation (audio-preprocessing) task — the data noun source-separation tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Import

from cjm_capability_primitives.source_separation import (
    SourceSeparationResult
)

Classes

@dataclass
class SourceSeparationResult:
    """
    Standardized output for source-separation (audio-preprocessing) capabilities.
    
    The payload is an AUDIO ARTIFACT, not inline data: `output_path` is the
    produced isolated-audio file (e.g. the vocals stem) the tool wrote to the
    location the adapter chose. `metadata` carries the stats the fused-era
    return dict held (duration, sample_rate, model, stems_available, and any
    extra-stem paths when the tool was asked to keep them).
    """
    
    output_path: str  # Path to the produced isolated-audio artifact (e.g. vocals stem)
    metadata: Dict[str, Any] = field(...)  # Stats (duration, sample_rate, model, stems_available, other_stems, ...)

Transcription Result (transcription.ipynb)

Standardized result DTO for the transcription task — the data noun tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Import

from cjm_capability_primitives.transcription import (
    TranscriptionResult
)

Classes

@dataclass
class TranscriptionResult:
    "Standardized output for all transcription plugins."
    
    text: str  # The transcribed text
    confidence: Optional[float]  # Overall confidence (0.0 to 1.0)
    segments: Optional[List[Dict[str, Any]]]  # Timestamped segments
    metadata: Dict[str, Any] = field(...)  # Additional metadata

VAD Result (vad.ipynb)

Standardized result DTO for the voice-activity-detection task — the data noun VAD tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Import

from cjm_capability_primitives.vad import (
    TimeRange,
    VADResult
)

Classes

@dataclass
class TimeRange:
    "A temporal segment within an audio source (the VAD speech/silence span)."
    
    start: float  # Start time in seconds
    end: float  # End time in seconds
    label: str = 'speech'  # Segment type (e.g. 'speech')
    confidence: Optional[float]  # Detection confidence (0.0 to 1.0)
    payload: Dict[str, Any] = field(...)  # Extra data (reserved)
    
    def to_dict(self) -> Dict[str, Any]:  # Serialized representation
        "Convert to dictionary for JSON serialization."
@dataclass
class VADResult:
    "Standardized output for voice-activity-detection capabilities."
    
    ranges: List[TimeRange]  # Detected speech segments, sorted by start
    metadata: Dict[str, Any] = field(...)  # Global VAD stats (duration, sample_rate, total_speech, ...)
    
    def from_dict(
        "Reconstruct from a wire payload, re-typing nested TimeRanges.

`ranges` holds typed `TimeRange` objects, so the substrate's typed wire
envelope (stage 2) reconstructs them host-side here rather than leaving
bare dicts (which would break attribute access like `r.start`)."

Download files

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

Source Distribution

cjm_capability_primitives-0.0.6.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

cjm_capability_primitives-0.0.6-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file cjm_capability_primitives-0.0.6.tar.gz.

File metadata

File hashes

Hashes for cjm_capability_primitives-0.0.6.tar.gz
Algorithm Hash digest
SHA256 cb5cb6343f0a583f4f903f8644c6583e126965efe8dd11b8fea2c3dfd0a66730
MD5 f525263d11a1235f1feeb4d57e35a103
BLAKE2b-256 d7db4daef6b242818e4c83ecbcca9c37d99902047c73cfb5962a596be9632313

See more details on using hashes here.

File details

Details for the file cjm_capability_primitives-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_capability_primitives-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a5185d11dc0144c64d580cce8c50b9d9d58e4cb5d6e6ebc128d06ea0a8bfe76f
MD5 46ce2f65b81cb939590e0ef9fd92d91d
BLAKE2b-256 9b851aaee77471f6146ea17d19486aaf3dba890e84d8baa0ac8d8dd4675723f1

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 Sentry Error logging StatusPage Status page