Compare commits
4 Commits
ccbbc3685f
...
bfb93a4007
| Author | SHA1 | Date | |
|---|---|---|---|
| bfb93a4007 | |||
| ca1c116bd7 | |||
| 169fd64064 | |||
| 945391ff23 |
47
.gitignore
vendored
Normal file
47
.gitignore
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# Virtual environments
|
||||
.venv/
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Testing & Coverage
|
||||
.coverage
|
||||
.coverage.*
|
||||
htmlcov/
|
||||
.pytest_cache/
|
||||
|
||||
# Song-Paket cache & outputs
|
||||
.cache/
|
||||
testdata/
|
||||
*.wav
|
||||
*.mp3
|
||||
*.flac
|
||||
*.ogg
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
53
README.md
53
README.md
@ -0,0 +1,53 @@
|
||||
# songsplit
|
||||
|
||||
`songsplit` zerlegt Songs (Video oder Audio) in ein **Song-Paket**: getrennte Stems, Text mit Wort-/Silben-Timing, Gesangsnoten, Tempo-Map, Akkorde und Strumming-Vorschlag. Das Paket dient als Schnittstelle für Trainer-Apps und Editoren.
|
||||
|
||||
Verbindliche Spezifikation: siehe [umsetzungskonzept.md](umsetzungskonzept.md).
|
||||
|
||||
## Installation & Setup
|
||||
|
||||
Entwicklungsumgebung mit Python 3.12 und `uv`:
|
||||
|
||||
```bash
|
||||
# Virtuelle Umgebung erstellen und Abhängigkeiten installieren
|
||||
uv venv --python 3.12
|
||||
uv pip install -e ".[dev]"
|
||||
|
||||
# System- und Hardwareprüfung durchführen
|
||||
uv run songsplit doctor
|
||||
```
|
||||
|
||||
## CLI-Verwendung
|
||||
|
||||
```bash
|
||||
# System- und GPU-Check
|
||||
songsplit doctor
|
||||
|
||||
# Gesamte Analyse oder bestimmte Stufen ausführen
|
||||
songsplit analyze <datei> -o <ordner> [--lang de] [--stems 4|6] [--quality fast|best]
|
||||
songsplit analyze <datei> -o <ordner> --stage chords [--force]
|
||||
|
||||
# Export nach UltraStar (ab M2)
|
||||
songsplit export-ultrastar <ordner>
|
||||
|
||||
# Qualitätsmessung (ab M2)
|
||||
songsplit eval <testset.toml>
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
uv run pytest
|
||||
uv run ruff check
|
||||
uv run ruff format --check
|
||||
```
|
||||
|
||||
## Meilensteine
|
||||
|
||||
- [x] **M0 – Gerüst**: Projektstruktur, Pydantic-Schemas (`meta.json`, `tempo.json`, `vocals.json`, `chords.json`, `strumming.json`), `tempo.py` mit `sec_to_beat`/`beat_to_sec`, Pipeline-Runner mit Cache und Hash-Invalidierung, CLI-Skelett mit `doctor`, Testsuite.
|
||||
- [ ] **M1 – Extraktion und Stems**: Stufen 1 (ffmpeg) und 2 (Demucs).
|
||||
- [ ] **M2 – Gesang**: Stufen 3 (Whisper+WhisperX) und 4 (torchcrepe), UltraStar-Writer, Eval-Gerüst.
|
||||
- [ ] **M3 – Tempo-Map**: Stufe 5 (beat_this).
|
||||
- [ ] **M4 – Akkorde**: Stufe 6 (Chordino / Transformer).
|
||||
- [ ] **M5 – Strumming**: Stufe 7 (librosa Onsets / Strumming-Muster).
|
||||
- [ ] **M6 – Härtung**: Fehlerbehandlung, Logging, Dokumentation, Beispielpaket.
|
||||
|
||||
42
pyproject.toml
Normal file
42
pyproject.toml
Normal file
@ -0,0 +1,42 @@
|
||||
[project]
|
||||
name = "songsplit"
|
||||
version = "0.1.0"
|
||||
description = "Song-Paket Audioanalyse-Pipeline (Stems, Lyrics, Vocals, Tempo, Chords, Strumming)"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11,<3.13"
|
||||
dependencies = [
|
||||
"pydantic>=2.7.0",
|
||||
"typer>=0.12.0",
|
||||
"rich>=13.7.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=8.0.0",
|
||||
"pytest-cov>=5.0.0",
|
||||
"ruff>=0.4.0",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
songsplit = "songsplit.cli:app"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/songsplit"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
pythonpath = ["src"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = "py312"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "UP", "B"]
|
||||
ignore = ["B008", "E501"]
|
||||
|
||||
|
||||
3
src/songsplit/__init__.py
Normal file
3
src/songsplit/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
"""songsplit: Audio analysis pipeline for song package decomposition."""
|
||||
|
||||
__version__ = "0.1.0"
|
||||
170
src/songsplit/cli.py
Normal file
170
src/songsplit/cli.py
Normal file
@ -0,0 +1,170 @@
|
||||
"""CLI interface for songsplit."""
|
||||
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import typer
|
||||
from rich.console import Console
|
||||
from rich.table import Table
|
||||
|
||||
from songsplit import __version__
|
||||
from songsplit.config import config
|
||||
from songsplit.pipeline import PipelineContext, get_default_pipeline
|
||||
|
||||
app = typer.Typer(
|
||||
name="songsplit",
|
||||
help="Audio analysis pipeline decomposing songs into song packages.",
|
||||
add_completion=False,
|
||||
)
|
||||
console = Console(stderr=True)
|
||||
|
||||
|
||||
@app.command()
|
||||
def analyze(
|
||||
file: Path = typer.Argument(..., help="Path to input audio or video file", exists=True, readable=True),
|
||||
output_dir: Path = typer.Option(..., "-o", "--output", help="Output song package directory"),
|
||||
lang: str = typer.Option("de", "--lang", help="Lyrics language (e.g. 'de', 'en')"),
|
||||
stems: int = typer.Option(4, "--stems", help="Number of stems to separate (4 or 6)"),
|
||||
quality: str = typer.Option("best", "--quality", help="Separation quality ('fast' or 'best')"),
|
||||
stage: str | None = typer.Option(None, "--stage", help="Run only a specific stage and its missing dependencies"),
|
||||
force: bool = typer.Option(False, "--force", help="Force recalculation ignoring cached results"),
|
||||
json_output: bool = typer.Option(False, "--json", help="Output machine-readable JSON result path"),
|
||||
) -> None:
|
||||
"""Analyze an audio or video file and produce a Song-Paket."""
|
||||
ctx = PipelineContext(
|
||||
source_file=file,
|
||||
output_dir=output_dir,
|
||||
lang=lang,
|
||||
stems=stems,
|
||||
quality=quality,
|
||||
force=force,
|
||||
target_stage=stage,
|
||||
)
|
||||
runner = get_default_pipeline()
|
||||
meta = runner.run(ctx)
|
||||
|
||||
if json_output:
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"output_dir": str(output_dir.resolve()),
|
||||
"stages_done": meta.stages_done,
|
||||
"stages_failed": meta.stages_failed,
|
||||
}
|
||||
)
|
||||
)
|
||||
else:
|
||||
print(str(output_dir.resolve()))
|
||||
|
||||
|
||||
@app.command(name="export-ultrastar")
|
||||
def export_ultrastar_cmd(
|
||||
song_dir: Path = typer.Argument(..., help="Song-Paket directory to export", exists=True),
|
||||
) -> None:
|
||||
"""Export an existing Song-Paket directory to UltraStar song.txt."""
|
||||
from songsplit.export.ultrastar import export_ultrastar
|
||||
|
||||
res = export_ultrastar(song_dir)
|
||||
print(str(res))
|
||||
|
||||
|
||||
@app.command(name="eval")
|
||||
def eval_cmd(
|
||||
testset_config: Path = typer.Argument(..., help="Path to testset.toml", exists=True),
|
||||
) -> None:
|
||||
"""Run quality benchmarks against UltraStar ground-truth references."""
|
||||
from songsplit.eval.run_eval import run_evaluation
|
||||
|
||||
run_evaluation(testset_config)
|
||||
|
||||
|
||||
@app.command()
|
||||
def doctor() -> None:
|
||||
"""Check environment, ffmpeg installation, GPUs, and PyTorch availability."""
|
||||
table = Table(title=f"songsplit v{__version__} Doctor System Check")
|
||||
table.add_column("Component", style="cyan", no_wrap=True)
|
||||
table.add_column("Status", style="bold")
|
||||
table.add_column("Details", style="white")
|
||||
|
||||
# 1. Python version
|
||||
py_ver = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
|
||||
if sys.version_info.major == 3 and 11 <= sys.version_info.minor <= 12:
|
||||
table.add_row("Python", "[green]OK[/green]", f"{py_ver} ({sys.executable})")
|
||||
else:
|
||||
table.add_row("Python", "[yellow]WARN[/yellow]", f"{py_ver} (Empfohlen: Python 3.11 / 3.12)")
|
||||
|
||||
# 2. ffmpeg
|
||||
ffmpeg_path = shutil.which("ffmpeg")
|
||||
if ffmpeg_path:
|
||||
try:
|
||||
res = subprocess.run([ffmpeg_path, "-version"], capture_output=True, text=True, check=True)
|
||||
first_line = res.stdout.splitlines()[0] if res.stdout else "Available"
|
||||
table.add_row("ffmpeg", "[green]OK[/green]", f"{ffmpeg_path} ({first_line})")
|
||||
except Exception as e:
|
||||
table.add_row("ffmpeg", "[yellow]WARN[/yellow]", f"Found at {ffmpeg_path} but error running: {e}")
|
||||
else:
|
||||
table.add_row("ffmpeg", "[red]FAIL[/red]", "ffmpeg not found in PATH")
|
||||
|
||||
# 3. PyTorch
|
||||
try:
|
||||
import torch # type: ignore
|
||||
|
||||
backend_info = []
|
||||
if getattr(torch.version, "cuda", None):
|
||||
backend_info.append(f"CUDA {torch.version.cuda}")
|
||||
if getattr(torch.version, "hip", None):
|
||||
backend_info.append(f"ROCm/HIP {torch.version.hip}")
|
||||
backend_str = ", ".join(backend_info) if backend_info else "CPU-only"
|
||||
|
||||
table.add_row("PyTorch", "[green]OK[/green]", f"v{torch.__version__} ({backend_str})")
|
||||
|
||||
# Check PyTorch visible GPUs
|
||||
if torch.cuda.is_available():
|
||||
count = torch.cuda.device_count()
|
||||
devices_desc = []
|
||||
for i in range(count):
|
||||
devices_desc.append(f"[{i}] {torch.cuda.get_device_name(i)}")
|
||||
table.add_row("Torch GPUs", "[green]OK[/green]", f"{count} device(s): " + "; ".join(devices_desc))
|
||||
else:
|
||||
table.add_row("Torch GPUs", "[yellow]INFO[/yellow]", "No CUDA/ROCm device active in PyTorch")
|
||||
except ImportError:
|
||||
table.add_row("PyTorch", "[yellow]NOT INSTALLED[/yellow]", "PyTorch is not yet installed in virtualenv")
|
||||
|
||||
# 4. System GPUs / Hardware Devices
|
||||
# AMD ROCm / KFD
|
||||
kfd_path = Path("/dev/kfd")
|
||||
if kfd_path.exists():
|
||||
table.add_row(
|
||||
"AMD ROCm (/dev/kfd)", "[green]DETECTED[/green]", f"{kfd_path} present (AMD GPU kernel driver active)"
|
||||
)
|
||||
else:
|
||||
table.add_row("AMD ROCm (/dev/kfd)", "[dim]NONE[/dim]", "No /dev/kfd device found")
|
||||
|
||||
# NVIDIA device nodes
|
||||
nvidia_nodes = list(Path("/dev").glob("nvidia*"))
|
||||
if nvidia_nodes:
|
||||
table.add_row("NVIDIA Devices", "[green]DETECTED[/green]", f"Found: {', '.join(p.name for p in nvidia_nodes)}")
|
||||
else:
|
||||
table.add_row("NVIDIA Devices", "[dim]NONE[/dim]", "No /dev/nvidia* device nodes found")
|
||||
|
||||
# CLI tools
|
||||
rocm_smi = shutil.which("rocm-smi")
|
||||
table.add_row("rocm-smi", "[green]OK[/green]" if rocm_smi else "[dim]NONE[/dim]", rocm_smi or "Not found in PATH")
|
||||
|
||||
nvidia_smi = shutil.which("nvidia-smi")
|
||||
table.add_row(
|
||||
"nvidia-smi", "[green]OK[/green]" if nvidia_smi else "[dim]NONE[/dim]", nvidia_smi or "Not found in PATH"
|
||||
)
|
||||
|
||||
# 5. Model Cache Directory
|
||||
model_dir = config.models_cache_dir
|
||||
table.add_row("Model Cache", "[green]OK[/green]", str(model_dir))
|
||||
|
||||
console.print(table)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
||||
43
src/songsplit/config.py
Normal file
43
src/songsplit/config.py
Normal file
@ -0,0 +1,43 @@
|
||||
"""Configuration management for songsplit (devices, models, paths)."""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class Config(BaseModel):
|
||||
"""Runtime configuration for pipeline stages, devices, and directories."""
|
||||
|
||||
models_cache_dir: Path = Field(
|
||||
default_factory=lambda: Path(
|
||||
os.getenv("SONGSPLIT_MODELS_DIR", Path.home() / ".cache" / "songsplit" / "models")
|
||||
).expanduser()
|
||||
)
|
||||
|
||||
default_device: str = Field(default_factory=lambda: os.getenv("SONGSPLIT_DEFAULT_DEVICE", "cuda:0"))
|
||||
|
||||
stage_devices: dict[str, str] = Field(
|
||||
default_factory=lambda: {
|
||||
"s1_extract": os.getenv("SONGSPLIT_DEVICE_S1", "cpu"),
|
||||
"s2_stems": os.getenv("SONGSPLIT_DEVICE_S2", "cuda:0"),
|
||||
"s3_lyrics": os.getenv("SONGSPLIT_DEVICE_S3", "cuda:0"),
|
||||
"s4_pitch": os.getenv("SONGSPLIT_DEVICE_S4", "cuda:0"),
|
||||
"s5_tempo": os.getenv("SONGSPLIT_DEVICE_S5", "cpu"),
|
||||
"s6_chords": os.getenv("SONGSPLIT_DEVICE_S6", "cpu"),
|
||||
"s7_strumming": os.getenv("SONGSPLIT_DEVICE_S7", "cpu"),
|
||||
}
|
||||
)
|
||||
|
||||
def get_device(self, stage: str) -> str:
|
||||
"""Get target compute device for a specific stage."""
|
||||
return self.stage_devices.get(stage, self.default_device)
|
||||
|
||||
def get_models_dir(self) -> Path:
|
||||
"""Ensure and return the model cache directory."""
|
||||
self.models_cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
return self.models_cache_dir
|
||||
|
||||
|
||||
# Global singleton instance
|
||||
config = Config()
|
||||
6
src/songsplit/eval/__init__.py
Normal file
6
src/songsplit/eval/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
"""Evaluation package."""
|
||||
|
||||
from songsplit.eval.metrics import calculate_timing_metrics
|
||||
from songsplit.eval.run_eval import run_evaluation
|
||||
|
||||
__all__ = ["calculate_timing_metrics", "run_evaluation"]
|
||||
8
src/songsplit/eval/metrics.py
Normal file
8
src/songsplit/eval/metrics.py
Normal file
@ -0,0 +1,8 @@
|
||||
"""Quality metrics against UltraStar reference (timing, pitch, WER)."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def calculate_timing_metrics(predicted: list[dict[str, Any]], reference: list[dict[str, Any]]) -> dict[str, float]:
|
||||
"""Calculate mean/median syllable onset error in ms and fraction within +-100ms."""
|
||||
raise NotImplementedError("Metrics will be implemented in M2.")
|
||||
8
src/songsplit/eval/run_eval.py
Normal file
8
src/songsplit/eval/run_eval.py
Normal file
@ -0,0 +1,8 @@
|
||||
"""Evaluation runner for testset.toml."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def run_evaluation(testset_config: Path) -> dict[str, str]:
|
||||
"""Run full evaluation suite across test songs."""
|
||||
raise NotImplementedError("Evaluation runner will be implemented in M2.")
|
||||
5
src/songsplit/export/__init__.py
Normal file
5
src/songsplit/export/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
"""Export modules."""
|
||||
|
||||
from songsplit.export.ultrastar import export_ultrastar
|
||||
|
||||
__all__ = ["export_ultrastar"]
|
||||
8
src/songsplit/export/ultrastar.py
Normal file
8
src/songsplit/export/ultrastar.py
Normal file
@ -0,0 +1,8 @@
|
||||
"""UltraStar format export and import."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def export_ultrastar(song_dir: Path) -> Path:
|
||||
"""Export song package to UltraStar song.txt."""
|
||||
raise NotImplementedError("UltraStar export will be implemented in M2.")
|
||||
40
src/songsplit/pipeline/__init__.py
Normal file
40
src/songsplit/pipeline/__init__.py
Normal file
@ -0,0 +1,40 @@
|
||||
"""Pipeline stages and runner."""
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, PipelineRunner, Stage
|
||||
from songsplit.pipeline.s1_extract import ExtractStage
|
||||
from songsplit.pipeline.s2_stems import StemsStage
|
||||
from songsplit.pipeline.s3_lyrics import LyricsStage
|
||||
from songsplit.pipeline.s4_pitch import PitchStage
|
||||
from songsplit.pipeline.s5_tempo import TempoStage
|
||||
from songsplit.pipeline.s6_chords import ChordsStage
|
||||
from songsplit.pipeline.s7_strumming import StrummingStage
|
||||
|
||||
|
||||
def get_default_pipeline() -> PipelineRunner:
|
||||
"""Instantiate the default 7-stage songsplit pipeline."""
|
||||
return PipelineRunner(
|
||||
[
|
||||
ExtractStage(),
|
||||
StemsStage(),
|
||||
LyricsStage(),
|
||||
PitchStage(),
|
||||
TempoStage(),
|
||||
ChordsStage(),
|
||||
StrummingStage(),
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"PipelineContext",
|
||||
"PipelineRunner",
|
||||
"Stage",
|
||||
"ExtractStage",
|
||||
"StemsStage",
|
||||
"LyricsStage",
|
||||
"PitchStage",
|
||||
"TempoStage",
|
||||
"ChordsStage",
|
||||
"StrummingStage",
|
||||
"get_default_pipeline",
|
||||
]
|
||||
267
src/songsplit/pipeline/runner.py
Normal file
267
src/songsplit/pipeline/runner.py
Normal file
@ -0,0 +1,267 @@
|
||||
"""Pipeline runner, caching, stage dependency management, and hash invalidation."""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import sys
|
||||
from abc import ABC, abstractmethod
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.schema.meta import MetaDocument, ModelInfo, SourceFileInfo
|
||||
|
||||
|
||||
def compute_file_sha256(file_path: Path, chunk_size: int = 65536) -> str:
|
||||
"""Compute sha256 hash of a file."""
|
||||
hasher = hashlib.sha256()
|
||||
with open(file_path, "rb") as f:
|
||||
while chunk := f.read(chunk_size):
|
||||
hasher.update(chunk)
|
||||
return hasher.hexdigest()
|
||||
|
||||
|
||||
class PipelineContext:
|
||||
"""Context holding paths and options for the song package analysis run."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
source_file: Path,
|
||||
output_dir: Path,
|
||||
lang: str | None = "de",
|
||||
stems: int = 4,
|
||||
quality: str = "best",
|
||||
force: bool = False,
|
||||
target_stage: str | None = None,
|
||||
):
|
||||
self.source_file = source_file.resolve()
|
||||
self.output_dir = output_dir.resolve()
|
||||
self.lang = lang
|
||||
self.stems = stems
|
||||
self.quality = quality
|
||||
self.force = force
|
||||
self.target_stage = target_stage
|
||||
|
||||
self.cache_dir = self.output_dir / ".cache"
|
||||
self.stems_dir = self.output_dir / "stems"
|
||||
self.meta_file = self.output_dir / "meta.json"
|
||||
|
||||
def ensure_directories(self) -> None:
|
||||
"""Create necessary output directories."""
|
||||
self.output_dir.mkdir(parents=True, exist_ok=True)
|
||||
self.cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
self.stems_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def load_or_init_meta(self) -> MetaDocument:
|
||||
"""Load existing meta.json or create initial document."""
|
||||
if self.meta_file.exists():
|
||||
with open(self.meta_file, encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
return MetaDocument.model_validate(data)
|
||||
|
||||
source_hash = compute_file_sha256(self.source_file) if self.source_file.exists() else ""
|
||||
size_bytes = self.source_file.stat().st_size if self.source_file.exists() else 0
|
||||
|
||||
return MetaDocument(
|
||||
duration_sec=0.0,
|
||||
source_file=SourceFileInfo(
|
||||
path=str(self.source_file),
|
||||
sha256=source_hash,
|
||||
size_bytes=size_bytes,
|
||||
),
|
||||
created_at=datetime.now(UTC).isoformat(),
|
||||
)
|
||||
|
||||
def save_meta(self, meta: MetaDocument) -> None:
|
||||
"""Save meta document to meta.json."""
|
||||
with open(self.meta_file, "w", encoding="utf-8") as f:
|
||||
f.write(meta.model_dump_json(indent=2))
|
||||
|
||||
|
||||
class Stage(ABC):
|
||||
"""Abstract base class for pipeline stages."""
|
||||
|
||||
name: str
|
||||
version: str = "1.0.0"
|
||||
model_name: str
|
||||
model_version: str = "1.0.0"
|
||||
dependencies: list[str] = []
|
||||
|
||||
@abstractmethod
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
"""List of input files required by this stage."""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
"""List of output files produced by this stage."""
|
||||
...
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
"""Parameters affecting output calculation."""
|
||||
return {}
|
||||
|
||||
def compute_cache_hash(self, ctx: PipelineContext) -> str:
|
||||
"""Compute deterministic hash of inputs, params, version and model."""
|
||||
hasher = hashlib.sha256()
|
||||
hasher.update(self.name.encode("utf-8"))
|
||||
hasher.update(self.version.encode("utf-8"))
|
||||
hasher.update(self.model_name.encode("utf-8"))
|
||||
hasher.update(self.model_version.encode("utf-8"))
|
||||
|
||||
# Params serialized canonically
|
||||
params_str = json.dumps(self.get_params(ctx), sort_keys=True)
|
||||
hasher.update(params_str.encode("utf-8"))
|
||||
|
||||
for input_path in self.get_inputs(ctx):
|
||||
if input_path.exists():
|
||||
hasher.update(input_path.name.encode("utf-8"))
|
||||
hasher.update(compute_file_sha256(input_path).encode("utf-8"))
|
||||
else:
|
||||
hasher.update(f"missing:{input_path.name}".encode())
|
||||
|
||||
return hasher.hexdigest()
|
||||
|
||||
def is_cached(self, ctx: PipelineContext) -> bool:
|
||||
"""Check if stage output is already computed and valid in cache."""
|
||||
cache_file = ctx.cache_dir / f"{self.name}.json"
|
||||
if not cache_file.exists():
|
||||
return False
|
||||
|
||||
# All outputs must exist
|
||||
outputs = self.get_outputs(ctx)
|
||||
if not outputs or not all(p.exists() for p in outputs):
|
||||
return False
|
||||
|
||||
try:
|
||||
with open(cache_file, encoding="utf-8") as f:
|
||||
cached_data = json.load(f)
|
||||
current_hash = self.compute_cache_hash(ctx)
|
||||
return cached_data.get("cache_hash") == current_hash
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def write_cache_entry(self, ctx: PipelineContext, cache_hash: str) -> None:
|
||||
"""Record successful stage run in cache."""
|
||||
cache_file = ctx.cache_dir / f"{self.name}.json"
|
||||
data = {
|
||||
"stage": self.name,
|
||||
"version": self.version,
|
||||
"model": self.model_name,
|
||||
"model_version": self.model_version,
|
||||
"cache_hash": cache_hash,
|
||||
"timestamp": datetime.now(UTC).isoformat(),
|
||||
"outputs": [str(p) for p in self.get_outputs(ctx)],
|
||||
}
|
||||
with open(cache_file, "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, indent=2)
|
||||
|
||||
@abstractmethod
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
"""Execute stage processing."""
|
||||
...
|
||||
|
||||
|
||||
class PipelineRunner:
|
||||
"""Manages stage execution, order resolution, caching and error recovery."""
|
||||
|
||||
def __init__(self, stages: list[Stage]):
|
||||
self.stages_by_name = {s.name: s for s in stages}
|
||||
self._validate_stages()
|
||||
|
||||
def _validate_stages(self) -> None:
|
||||
"""Ensure all declared dependencies exist in runner."""
|
||||
for s in self.stages_by_name.values():
|
||||
for dep in s.dependencies:
|
||||
if dep not in self.stages_by_name:
|
||||
raise ValueError(f"Stage '{s.name}' depends on unknown stage '{dep}'")
|
||||
|
||||
def get_stages_to_run(self, ctx: PipelineContext) -> list[Stage]:
|
||||
"""Resolve ordered list of stages to run."""
|
||||
if ctx.target_stage:
|
||||
if ctx.target_stage not in self.stages_by_name:
|
||||
raise ValueError(f"Unknown target stage: '{ctx.target_stage}'")
|
||||
# Collect target stage and all its transitive dependencies
|
||||
needed = set()
|
||||
|
||||
def add_deps(name: str):
|
||||
needed.add(name)
|
||||
for dep in self.stages_by_name[name].dependencies:
|
||||
if dep not in needed:
|
||||
add_deps(dep)
|
||||
|
||||
add_deps(ctx.target_stage)
|
||||
selected = [s for s in self.stages_by_name.values() if s.name in needed]
|
||||
else:
|
||||
selected = list(self.stages_by_name.values())
|
||||
|
||||
# Topological sort
|
||||
ordered: list[Stage] = []
|
||||
visited: set[str] = set()
|
||||
|
||||
def visit(stage: Stage):
|
||||
if stage.name in visited:
|
||||
return
|
||||
for dep in stage.dependencies:
|
||||
if dep in self.stages_by_name and self.stages_by_name[dep] in selected:
|
||||
visit(self.stages_by_name[dep])
|
||||
visited.add(stage.name)
|
||||
ordered.append(stage)
|
||||
|
||||
for s in selected:
|
||||
visit(s)
|
||||
|
||||
return ordered
|
||||
|
||||
def run(self, ctx: PipelineContext) -> MetaDocument:
|
||||
"""Execute the pipeline according to context configuration."""
|
||||
ctx.ensure_directories()
|
||||
meta = ctx.load_or_init_meta()
|
||||
|
||||
stages_to_run = self.get_stages_to_run(ctx)
|
||||
failed_stages: set[str] = set(meta.stages_failed.keys())
|
||||
|
||||
for stage in stages_to_run:
|
||||
# Check if any dependencies failed
|
||||
failed_deps = [d for d in stage.dependencies if d in failed_stages]
|
||||
if failed_deps:
|
||||
msg = f"Skipping {stage.name} because dependencies failed: {failed_deps}"
|
||||
sys.stderr.write(f"[WARN] {msg}\n")
|
||||
meta.stages_failed[stage.name] = msg
|
||||
failed_stages.add(stage.name)
|
||||
continue
|
||||
|
||||
# Check cache
|
||||
if not ctx.force and stage.is_cached(ctx):
|
||||
sys.stderr.write(f"[INFO] Stage {stage.name} is up to date (cached).\n")
|
||||
if stage.name not in meta.stages_done:
|
||||
meta.stages_done.append(stage.name)
|
||||
continue
|
||||
|
||||
sys.stderr.write(f"[INFO] Running stage: {stage.name}...\n")
|
||||
try:
|
||||
cache_hash = stage.compute_cache_hash(ctx)
|
||||
stage.run(ctx)
|
||||
stage.write_cache_entry(ctx, cache_hash)
|
||||
|
||||
if stage.name not in meta.stages_done:
|
||||
meta.stages_done.append(stage.name)
|
||||
# Remove from failed if it was previously marked failed
|
||||
meta.stages_failed.pop(stage.name, None)
|
||||
|
||||
# Update model info
|
||||
model_entry = ModelInfo(
|
||||
stage=stage.name,
|
||||
name=stage.model_name,
|
||||
version=stage.model_version,
|
||||
)
|
||||
if not any(m.stage == stage.name for m in meta.models_used):
|
||||
meta.models_used.append(model_entry)
|
||||
|
||||
except Exception as e:
|
||||
err_msg = f"{type(e).__name__}: {str(e)}"
|
||||
sys.stderr.write(f"[ERROR] Stage {stage.name} failed: {err_msg}\n")
|
||||
meta.stages_failed[stage.name] = err_msg
|
||||
failed_stages.add(stage.name)
|
||||
|
||||
ctx.save_meta(meta)
|
||||
return meta
|
||||
27
src/songsplit/pipeline/s1_extract.py
Normal file
27
src/songsplit/pipeline/s1_extract.py
Normal file
@ -0,0 +1,27 @@
|
||||
"""Stage 1: Extract audio to 44.1 kHz stereo WAV using ffmpeg."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class ExtractStage(Stage):
|
||||
name = "s1_extract"
|
||||
version = "1.0.0"
|
||||
model_name = "ffmpeg"
|
||||
model_version = "6.0"
|
||||
dependencies: list[str] = []
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.source_file]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "extracted.wav"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"sample_rate": 44100, "channels": 2}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M1
|
||||
raise NotImplementedError("Stage s1_extract will be implemented in M1.")
|
||||
30
src/songsplit/pipeline/s2_stems.py
Normal file
30
src/songsplit/pipeline/s2_stems.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""Stage 2: Stem separation using Demucs."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class StemsStage(Stage):
|
||||
name = "s2_stems"
|
||||
version = "1.0.0"
|
||||
model_name = "htdemucs_ft"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s1_extract"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "extracted.wav"]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [
|
||||
ctx.stems_dir / "vocals.wav",
|
||||
ctx.stems_dir / "instrumental.wav",
|
||||
]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"stems": ctx.stems, "quality": ctx.quality}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M1
|
||||
raise NotImplementedError("Stage s2_stems will be implemented in M1.")
|
||||
27
src/songsplit/pipeline/s3_lyrics.py
Normal file
27
src/songsplit/pipeline/s3_lyrics.py
Normal file
@ -0,0 +1,27 @@
|
||||
"""Stage 3: Lyrics transcription & alignment (Whisper + WhisperX + hyphenation)."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class LyricsStage(Stage):
|
||||
name = "s3_lyrics"
|
||||
version = "1.0.0"
|
||||
model_name = "whisper-large-v3"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s2_stems"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.stems_dir / "vocals.wav"]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / ".cache" / "lyrics_raw.json"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"lang": ctx.lang}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M2
|
||||
raise NotImplementedError("Stage s3_lyrics will be implemented in M2.")
|
||||
30
src/songsplit/pipeline/s4_pitch.py
Normal file
30
src/songsplit/pipeline/s4_pitch.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""Stage 4: Pitch tracking with CREPE -> median MIDI pitch per syllable."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class PitchStage(Stage):
|
||||
name = "s4_pitch"
|
||||
version = "1.0.0"
|
||||
model_name = "torchcrepe-full"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s3_lyrics"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [
|
||||
ctx.stems_dir / "vocals.wav",
|
||||
ctx.output_dir / ".cache" / "lyrics_raw.json",
|
||||
]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "vocals.json"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"hop_length_ms": 10, "viterbi": True}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M2
|
||||
raise NotImplementedError("Stage s4_pitch will be implemented in M2.")
|
||||
27
src/songsplit/pipeline/s5_tempo.py
Normal file
27
src/songsplit/pipeline/s5_tempo.py
Normal file
@ -0,0 +1,27 @@
|
||||
"""Stage 5: Beat and downbeat tracking with beat_this -> tempo.json."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class TempoStage(Stage):
|
||||
name = "s5_tempo"
|
||||
version = "1.0.0"
|
||||
model_name = "beat_this"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s2_stems"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.stems_dir / "instrumental.wav"]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "tempo.json"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M3
|
||||
raise NotImplementedError("Stage s5_tempo will be implemented in M3.")
|
||||
30
src/songsplit/pipeline/s6_chords.py
Normal file
30
src/songsplit/pipeline/s6_chords.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""Stage 6: Chord recognition -> chords.json."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class ChordsStage(Stage):
|
||||
name = "s6_chords"
|
||||
version = "1.0.0"
|
||||
model_name = "chordino"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s5_tempo"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [
|
||||
ctx.stems_dir / "instrumental.wav",
|
||||
ctx.output_dir / "tempo.json",
|
||||
]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "chords.json"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"backend": "chordino"}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M4
|
||||
raise NotImplementedError("Stage s6_chords will be implemented in M4.")
|
||||
30
src/songsplit/pipeline/s7_strumming.py
Normal file
30
src/songsplit/pipeline/s7_strumming.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""Stage 7: Strumming pattern analysis -> strumming.json."""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, Stage
|
||||
|
||||
|
||||
class StrummingStage(Stage):
|
||||
name = "s7_strumming"
|
||||
version = "1.0.0"
|
||||
model_name = "librosa-onsets"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["s5_tempo"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [
|
||||
ctx.stems_dir / "instrumental.wav",
|
||||
ctx.output_dir / "tempo.json",
|
||||
]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "strumming.json"]
|
||||
|
||||
def get_params(self, ctx: PipelineContext) -> dict[str, Any]:
|
||||
return {"grid": "8th"}
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
# Implementation in M5
|
||||
raise NotImplementedError("Stage s7_strumming will be implemented in M5.")
|
||||
29
src/songsplit/schema/__init__.py
Normal file
29
src/songsplit/schema/__init__.py
Normal file
@ -0,0 +1,29 @@
|
||||
"""Song-Paket data schemas."""
|
||||
|
||||
from songsplit.schema.base import DataSource, GeneratedBy, SongPackageBase
|
||||
from songsplit.schema.chords import ChordEvent, ChordsDocument
|
||||
from songsplit.schema.meta import MetaDocument, ModelInfo, SourceFileInfo
|
||||
from songsplit.schema.strumming import StrumDirection, StrumEvent, StrummingDocument, StrumPattern
|
||||
from songsplit.schema.tempo import TempoAnchor, TempoDocument, TimeSignature
|
||||
from songsplit.schema.vocals import VocalLine, VocalsDocument, VocalSyllable
|
||||
|
||||
__all__ = [
|
||||
"DataSource",
|
||||
"GeneratedBy",
|
||||
"SongPackageBase",
|
||||
"SourceFileInfo",
|
||||
"ModelInfo",
|
||||
"MetaDocument",
|
||||
"VocalSyllable",
|
||||
"VocalLine",
|
||||
"VocalsDocument",
|
||||
"TempoAnchor",
|
||||
"TimeSignature",
|
||||
"TempoDocument",
|
||||
"ChordEvent",
|
||||
"ChordsDocument",
|
||||
"StrumDirection",
|
||||
"StrumEvent",
|
||||
"StrumPattern",
|
||||
"StrummingDocument",
|
||||
]
|
||||
27
src/songsplit/schema/base.py
Normal file
27
src/songsplit/schema/base.py
Normal file
@ -0,0 +1,27 @@
|
||||
"""Base classes and shared types for Song-Paket schemas."""
|
||||
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
DataSource = Literal["auto", "manual", "import"]
|
||||
|
||||
|
||||
class GeneratedBy(BaseModel):
|
||||
"""Information about the stage, model and parameters used to generate the data."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
stage: str
|
||||
model: str
|
||||
model_version: str = "1.0"
|
||||
params: dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class SongPackageBase(BaseModel):
|
||||
"""Base schema for all Song-Paket JSON files with schema version and generation info."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
schema_version: str = "1.0"
|
||||
generated_by: GeneratedBy | None = None
|
||||
28
src/songsplit/schema/chords.py
Normal file
28
src/songsplit/schema/chords.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""Schema for chords.json."""
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from songsplit.schema.base import DataSource, SongPackageBase
|
||||
|
||||
|
||||
class ChordEvent(BaseModel):
|
||||
"""A chord segment defined in beats."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
start_beat: float
|
||||
end_beat: float
|
||||
label: str
|
||||
root: str | None = None
|
||||
quality: str | None = None
|
||||
bass: str | None = None
|
||||
confidence: float = Field(default=1.0, ge=0.0, le=1.0)
|
||||
source: DataSource = "auto"
|
||||
|
||||
|
||||
class ChordsDocument(SongPackageBase):
|
||||
"""Song-Paket chords document (chords.json)."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
chords: list[ChordEvent] = Field(default_factory=list)
|
||||
43
src/songsplit/schema/meta.py
Normal file
43
src/songsplit/schema/meta.py
Normal file
@ -0,0 +1,43 @@
|
||||
"""Schema for meta.json."""
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from songsplit.schema.base import SongPackageBase
|
||||
|
||||
|
||||
class SourceFileInfo(BaseModel):
|
||||
"""Information about the original source audio/video file."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
path: str
|
||||
sha256: str
|
||||
size_bytes: int
|
||||
|
||||
|
||||
class ModelInfo(BaseModel):
|
||||
"""Information about an AI model used during processing."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
stage: str
|
||||
name: str
|
||||
version: str
|
||||
|
||||
|
||||
class MetaDocument(SongPackageBase):
|
||||
"""Song-Paket metadata document (meta.json)."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
title: str | None = None
|
||||
artist: str | None = None
|
||||
language: str | None = None
|
||||
duration_sec: float = Field(ge=0.0)
|
||||
source_file: SourceFileInfo
|
||||
key: str | None = None
|
||||
capo: int | None = None
|
||||
models_used: list[ModelInfo] = Field(default_factory=list)
|
||||
created_at: str
|
||||
stages_done: list[str] = Field(default_factory=list)
|
||||
stages_failed: dict[str, str] = Field(default_factory=dict)
|
||||
41
src/songsplit/schema/strumming.py
Normal file
41
src/songsplit/schema/strumming.py
Normal file
@ -0,0 +1,41 @@
|
||||
"""Schema for strumming.json."""
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from songsplit.schema.base import DataSource, SongPackageBase
|
||||
|
||||
StrumDirection = Literal["down", "up", "unknown"]
|
||||
|
||||
|
||||
class StrumEvent(BaseModel):
|
||||
"""A single strumming event."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
beat: float
|
||||
direction: StrumDirection
|
||||
strength: float = Field(default=1.0, ge=0.0, le=1.0)
|
||||
confidence: float = Field(default=1.0, ge=0.0, le=1.0)
|
||||
source: DataSource = "auto"
|
||||
|
||||
|
||||
class StrumPattern(BaseModel):
|
||||
"""An aggregated strumming pattern over a beat range."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
start_beat: float
|
||||
end_beat: float
|
||||
pattern: str
|
||||
grid: str = "8th"
|
||||
|
||||
|
||||
class StrummingDocument(SongPackageBase):
|
||||
"""Song-Paket strumming document (strumming.json)."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
events: list[StrumEvent] = Field(default_factory=list)
|
||||
patterns: list[StrumPattern] = Field(default_factory=list)
|
||||
34
src/songsplit/schema/tempo.py
Normal file
34
src/songsplit/schema/tempo.py
Normal file
@ -0,0 +1,34 @@
|
||||
"""Schema for tempo.json."""
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from songsplit.schema.base import SongPackageBase
|
||||
|
||||
|
||||
class TempoAnchor(BaseModel):
|
||||
"""A tempo anchor defining constant BPM starting from a given time/beat."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
sec: float
|
||||
beat: float
|
||||
bpm: float = Field(gt=0.0)
|
||||
|
||||
|
||||
class TimeSignature(BaseModel):
|
||||
"""Musical time signature, e.g. 4/4."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
numerator: int = Field(default=4, gt=0)
|
||||
denominator: int = Field(default=4, gt=0)
|
||||
|
||||
|
||||
class TempoDocument(SongPackageBase):
|
||||
"""Song-Paket tempo document (tempo.json)."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
anchors: list[TempoAnchor] = Field(default_factory=list)
|
||||
time_signature: TimeSignature = Field(default_factory=TimeSignature)
|
||||
downbeat_offset: int = 0
|
||||
37
src/songsplit/schema/vocals.py
Normal file
37
src/songsplit/schema/vocals.py
Normal file
@ -0,0 +1,37 @@
|
||||
"""Schema for vocals.json."""
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from songsplit.schema.base import DataSource, SongPackageBase
|
||||
|
||||
|
||||
class VocalSyllable(BaseModel):
|
||||
"""A single syllable with timing, pitch, and confidence."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
text: str
|
||||
start: float = Field(ge=0.0)
|
||||
end: float = Field(ge=0.0)
|
||||
midi: float
|
||||
golden: bool = False
|
||||
confidence: float = Field(default=1.0, ge=0.0, le=1.0)
|
||||
source: DataSource = "auto"
|
||||
|
||||
|
||||
class VocalLine(BaseModel):
|
||||
"""A line of lyrics consisting of one or more syllables."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
start: float = Field(ge=0.0)
|
||||
end: float = Field(ge=0.0)
|
||||
syllables: list[VocalSyllable] = Field(default_factory=list)
|
||||
|
||||
|
||||
class VocalsDocument(SongPackageBase):
|
||||
"""Song-Paket vocals document (vocals.json)."""
|
||||
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
lines: list[VocalLine] = Field(default_factory=list)
|
||||
64
src/songsplit/tempo.py
Normal file
64
src/songsplit/tempo.py
Normal file
@ -0,0 +1,64 @@
|
||||
"""Tempo-Map conversion between seconds and musical beats.
|
||||
|
||||
As defined in the concept:
|
||||
- Vocals are in seconds
|
||||
- Chords and strumming are in beats
|
||||
- Conversion ONLY through sec_to_beat() and beat_to_sec().
|
||||
"""
|
||||
|
||||
from bisect import bisect_right
|
||||
|
||||
from songsplit.schema.tempo import TempoAnchor, TempoDocument
|
||||
|
||||
|
||||
def _get_sorted_anchors(tempo_map: TempoDocument) -> list[TempoAnchor]:
|
||||
"""Return anchors sorted by time/beat, raising ValueError if empty."""
|
||||
if not tempo_map.anchors:
|
||||
raise ValueError("Tempo map has no anchors defined.")
|
||||
return sorted(tempo_map.anchors, key=lambda a: a.sec)
|
||||
|
||||
|
||||
def sec_to_beat(sec: float, tempo_map: TempoDocument) -> float:
|
||||
"""Convert time in seconds to musical beat (float quarter notes).
|
||||
|
||||
Constant tempo is assumed between consecutive anchors.
|
||||
The last anchor applies until the end of the song.
|
||||
Extrapolation is used before the first anchor.
|
||||
"""
|
||||
anchors = _get_sorted_anchors(tempo_map)
|
||||
sec_points = [a.sec for a in anchors]
|
||||
|
||||
idx = bisect_right(sec_points, sec) - 1
|
||||
|
||||
if idx < 0:
|
||||
# Before the first anchor -> extrapolate using the first anchor's tempo
|
||||
anchor = anchors[0]
|
||||
delta_sec = sec - anchor.sec
|
||||
return anchor.beat + delta_sec * (anchor.bpm / 60.0)
|
||||
|
||||
anchor = anchors[idx]
|
||||
delta_sec = sec - anchor.sec
|
||||
return anchor.beat + delta_sec * (anchor.bpm / 60.0)
|
||||
|
||||
|
||||
def beat_to_sec(beat: float, tempo_map: TempoDocument) -> float:
|
||||
"""Convert musical beat (float quarter notes) to time in seconds.
|
||||
|
||||
Constant tempo is assumed between consecutive anchors.
|
||||
The last anchor applies until the end of the song.
|
||||
Extrapolation is used before the first anchor.
|
||||
"""
|
||||
anchors = _get_sorted_anchors(tempo_map)
|
||||
beat_points = [a.beat for a in anchors]
|
||||
|
||||
idx = bisect_right(beat_points, beat) - 1
|
||||
|
||||
if idx < 0:
|
||||
# Before the first anchor -> extrapolate using the first anchor's tempo
|
||||
anchor = anchors[0]
|
||||
delta_beat = beat - anchor.beat
|
||||
return anchor.sec + delta_beat * (60.0 / anchor.bpm)
|
||||
|
||||
anchor = anchors[idx]
|
||||
delta_beat = beat - anchor.beat
|
||||
return anchor.sec + delta_beat * (60.0 / anchor.bpm)
|
||||
25
tests/test_cli.py
Normal file
25
tests/test_cli.py
Normal file
@ -0,0 +1,25 @@
|
||||
"""Unit tests for songsplit CLI."""
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from songsplit.cli import app
|
||||
|
||||
runner = CliRunner()
|
||||
|
||||
|
||||
def test_cli_help():
|
||||
result = runner.invoke(app, ["--help"])
|
||||
assert result.exit_code == 0
|
||||
assert "Audio analysis pipeline decomposing songs into song packages" in result.stdout
|
||||
assert "doctor" in result.stdout
|
||||
assert "analyze" in result.stdout
|
||||
|
||||
|
||||
def test_cli_doctor():
|
||||
result = runner.invoke(app, ["doctor"])
|
||||
assert result.exit_code == 0
|
||||
# Rich table output is printed to stderr as configured in cli.py
|
||||
output = result.stdout + result.stderr
|
||||
assert "Python" in output
|
||||
assert "ffmpeg" in output
|
||||
assert "Model Cache" in output
|
||||
144
tests/test_runner.py
Normal file
144
tests/test_runner.py
Normal file
@ -0,0 +1,144 @@
|
||||
"""Unit tests for PipelineRunner, caching, and hash invalidation."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from songsplit.pipeline.runner import PipelineContext, PipelineRunner, Stage
|
||||
|
||||
|
||||
class MockStageA(Stage):
|
||||
name = "stage_a"
|
||||
version = "1.0.0"
|
||||
model_name = "mock_model_a"
|
||||
model_version = "1.0.0"
|
||||
dependencies: list[str] = []
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.source_file]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_a.txt"]
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
(ctx.output_dir / "out_a.txt").write_text("output A")
|
||||
|
||||
|
||||
class MockStageB(Stage):
|
||||
name = "stage_b"
|
||||
version = "1.0.0"
|
||||
model_name = "mock_model_b"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["stage_a"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_a.txt"]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_b.txt"]
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
in_text = (ctx.output_dir / "out_a.txt").read_text()
|
||||
(ctx.output_dir / "out_b.txt").write_text(f"{in_text} -> B")
|
||||
|
||||
|
||||
class MockStageFailing(Stage):
|
||||
name = "stage_fail"
|
||||
version = "1.0.0"
|
||||
model_name = "mock_fail"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["stage_a"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_a.txt"]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_fail.txt"]
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
raise RuntimeError("Stage failed intentionally")
|
||||
|
||||
|
||||
class MockStageDepOnFail(Stage):
|
||||
name = "stage_dep_on_fail"
|
||||
version = "1.0.0"
|
||||
model_name = "mock_dep"
|
||||
model_version = "1.0.0"
|
||||
dependencies = ["stage_fail"]
|
||||
|
||||
def get_inputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_fail.txt"]
|
||||
|
||||
def get_outputs(self, ctx: PipelineContext) -> list[Path]:
|
||||
return [ctx.output_dir / "out_dep.txt"]
|
||||
|
||||
def run(self, ctx: PipelineContext) -> None:
|
||||
(ctx.output_dir / "out_dep.txt").write_text("should not run")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def run_env(tmp_path: Path):
|
||||
source = tmp_path / "song.mp3"
|
||||
source.write_text("fake audio bytes")
|
||||
out_dir = tmp_path / "song_pkg"
|
||||
return source, out_dir
|
||||
|
||||
|
||||
def test_runner_execution_and_caching(run_env):
|
||||
source, out_dir = run_env
|
||||
ctx = PipelineContext(source_file=source, output_dir=out_dir)
|
||||
runner = PipelineRunner([MockStageA(), MockStageB()])
|
||||
|
||||
# First run: should execute both stages
|
||||
meta = runner.run(ctx)
|
||||
assert "stage_a" in meta.stages_done
|
||||
assert "stage_b" in meta.stages_done
|
||||
assert (out_dir / "out_a.txt").exists()
|
||||
assert (out_dir / "out_b.txt").read_text() == "output A -> B"
|
||||
assert (out_dir / ".cache" / "stage_a.json").exists()
|
||||
assert (out_dir / ".cache" / "stage_b.json").exists()
|
||||
|
||||
# Second run without changes: both should be skipped from cache
|
||||
# Modify output file content to verify it is NOT overwritten
|
||||
(out_dir / "out_b.txt").write_text("modified manually")
|
||||
runner.run(ctx)
|
||||
assert (out_dir / "out_b.txt").read_text() == "modified manually"
|
||||
|
||||
# Run with force=True: should recalculate
|
||||
ctx_force = PipelineContext(source_file=source, output_dir=out_dir, force=True)
|
||||
runner.run(ctx_force)
|
||||
assert (out_dir / "out_b.txt").read_text() == "output A -> B"
|
||||
|
||||
|
||||
def test_target_stage_only_runs_prerequisites(run_env):
|
||||
source, out_dir = run_env
|
||||
ctx = PipelineContext(source_file=source, output_dir=out_dir, target_stage="stage_b")
|
||||
runner = PipelineRunner([MockStageA(), MockStageB()])
|
||||
|
||||
stages = runner.get_stages_to_run(ctx)
|
||||
stage_names = [s.name for s in stages]
|
||||
assert stage_names == ["stage_a", "stage_b"]
|
||||
|
||||
|
||||
def test_stage_failure_does_not_abort_independent_stages(run_env):
|
||||
source, out_dir = run_env
|
||||
ctx = PipelineContext(source_file=source, output_dir=out_dir)
|
||||
# stage_b depends on stage_a (independent of stage_fail)
|
||||
# stage_dep_on_fail depends on stage_fail
|
||||
runner = PipelineRunner([MockStageA(), MockStageFailing(), MockStageDepOnFail(), MockStageB()])
|
||||
|
||||
meta = runner.run(ctx)
|
||||
|
||||
# stage_a and stage_b succeeded
|
||||
assert "stage_a" in meta.stages_done
|
||||
assert "stage_b" in meta.stages_done
|
||||
assert (out_dir / "out_b.txt").exists()
|
||||
|
||||
# stage_fail recorded error
|
||||
assert "stage_fail" in meta.stages_failed
|
||||
assert "RuntimeError" in meta.stages_failed["stage_fail"]
|
||||
|
||||
# stage_dep_on_fail was skipped due to failed dependency
|
||||
assert "stage_dep_on_fail" in meta.stages_failed
|
||||
assert "dependencies failed" in meta.stages_failed["stage_dep_on_fail"]
|
||||
assert not (out_dir / "out_dep.txt").exists()
|
||||
151
tests/test_schema.py
Normal file
151
tests/test_schema.py
Normal file
@ -0,0 +1,151 @@
|
||||
"""Unit tests for Song-Paket Pydantic schemas (Round-trip & validation)."""
|
||||
|
||||
import json
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from songsplit.schema import (
|
||||
ChordsDocument,
|
||||
MetaDocument,
|
||||
ModelInfo,
|
||||
SourceFileInfo,
|
||||
StrummingDocument,
|
||||
TempoAnchor,
|
||||
TempoDocument,
|
||||
VocalsDocument,
|
||||
VocalSyllable,
|
||||
)
|
||||
|
||||
|
||||
def test_meta_document_roundtrip():
|
||||
doc = MetaDocument(
|
||||
title="Test Song",
|
||||
artist="Test Artist",
|
||||
language="de",
|
||||
duration_sec=180.5,
|
||||
source_file=SourceFileInfo(path="/tmp/test.wav", sha256="abc123hash", size_bytes=1048576),
|
||||
key="Am",
|
||||
capo=2,
|
||||
models_used=[ModelInfo(stage="s2_stems", name="htdemucs_ft", version="1.0.0")],
|
||||
created_at="2026-11-02T10:00:00Z",
|
||||
stages_done=["s1_extract", "s2_stems"],
|
||||
stages_failed={"s3_lyrics": "Sample error"},
|
||||
)
|
||||
json_str = doc.model_dump_json()
|
||||
loaded = MetaDocument.model_validate_json(json_str)
|
||||
assert loaded == doc
|
||||
assert loaded.schema_version == "1.0"
|
||||
assert loaded.title == "Test Song"
|
||||
assert loaded.stages_done == ["s1_extract", "s2_stems"]
|
||||
|
||||
|
||||
def test_vocals_document_roundtrip_and_spec_example():
|
||||
spec_example = {
|
||||
"schema_version": "1.0",
|
||||
"generated_by": {
|
||||
"stage": "s4_pitch",
|
||||
"model": "torchcrepe-full",
|
||||
"model_version": "1.0",
|
||||
"params": {"hop": 10},
|
||||
},
|
||||
"lines": [
|
||||
{
|
||||
"start": 12.34,
|
||||
"end": 15.80,
|
||||
"syllables": [
|
||||
{
|
||||
"text": "Hel",
|
||||
"start": 12.34,
|
||||
"end": 12.61,
|
||||
"midi": 64.0,
|
||||
"golden": False,
|
||||
"confidence": 0.88,
|
||||
"source": "auto",
|
||||
}
|
||||
],
|
||||
}
|
||||
],
|
||||
}
|
||||
doc = VocalsDocument.model_validate(spec_example)
|
||||
assert len(doc.lines) == 1
|
||||
syl = doc.lines[0].syllables[0]
|
||||
assert syl.text == "Hel"
|
||||
assert syl.midi == 64.0
|
||||
assert syl.confidence == 0.88
|
||||
assert syl.source == "auto"
|
||||
|
||||
dumped = json.loads(doc.model_dump_json())
|
||||
assert dumped["lines"][0]["syllables"][0]["text"] == "Hel"
|
||||
|
||||
|
||||
def test_vocals_validation_error():
|
||||
with pytest.raises(ValidationError):
|
||||
# confidence > 1.0 is invalid
|
||||
VocalSyllable(text="test", start=1.0, end=2.0, midi=60.0, confidence=1.5)
|
||||
|
||||
|
||||
def test_tempo_document_roundtrip_and_spec_example():
|
||||
spec_example = {
|
||||
"schema_version": "1.0",
|
||||
"anchors": [{"sec": 0.52, "beat": 0.0, "bpm": 120.0}],
|
||||
"time_signature": {"numerator": 4, "denominator": 4},
|
||||
"downbeat_offset": 0,
|
||||
}
|
||||
doc = TempoDocument.model_validate(spec_example)
|
||||
assert len(doc.anchors) == 1
|
||||
assert doc.anchors[0].bpm == 120.0
|
||||
assert doc.time_signature.numerator == 4
|
||||
|
||||
dumped = json.loads(doc.model_dump_json())
|
||||
assert dumped["anchors"][0]["bpm"] == 120.0
|
||||
|
||||
|
||||
def test_tempo_invalid_bpm():
|
||||
with pytest.raises(ValidationError):
|
||||
TempoAnchor(sec=0.0, beat=0.0, bpm=0.0)
|
||||
|
||||
|
||||
def test_chords_document_roundtrip_and_spec_example():
|
||||
spec_example = {
|
||||
"schema_version": "1.0",
|
||||
"chords": [
|
||||
{
|
||||
"start_beat": 0.0,
|
||||
"end_beat": 4.0,
|
||||
"label": "Am",
|
||||
"root": "A",
|
||||
"quality": "min",
|
||||
"bass": None,
|
||||
"confidence": 0.74,
|
||||
"source": "auto",
|
||||
}
|
||||
],
|
||||
}
|
||||
doc = ChordsDocument.model_validate(spec_example)
|
||||
assert len(doc.chords) == 1
|
||||
chord = doc.chords[0]
|
||||
assert chord.label == "Am"
|
||||
assert chord.root == "A"
|
||||
assert chord.quality == "min"
|
||||
assert chord.confidence == 0.74
|
||||
|
||||
dumped = json.loads(doc.model_dump_json())
|
||||
assert dumped["chords"][0]["label"] == "Am"
|
||||
|
||||
|
||||
def test_strumming_document_roundtrip_and_spec_example():
|
||||
spec_example = {
|
||||
"schema_version": "1.0",
|
||||
"events": [{"beat": 0.0, "direction": "down", "strength": 0.9, "confidence": 0.5, "source": "auto"}],
|
||||
"patterns": [{"start_beat": 0.0, "end_beat": 16.0, "pattern": "D . D U . U D U", "grid": "8th"}],
|
||||
}
|
||||
doc = StrummingDocument.model_validate(spec_example)
|
||||
assert len(doc.events) == 1
|
||||
assert doc.events[0].direction == "down"
|
||||
assert doc.events[0].strength == 0.9
|
||||
assert len(doc.patterns) == 1
|
||||
assert doc.patterns[0].pattern == "D . D U . U D U"
|
||||
|
||||
dumped = json.loads(doc.model_dump_json())
|
||||
assert dumped["events"][0]["direction"] == "down"
|
||||
104
tests/test_tempo.py
Normal file
104
tests/test_tempo.py
Normal file
@ -0,0 +1,104 @@
|
||||
"""Unit tests for Tempo-Map conversion (sec_to_beat and beat_to_sec)."""
|
||||
|
||||
import pytest
|
||||
|
||||
from songsplit.schema.tempo import TempoAnchor, TempoDocument
|
||||
from songsplit.tempo import beat_to_sec, sec_to_beat
|
||||
|
||||
|
||||
def test_empty_tempo_map_raises_error():
|
||||
empty_doc = TempoDocument(anchors=[])
|
||||
with pytest.raises(ValueError, match="no anchors"):
|
||||
sec_to_beat(1.0, empty_doc)
|
||||
with pytest.raises(ValueError, match="no anchors"):
|
||||
beat_to_sec(1.0, empty_doc)
|
||||
|
||||
|
||||
def test_constant_tempo_single_anchor():
|
||||
# 120 bpm = 2 beats per second = 0.5s per beat
|
||||
doc = TempoDocument(anchors=[TempoAnchor(sec=0.5, beat=0.0, bpm=120.0)])
|
||||
|
||||
# At anchor
|
||||
assert sec_to_beat(0.5, doc) == pytest.approx(0.0)
|
||||
assert beat_to_sec(0.0, doc) == pytest.approx(0.5)
|
||||
|
||||
# 1 second later = 2 beats
|
||||
assert sec_to_beat(1.5, doc) == pytest.approx(2.0)
|
||||
assert beat_to_sec(2.0, doc) == pytest.approx(1.5)
|
||||
|
||||
# 4 beats later = 2.0s duration -> 2.5s absolute
|
||||
assert beat_to_sec(4.0, doc) == pytest.approx(2.5)
|
||||
assert sec_to_beat(2.5, doc) == pytest.approx(4.0)
|
||||
|
||||
# Before anchor (extrapolation)
|
||||
# sec = 0.0 -> -0.5s -> -1.0 beat
|
||||
assert sec_to_beat(0.0, doc) == pytest.approx(-1.0)
|
||||
assert beat_to_sec(-1.0, doc) == pytest.approx(0.0)
|
||||
|
||||
|
||||
def test_tempo_change_multiple_anchors():
|
||||
# Anchor 0: sec=1.0, beat=0.0, bpm=120 (0.5 sec/beat)
|
||||
# -> 4 beats take 2.0s -> reaches sec=3.0 at beat=4.0
|
||||
# Anchor 1: sec=3.0, beat=4.0, bpm=60 (1.0 sec/beat)
|
||||
# -> 4 beats take 4.0s -> reaches sec=7.0 at beat=8.0
|
||||
# Anchor 2: sec=7.0, beat=8.0, bpm=240 (0.25 sec/beat)
|
||||
doc = TempoDocument(
|
||||
anchors=[
|
||||
TempoAnchor(sec=1.0, beat=0.0, bpm=120.0),
|
||||
TempoAnchor(sec=3.0, beat=4.0, bpm=60.0),
|
||||
TempoAnchor(sec=7.0, beat=8.0, bpm=240.0),
|
||||
]
|
||||
)
|
||||
|
||||
# Exact anchor points
|
||||
assert sec_to_beat(1.0, doc) == pytest.approx(0.0)
|
||||
assert sec_to_beat(3.0, doc) == pytest.approx(4.0)
|
||||
assert sec_to_beat(7.0, doc) == pytest.approx(8.0)
|
||||
|
||||
assert beat_to_sec(0.0, doc) == pytest.approx(1.0)
|
||||
assert beat_to_sec(4.0, doc) == pytest.approx(3.0)
|
||||
assert beat_to_sec(8.0, doc) == pytest.approx(7.0)
|
||||
|
||||
# Inside section 1 (120 bpm)
|
||||
# sec=2.0 -> beat=2.0
|
||||
assert sec_to_beat(2.0, doc) == pytest.approx(2.0)
|
||||
assert beat_to_sec(2.0, doc) == pytest.approx(2.0)
|
||||
|
||||
# Inside section 2 (60 bpm)
|
||||
# sec=5.0 -> 2 seconds after sec=3.0 -> 2 beats -> beat=6.0
|
||||
assert sec_to_beat(5.0, doc) == pytest.approx(6.0)
|
||||
assert beat_to_sec(6.0, doc) == pytest.approx(5.0)
|
||||
|
||||
# Beyond last anchor (240 bpm)
|
||||
# sec=8.0 -> 1 second after sec=7.0 -> 4 beats -> beat=12.0
|
||||
assert sec_to_beat(8.0, doc) == pytest.approx(12.0)
|
||||
assert beat_to_sec(12.0, doc) == pytest.approx(8.0)
|
||||
|
||||
|
||||
def test_roundtrip_identity_across_ranges():
|
||||
# Anchor 0: sec=0.2, beat=0.0, bpm=120.0
|
||||
# 18 beats at 120 bpm = 9.0s -> sec = 9.2, beat = 18.0
|
||||
# Anchor 1: sec=9.2, beat=18.0, bpm=150.0
|
||||
# 42 beats at 150 bpm = 16.8s -> sec = 26.0, beat = 60.0
|
||||
# Anchor 2: sec=26.0, beat=60.0, bpm=95.0
|
||||
doc = TempoDocument(
|
||||
anchors=[
|
||||
TempoAnchor(sec=0.2, beat=0.0, bpm=120.0),
|
||||
TempoAnchor(sec=9.2, beat=18.0, bpm=150.0),
|
||||
TempoAnchor(sec=26.0, beat=60.0, bpm=95.0),
|
||||
]
|
||||
)
|
||||
|
||||
# Test roundtrip for a wide range of seconds
|
||||
test_seconds = [-5.0, 0.0, 0.2, 5.0, 9.199, 9.2, 15.0, 25.999, 26.0, 100.0, 300.0]
|
||||
for s in test_seconds:
|
||||
b = sec_to_beat(s, doc)
|
||||
s_back = beat_to_sec(b, doc)
|
||||
assert s_back == pytest.approx(s, rel=1e-7, abs=1e-7)
|
||||
|
||||
# Test roundtrip for a wide range of beats
|
||||
test_beats = [-10.0, 0.0, 5.0, 18.0, 35.0, 60.0, 150.0]
|
||||
for b in test_beats:
|
||||
s = beat_to_sec(b, doc)
|
||||
b_back = sec_to_beat(s, doc)
|
||||
assert b_back == pytest.approx(b, rel=1e-7, abs=1e-7)
|
||||
343
uv.lock
generated
Normal file
343
uv.lock
generated
Normal file
@ -0,0 +1,343 @@
|
||||
version = 1
|
||||
revision = 5
|
||||
requires-python = ">=3.11, <3.13"
|
||||
|
||||
[[package]]
|
||||
name = "annotated-doc"
|
||||
version = "0.0.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb", size = 10758, upload-time = "2026-07-28T13:50:58.129Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/30/e900b21425a860e195f32e37657aa1f7c7f2b1bfb26f03ca209b90933c06/annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", size = 5302, upload-time = "2026-07-28T13:50:57.239Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "annotated-types"
|
||||
version = "0.8.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "coverage"
|
||||
version = "7.17.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d2/79/e78bd8f75a9b8e32233ce92d4607f0a21ce88a9156cace2884e7175a82f5/coverage-7.17.0.tar.gz", hash = "sha256:cc010a0a7fbdd9bb8bdfd0d3f04a5151275860213cbd7e2b876b29778489c712", size = 991021, upload-time = "2026-10-22T16:06:50.009Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/75/25/79a66272edd250031aeee6db87d500a0bf76390d0d5f8c2f431fe354715f/coverage-7.17.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:99a7b390cbccc6bf029ca4da3f0f607c218bb4085e9cd6b58a90d14ca12993c3", size = 225837, upload-time = "2026-10-22T16:03:55.622Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/52/a6/f5f6fefb2fc1305363927edad1d0a60ce6ef80d6c1a74a79e825f0f670eb/coverage-7.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f72640e02a470b57b15cd655820133f6892760209283a363a60e2df932d5f0fe", size = 226257, upload-time = "2026-10-22T16:03:57.164Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/28/61/72889bac8eb44c51f8043edb227df551dfdca1fc4819a6c6d67b3f69427b/coverage-7.17.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2dc9233f39149b5a4f4aba17a4b6bc5cca22e52cfc4b06fdb07d014439b8b2ea", size = 258282, upload-time = "2026-10-22T16:03:58.521Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/e4/03e4a5644df9b73de0d44d1b82acd18b06c42b5abc3f1433be8363fa983d/coverage-7.17.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8e8113d3852e9377421a61de1917df27b3abb25404a4ecf69f9e64612c4345b5", size = 260506, upload-time = "2026-10-22T16:04:00.116Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6f/4e/949022286df7e59e8633a3a7e6635e0e6b53af7d57074cb0bf8f500373fb/coverage-7.17.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c86a39539d10d666bb819c16c94d7edfc1aa2e0531b937f7c549b83d15177c6e", size = 262600, upload-time = "2026-10-22T16:04:01.49Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/cf/7d67f60df081006315699b7edb9402c1b47142caf1383f4e56ae8ff1a501/coverage-7.17.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:559f748446ee799803686b5784e3deb54c70d655ac386a860e06b11672504ba7", size = 264609, upload-time = "2026-10-22T16:04:03.286Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e1/e0/9293d94afbc099990a085e88229a51c79b00828aba0f2adda32dc4cc16d1/coverage-7.17.0-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:34d65c9e8e257f48a654908005046fbf1bc48d9540ae3776ad08c0acd010e10c", size = 258382, upload-time = "2026-10-22T16:04:04.804Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/24/c8/bcd28efedf262c074dae76f61098739eb02b15f3f716f80cc86f9885b8a9/coverage-7.17.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5b7fa0997b8eba7378ac66f31ec7f70164490353ab79b9667d37c0d365e50177", size = 260299, upload-time = "2026-10-22T16:04:06.291Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b8/dc/503f55e5e2200933403c90d619d9f779b5060ddd338b1bdc63cd235592cb/coverage-7.17.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6ae0453a3390e67f7bfbe34417bbdf5b4ebfc21db23fb446a0a41115eeeca6ca", size = 258314, upload-time = "2026-10-22T16:04:07.729Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/b1/f1a57c36077cc516240636f7eff0d1427939ed795f096dd2c7769213a56c/coverage-7.17.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:96151262832f3c230ebae23b2d6911ad549e1738465946c97004913ff06112ba", size = 262239, upload-time = "2026-10-22T16:04:09.116Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a8/4f/c2e59d4a132936c7c207b9b69ab99c0f27b14c3c93266e9922aa3b562b37/coverage-7.17.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:cd7397de6cc782f00fe5ac1d75e9b306bcfa49c8b6b8dd6ed1f7709393ad40b3", size = 257841, upload-time = "2026-10-22T16:04:10.509Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/04/50742c0ee8b6c85826ff11737c93ed957fea4c9acf4b4b99804bdac1dd84/coverage-7.17.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9d1fdf82c6fea57b5e9dada509f9ce9638c8334664e2c98c7f6f1ccf3d143ad2", size = 259039, upload-time = "2026-10-22T16:04:11.916Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8e/cd/83ad4bbbfcb6d045a33c14cdca313f6c9275737c67f3b7300222e3239a37/coverage-7.17.0-cp311-cp311-win32.whl", hash = "sha256:38c86e5d74bbfd88a393fa3f91257c1225c63aa6db6d5918de3e49ab04f91c6e", size = 227687, upload-time = "2026-10-22T16:04:13.537Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ca/c8/dcc5a7effa79707eb8a61e699b141cff7c9b46036771274cfb48ea7b765f/coverage-7.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:2ed3097c6817bc1a7fc8ae0a6131db74aa1150d863cccc308237ff362d3226b2", size = 228290, upload-time = "2026-10-22T16:04:14.899Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/58/a8553e0dcd38d8136df63964638d2b588e0a4a916bff1bca996244fda693/coverage-7.17.0-cp311-cp311-win_arm64.whl", hash = "sha256:6052e878b628abcd38fa5f2b64abebc686eed4e2267da42434017a9c6d24f241", size = 228199, upload-time = "2026-10-22T16:04:16.351Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/25/989fd3b495c4274ac0cf54cb6664326415e60183a7f8a73dd9bbb0b11e34/coverage-7.17.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0cfdc938ca3319d873d1f1252e60620a39aee4ebf9dbd7cc58238109ebda9c51", size = 225938, upload-time = "2026-10-22T16:04:18.113Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/cb/14726426bf3241657facbf0f7df7babd8f7d3fcf8e4609b7929f9dceecbc/coverage-7.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d523da3c2e4bca49417768bcdb1a443c5b359dc44b8b93a3102e118fce912c40", size = 226166, upload-time = "2026-10-22T16:04:19.524Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8e/97/f95ed32cd3cfbe261a3598e694cb770cefc7b2d13ff013418d6f70a44dde/coverage-7.17.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:adbf3450c0f3f2b2854e282a8758f2b3eddf787eeff24ec9c9bc2cbc38328cc1", size = 258462, upload-time = "2026-10-22T16:04:21.079Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/ac/eb4c31f741509a9ef48cf6f28385e98e9de0785599282252eee252ff8af7/coverage-7.17.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:85932227e9dd38e62cd29c17fefdfecfb919eead6af1e3259522d03cf85de983", size = 261789, upload-time = "2026-10-22T16:04:23.037Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/3e/d9cd006d1a3cc5deab07beb29b86cb4a10dd84d66b330820363fb8d310d6/coverage-7.17.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:30f5477aac9c9e4a0a641c55f8f8fddd7f3bd91176c912c50f40ffced96b4034", size = 262322, upload-time = "2026-10-22T16:04:24.94Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/3a/4c872c6ae0762b09cdb8e856891bb3f584848cb60b6dda2bacb85fe2f3f0/coverage-7.17.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0b8bb651a4406fb6a983a905309fec1783443c65e1771b41e92740a0f4a1176b", size = 264600, upload-time = "2026-10-22T16:04:26.444Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/98/1d41a2373fa98b423bcd70adb91d75e38eafb417955426dbb920b10016f3/coverage-7.17.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0edeb6594f080c8de1263cccb239cb316ef77aeb959e2e0f38f2953fcc72a49e", size = 258678, upload-time = "2026-10-22T16:04:27.832Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/6a/fe04b5e63e76506daa63d90bdfb00a53767fe5df18546b437d6226918d6b/coverage-7.17.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:da94ec0484e84fce5c7bf8d0f54b97767a90d992653a129b35634699d516e0a5", size = 260210, upload-time = "2026-10-22T16:04:29.275Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4f/c3/5c5a78dc19dd4799be9c6ec022316fb25ababaeacfaf0f52f24c56a57b43/coverage-7.17.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a25cc5e8c23a590815c6a7aa43624234d25cb23b21b484adb8a0daed59860db5", size = 258375, upload-time = "2026-10-22T16:04:30.647Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ed/e7/4c1d8eaff4d756fefd15d58c4953a78ab656782fd0e32c5a3465dba61aa0/coverage-7.17.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:db645c81cf4d6bcb392ea1894aad65d55d1588a8472c834b25ca575da3029a56", size = 262422, upload-time = "2026-10-22T16:04:32.053Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/2a/0b17c3e2e7b6ff1a5d92eb58915c0d1026668928f961d14dac73cf1b6096/coverage-7.17.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:6a80a11b90c4a03df1502304cf24ff953255b6b5d076ef79066ecf88baaff31f", size = 257875, upload-time = "2026-10-22T16:04:33.824Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d3/2d/eb0cbde0535342df0d17a667163030a3afb67e5eb9e3ad94af9540041584/coverage-7.17.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e4eaf11d6b0f2147f46cfbf06fe7edcca6f095d0120da00ddc2458995ee869fc", size = 260361, upload-time = "2026-10-22T16:04:35.661Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2e/47/1be2a6db7eb655d0a1d899217c3f2469f9121cbbeddac35c1c8173b1482e/coverage-7.17.0-cp312-cp312-win32.whl", hash = "sha256:912a29f338798541d795e2e25903c6fe7a99dee70a40fe4706a9a124649b523e", size = 227747, upload-time = "2026-10-22T16:04:37.102Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/11/c5/201c894c57de81875d8b8cc527ba222aa350e8cfb183eb3f6df45d06ad8e/coverage-7.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:88a1a9fb0075b83389dd9b403bb3fce976031b3c2aa0e05e3e57143cf639de69", size = 228325, upload-time = "2026-10-22T16:04:38.989Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0b/5d/196095339b19758cf83f507fb598bc42820ae124745feb3084662729e17a/coverage-7.17.0-cp312-cp312-win_arm64.whl", hash = "sha256:2c680e838ff9e68d491158625ca2c1ddb17d78d791bba96a31f8b839b4990438", size = 228131, upload-time = "2026-10-22T16:04:40.654Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/17/48032919343afa2906112d458aceda2043afdb24a2ee8eb4c60904d8ddf1/coverage-7.17.0-py3-none-any.whl", hash = "sha256:bac487dce0d2aff28ddf1a533a916f771416eee0e493960f611e49037b878e9d", size = 217383, upload-time = "2026-10-22T16:06:48.471Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
version = "2.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "markdown-it-py"
|
||||
version = "4.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "mdurl" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mdurl"
|
||||
version = "0.1.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "26.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.7.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic"
|
||||
version = "2.14.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-types" },
|
||||
{ name = "pydantic-core" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9f/d5/b4867fa7c7f04c34997d7d8aad744f64d210bb99d67cf18bf3fb1eea1aed/pydantic-2.14.2.tar.gz", hash = "sha256:fb7b2db6cefe8414dd612edeede49c4c433acb0432b0f92b95024e45f66c505d", size = 911596, upload-time = "2026-10-29T16:37:12.476Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/97/01/c71a71258b58659c72504e5fd65b451f6e36e34dc931d0b237ded213c814/pydantic-2.14.2-py3-none-any.whl", hash = "sha256:7efbf7507b937931cd32a5755acb00ea1cf5ccb1d4e8067a5850d5069e382118", size = 490403, upload-time = "2026-10-29T16:37:10.181Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-core"
|
||||
version = "2.50.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/af/8e/23ec1021834e35041fbb2f10946141e6acdfd39379c45cc4d65a4e8a1d98/pydantic_core-2.50.2.tar.gz", hash = "sha256:1b0e8dc3932cf4e9ed5727570325cacc716b9409ffc794a221c0ccc72e8eb775", size = 518711, upload-time = "2026-10-29T16:34:57.465Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/0f/1043d3840b7859cc19abede795e058a785ebc1fa011b022b0a69514dd5c5/pydantic_core-2.50.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:2115d7ca6d58554af8a14da3dd32d361a4fe999fae52f115a6155679b5b00e72", size = 2160886, upload-time = "2026-10-29T16:31:48.009Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/95/6211dfe1794bde5ce14f3de2212551196784c67411ac5249d8aa627e3e23/pydantic_core-2.50.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b2dd65864aad38dbcc57c3d0e2c978d4286e063378137d8fc0c9fcd558943285", size = 2115730, upload-time = "2026-10-29T16:31:49.449Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/42/50a1a9721cfc21d360916754096c90467fa21386ef16875445ea06a4cf6e/pydantic_core-2.50.2-cp311-cp311-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:26b778d4ebb75f181d36220ff0f54a513fc46f053d9b09ce79993c2f00bc45cc", size = 2274234, upload-time = "2026-10-29T16:31:50.668Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/69/0b/22349c3114a3b3c400333ba6ec1d2e127fc9a4e4682440d8e23d954df0d1/pydantic_core-2.50.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e80c47314c7233e7105a7efcfffd89d56e479e558189d1959eeeaf2639a27680", size = 2116001, upload-time = "2026-10-29T16:31:51.887Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/2e/3b88612239e87cfddd370362e93b18a50d5075883817d6b35e8e3871af75/pydantic_core-2.50.2-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:3bfe12243b3ded517c6734d91f127489e2f51bf95cb533b53130fe360333db80", size = 2204318, upload-time = "2026-10-29T16:31:53.342Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/3b/a735bf3967d0fd73b512705d6f80fbe179d3b6208779721e86613cdf736d/pydantic_core-2.50.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:01eb0282d0b3a065d55956d1be9ce398c46db3dd6d277a6cb2358c8aa8c53179", size = 2392365, upload-time = "2026-10-29T16:31:54.721Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/16/0a0febc06b311d6ca43dd7fa068273d2c4d3c4ad86ac4a6c2f2cbe924c23/pydantic_core-2.50.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:196b87b48b2695426920e8470d20f9e99f019ebd86f15808aa018b68086840cd", size = 2443963, upload-time = "2026-10-29T16:31:56.455Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/7d/22bd04c22adae266ae5e99e4c34bd882daf6c93c35bda2f9674421c1e7c3/pydantic_core-2.50.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:86e7abd24a67f61a4bfe8df059b67a2bdd8bf33705178e98463195d140bd3780", size = 2236349, upload-time = "2026-10-29T16:31:57.837Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/c4/77b12031179047a292128eee12cd7aad899d82391157356a581117e232e7/pydantic_core-2.50.2-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:aff31602e8518594e6f6bc670cdb27e37cb7dbeb2d5d0b76a7707b70fe951ddf", size = 2272702, upload-time = "2026-10-29T16:31:59.287Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/98/58/41f674077b08b79bf2f2ae3c777a5b7b8758647433c6c621580b612e8c1e/pydantic_core-2.50.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a88851e8e332588cb8cced8b5318d1163c7d0bb87830aa8dcafbc4ae9602b73c", size = 2311296, upload-time = "2026-10-29T16:32:00.722Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/61/af/527d1d29cfb8efc7c7f9ed9f35ab5b16a33b1837b186c6e42ecbca699817/pydantic_core-2.50.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3b1bb3950e0794a795c9344d818d5b476189b0c9c9755e8eb8fde87c3acee17a", size = 2481042, upload-time = "2026-10-29T16:32:02.423Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/57/35/79877aaf083424e67c870ba07c0b5ed36a2096a0cfc8b058c1d921797723/pydantic_core-2.50.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:928a44ad1e21a7e923eb924d601605f0694cd187d2ce5d40bf7ad76650f4627d", size = 2488007, upload-time = "2026-10-29T16:32:03.819Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/45/5a627e40690c21be388c4abfddaefbf589e359614456156c90432ac0a76a/pydantic_core-2.50.2-cp311-cp311-win32.whl", hash = "sha256:9a87744e683d9a13f60b7fa5242c17f8d283ffa94ad727cb19063b48c3d34960", size = 2121376, upload-time = "2026-10-29T16:32:05.053Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/9b/d21478003682505aad9619ff9e086bd29aced2615b23d5315cb37de14cad/pydantic_core-2.50.2-cp311-cp311-win_amd64.whl", hash = "sha256:b958c217c6e56bef261f516e4caf5d490b079ad6a428752afada5a764cca6c71", size = 2238388, upload-time = "2026-10-29T16:32:06.811Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e7/26/670a52ea740fd60f5e0a873b74505714c4bfd04c4344f789310005c4cbbd/pydantic_core-2.50.2-cp311-cp311-win_arm64.whl", hash = "sha256:b0e6a2152706d84f7da8b9d34dcecc7e9bde678af32c40bd5b405f427ae0fbdb", size = 2185763, upload-time = "2026-10-29T16:32:08.441Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/65/6609a66cda909d414c58438f9bd70b1e947fe12c25f6bd40c93121afd7ef/pydantic_core-2.50.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e3d824b6152e1c0fd58dc6266f2de470eb7b2286135294f5f7cd26a0f0693738", size = 2220341, upload-time = "2026-10-29T16:32:10.193Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/0b/92463ae7be78d73885487f72c4599902c2cc190378bccaad5718b7495250/pydantic_core-2.50.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:596921489390a002d6a5e303384a0f1f98384f8bb550fbf38a1aafa6093da0f9", size = 2093701, upload-time = "2026-10-29T16:32:11.502Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/62/d3/24147a1aa22f7eade546172750e1110fd7b2793998057809800d3ebeae4e/pydantic_core-2.50.2-cp312-cp312-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:36d8b9725684ca3bf658b90a101d335fc8cae405bb22196b7b5ef41344913756", size = 2253622, upload-time = "2026-10-29T16:32:13.051Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/50/2628ca3c83a0d9a6fda3305fe59b1b28e40c0221e8f234cd1ef86fb64745/pydantic_core-2.50.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:43a8fd56f3c681f3cda2d5c842ad28e88241df742dfcbe8fd1dd437a3056e1f6", size = 2114101, upload-time = "2026-10-29T16:32:14.702Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/c8/cc6d7304a93f91f5e06260ccad71cc7d882489663a37dec009532379fc46/pydantic_core-2.50.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:6f5a432c6c1ef18a1a02a04b3616b8d3f2f88b13faa46caae1ac6559ab202234", size = 2199541, upload-time = "2026-10-29T16:32:16.153Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/d9/18f44ac5696b3e2b2384cb89c9fbe6ed69860f528e232b9fb46cc5b45a17/pydantic_core-2.50.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:5d3cd8be71c4da3c9b42cc92f17e5e3036bdca98bf18555a0e072c3fe87abbb4", size = 2368597, upload-time = "2026-10-29T16:32:17.544Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/22/5f2a48ef819a7e1b74fb003a85d27576ad2f9ddf3901b88998ac63ce1e00/pydantic_core-2.50.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6a438cb8a3f87f2c49e82e43fb19511d4d5043f53e0787dc4df937ccb904373a", size = 2451701, upload-time = "2026-10-29T16:32:18.956Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/93/2a6556bbdb8e918175af9d849a5d0b367b5644e41939d040f3a7215b1339/pydantic_core-2.50.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9667637665acba166a7dbbc786f14c50512d3a01f7199e0e1a13b929e92d7c7a", size = 2242782, upload-time = "2026-10-29T16:32:20.381Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/90/ed/dd9f29a92257f32eb5b99d5120826186ee0632ecc3aaf6c23e2fab89ed6d/pydantic_core-2.50.2-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:b3e681208e2d39fde13fbea449ef2736a85ec1ea2afa41e9193a8c536e71dafe", size = 2253706, upload-time = "2026-10-29T16:32:22.293Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/11/19/1ccf3bf38eb4ed97d8aeefc558458834ae0ad53fdbb1edf61af7228ea500/pydantic_core-2.50.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:6eb6ff07964f39e33c6f57fefe939514e76b8c0d4a694e5663e2e04e80cc1798", size = 2288603, upload-time = "2026-10-29T16:32:23.465Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/cd/bae2320fc89a65bcd87bf66ec83aac51b3b43b970a2edece15feb8af64dd/pydantic_core-2.50.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:4eb54c25e3463d73e1e4ed439ffc45d1d7e590df40bc7bb06f11a906afd996c3", size = 2476597, upload-time = "2026-10-29T16:32:24.824Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/35/1bdb8d52c8e562e95c5e6ebb5784792af568ac6a81470dd546d95f392b60/pydantic_core-2.50.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:91238117cd296352f54f24117ff5a227bdea428865dba1244aa0cdd1424c0bc2", size = 2478664, upload-time = "2026-10-29T16:32:26.197Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/72/0179b40ac6a6b0899c61826f2e3e80f88063f6d821e0dd9641927de46700/pydantic_core-2.50.2-cp312-cp312-win32.whl", hash = "sha256:98722314e12a8e4fa346e0afd3fff2098b5732875ff45592b450a7b589b43c4f", size = 2108820, upload-time = "2026-10-29T16:32:27.736Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/fb/679144362d7e5162519d9f6631ec982521417de3196351c6c56485f5b29f/pydantic_core-2.50.2-cp312-cp312-win_amd64.whl", hash = "sha256:b381574614245f18fdb2d6d1aa8f149e225869c47b5ee7f81812de8977817314", size = 2252238, upload-time = "2026-10-29T16:32:29.572Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0f/68/e3ccc885c3e2086ff84d7ca496f45b974a9f0a49ce2da8973aaa3a369a4b/pydantic_core-2.50.2-cp312-cp312-win_arm64.whl", hash = "sha256:f07c965a8aa6d62145f122641f292129984f39a3e3697585b19298a1488287db", size = 2162565, upload-time = "2026-10-29T16:32:30.853Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/82/ec0384d2a74415aeef7fcd032d29af84a98da0ca25cfb4937b10a2ac78eb/pydantic_core-2.50.2-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:adec010c824290d4ca87047e8d8bfa4f85ac29f545f326cd5321696805d311ed", size = 2154528, upload-time = "2026-10-29T16:34:28.022Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/b4/46483477921934aa31eec9cb86ba95d2f620f4c71da749024c2e3b6e8203/pydantic_core-2.50.2-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:f47c1349c3b4274aeb18459d54244881a5c0dee0fdccedffca45704ba5c9e0a0", size = 2072173, upload-time = "2026-10-29T16:34:29.771Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/16/c1eb6bdd67c9d5f42b290abb86948d8de288bdf4aeca06c588c3cfe6100b/pydantic_core-2.50.2-graalpy311-graalpy242_311_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4ee64baeab403b9de9c92846c5c1abec28ffb046cbc023bfae059897841f88af", size = 2116695, upload-time = "2026-10-29T16:34:31.103Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ae/67/ccd8294730d9335c687facbdfd77515fa3b323e9bbb042c5d63addc6f5f8/pydantic_core-2.50.2-graalpy311-graalpy242_311_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:16ec8e07c37f02dcf68939cc7f202ba9a148cc155ee2acf22d337e10b24c2cb7", size = 2263561, upload-time = "2026-10-29T16:34:32.901Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/4d/23560b11366b547e3e68a3b8f9c02557cee707effa54fd39dbb3c4fff1fa/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:d18d56c1ec63b304f4bb3c7db7e0d311e61cca1b1c944590a4b13ac39b2ca92b", size = 2204868, upload-time = "2026-10-29T16:34:34.745Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/58/b9ddfaad189143d6568627166a730b6624ca90bd9a9a4af4854df88d444b/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:41ed8abeffda6a880207fdc0cd1343a448cec3cc6b38b53f730c0745f745292d", size = 2049162, upload-time = "2026-10-29T16:34:36.186Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/20/99d259bf7835b2f13c6d0b3eb7bcf669fb6349986736fa7a8308a9e620b0/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b7abcfaf66c1dc14c5ed928c349614f223c972a8b021b4be9548dbea6c817371", size = 2112135, upload-time = "2026-10-29T16:34:37.777Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/ca/652c8fe599abacafd852479059d209e608596ad3de82f1bff22e9f0f02fe/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9e7460abce637f90e37f8c443559fbd687c38884d05cb69ef265e634945f4324", size = 2270339, upload-time = "2026-10-29T16:34:39.039Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/9b/d240307fd6882a93a88bf038ff07e1a6dcac0e88f41951fe92c9b614f0b6/pydantic_core-2.50.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b583ddeee6a6bb5bbc04462167c68034913221139d52d9f155ca6d1637a2fdcf", size = 2157909, upload-time = "2026-10-29T16:34:40.355Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/30/e5/d336fb654f8f1584b4a20d71f92c2a966419bc5eafffd36848d8cb1a916d/pydantic_core-2.50.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:5ab5738c39b25b5dc5a721270e2269a2f5e86e614375e6c07ee6caab8cbc0f2f", size = 2075773, upload-time = "2026-10-29T16:34:41.761Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/08/18203f64a405f11c3e4d569c9f49ad7a0b5901cd5fa2dff2436d28531c60/pydantic_core-2.50.2-pp311-pypy311_pp73-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:21a902e546032c82b7275552345a2342d862e0541aea7226c91067c396e68b3f", size = 2277290, upload-time = "2026-10-29T16:34:42.952Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/c4/a4e0ae45ad1554c38caa93e200fdd08e74d2c0149b4242c78b2475903379/pydantic_core-2.50.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:92ada606285dab054e40848a951f583c537cde1e54701ea1305ec0096877012d", size = 2265597, upload-time = "2026-10-29T16:34:44.244Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/20/304baf7724ac137b921ce793e4b686cf4cddc431da4888e5419e7bc7374f/pydantic_core-2.50.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c1b65a42afc73b39e6ae908ec7b9c3b9898676a7b15ce4c66d4965f7071007c8", size = 2289092, upload-time = "2026-10-29T16:34:45.55Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/77/6f/0fe5ac160718d75f2f9729bb31aa9a349dadd0d32886b8c0ecc253629c46/pydantic_core-2.50.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c324a7e0c0012e3974053f81a270d8f1aa23227571f4ddd3254c911bb356459b", size = 2458417, upload-time = "2026-10-29T16:34:46.827Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/43/44/042cbd7e46f00f45aea36496ca8bdb6b1136c2ec4063875a25286c2ba8fc/pydantic_core-2.50.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:cb8d2d7b07cbe2d7488de7e53671f836c4f4a8032dcda079df33dc1b7e2397c0", size = 2492296, upload-time = "2026-10-29T16:34:48.374Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/8e/e8aef16e587215a1795dbe991e41006003aef1f1b6f554361f3a6edd585a/pydantic_core-2.50.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7c6e1bd6cadae13958e52897ef020e85c9916a95917149fca463bb0c0421a7c6", size = 2323090, upload-time = "2026-10-29T16:34:50.008Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/36/d083f973e28c5718f9d9d819c0b8171df1526124e8c3709bd55ddf1d4244/pydantic_core-2.50.2-pp311-pypy311_pp80-macosx_10_12_x86_64.whl", hash = "sha256:f078e276848bc23d1f92f46fc88d5b9cbb824b9acc60d9e07116620e502e16a9", size = 2157909, upload-time = "2026-10-29T16:34:51.579Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/4b/e2eb5b51f46411ceb80451a7bf4aee215fd84012eeba22a183b4699006b5/pydantic_core-2.50.2-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:3435c443da7510a6de1a30c68beae338852a11f0440cc8320ea756a162f38dbe", size = 2075771, upload-time = "2026-10-29T16:34:53.469Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d5/99/e9703785468d1e644f19d602985b722ff97cc8ca67389e2d79f8fb562cfa/pydantic_core-2.50.2-pp311-pypy311_pp80-manylinux_2_28_x86_64.whl", hash = "sha256:b5675a12a7b67063fe3ca187e735b0463cf13fabc10166ae4d4b2f775fd0632d", size = 2265708, upload-time = "2026-10-29T16:34:54.662Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/d7/079d3d36aa6ee0333847d968d91ff185837541741d3c58ed0316103309bf/pydantic_core-2.50.2-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:f5ba7ef10ce82737e173fa95cafa1c8210918f7e653715b2c7a7a31877a74848", size = 2323087, upload-time = "2026-10-29T16:34:56.176Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.21.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "9.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "iniconfig" },
|
||||
{ name = "packaging" },
|
||||
{ name = "pluggy" },
|
||||
{ name = "pygments" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/79/42/bb4641652e58dedeac2ec51abc1f8cae4fee4ec63899a0999016229a0f2a/pytest-9.2.0.tar.gz", hash = "sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b", size = 1797555, upload-time = "2026-10-27T21:30:20.728Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/51/39/1f5d8c8877a0fa327db959c19341d4be61660de1ab6b7391f9eb805bcd67/pytest-9.2.0-py3-none-any.whl", hash = "sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588", size = 411776, upload-time = "2026-10-27T21:30:19.131Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest-cov"
|
||||
version = "7.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "coverage" },
|
||||
{ name = "pluggy" },
|
||||
{ name = "pytest" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b1/51/a849f96e117386044471c8ec2bd6cfebacda285da9525c9106aeb28da671/pytest_cov-7.1.0.tar.gz", hash = "sha256:30674f2b5f6351aa09702a9c8c364f6a01c27aae0c1366ae8016160d1efc56b2", size = 55592, upload-time = "2026-03-21T20:11:16.284Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl", hash = "sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678", size = 22876, upload-time = "2026-03-21T20:11:14.438Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rich"
|
||||
version = "15.0.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "markdown-it-py" },
|
||||
{ name = "pygments" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.17.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/59/73/81f140c4edd9cc323de5478e6bbd3bbcfae9a82692df1a258de8cec6a6d2/ruff-0.17.3.tar.gz", hash = "sha256:a57049c8addb3662073859bb55a7ad35aa54f8a7c9ed268911d1333c5aadaaa9", size = 5339444, upload-time = "2026-10-27T00:34:05.914Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/8c/083365310c4e79c842f25bf5a842facbd9b0c0ec336f96dffa5074fe723d/ruff-0.17.3-py3-none-linux_armv6l.whl", hash = "sha256:ab86b84cd9d05e56d329742c0cabdcbe2d1d56c98f4a04aab9b5b66196febfb4", size = 10216522, upload-time = "2026-10-27T00:33:29.822Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/26/4b2edf31cfebe9605d8f6ed8f1d6f376d3a53d4c9a123e62661c64c440f0/ruff-0.17.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e407b4a6852853a9a2cdce96963e94ad9775578bb44e7561a0f2829f3cc04b11", size = 10217786, upload-time = "2026-10-27T00:33:33.949Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/7e/537aba4b7f54397a374d2f6a6fc93e9c8015e18553f31a4a7b7dbced48b5/ruff-0.17.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b75cc113b3aca388933d8296b667b1ac401a80317ea3074c9b0a66541199da29", size = 9440362, upload-time = "2026-10-27T00:33:35.784Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/66/283e39734f66c8a5ebaa93c22eb7b7515779a0b1d5a5c0ad20e05c0edb41/ruff-0.17.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab5fa7ed5ce18554ea69d850ad162cbaa0c85fc47c08d83a569f806681c9a6ad", size = 10094281, upload-time = "2026-10-27T00:33:38.216Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/4c/1ffc768497bd025a32c72152771e40c0b99bddc5cc6e4f50c7949a395346/ruff-0.17.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c673c170e27834d1262e3a9c1e97bdc9b9c3b180c63d89173ce69747232474c1", size = 10022543, upload-time = "2026-10-27T00:33:40.181Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/c3/f90db547301080fcb82c92abf914c8bd57b89911d9b65a6c4cc6b52d0635/ruff-0.17.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a754c0341bc9ca151b7b335988b3263921c08859f84ca219b70cee825571b6f", size = 10683921, upload-time = "2026-10-27T00:33:42.182Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e5/98/92d4a8a26c6c96cf1a5b34dd59036d8a71e52d650aab065c58867e964e63/ruff-0.17.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4590b9d86c0b1543ebb09094254e191cd43fe8edaf330baa035aab03da251532", size = 11373408, upload-time = "2026-10-27T00:33:44.19Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/43/02/1f24d2e3064c9753926deeb901afa57777b37ee46799b09ddd7aee6e5145/ruff-0.17.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bbde18beccd98c29a227c63c99022e3443b99258e08326df6425dfe0443705ef", size = 10977469, upload-time = "2026-10-27T00:33:46.179Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/20/fecedea2209f574ab92033b344e01a7f0c2dc76c6d6d19a14c9f8141173f/ruff-0.17.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fa4b0f931cdbcb8a52044f370a3eb429fb42eb88807b0e800fcaa98dd42b24e", size = 10577491, upload-time = "2026-10-27T00:33:48.233Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/33/36/b93fdf0bc6f84f0cd487aadfb0354deb40013669ea35ac3d26855de1e959/ruff-0.17.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:39405f341deec934b4289634324ad695f72df2970f9121582872eaf5b722f0f5", size = 10608748, upload-time = "2026-10-27T00:33:50.284Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/b7/7d3f5f14145daead1efb0b9a8289ed1daa100f419d60774375951723ce00/ruff-0.17.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:68074094f55ca3d29ab19491f640282f7a84061c4c7977aa5094b968ca457e9a", size = 10075057, upload-time = "2026-10-27T00:33:52.074Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b0/ed/93ff7a5909ee56e2bd4b982deae9e0efb2724417874a90c9e41ad66c6dd7/ruff-0.17.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:27bb571ac78fef178fe5118d2827df95c2aae74a48fff2b15f6acd03af5ff5bb", size = 10022431, upload-time = "2026-10-27T00:33:54.061Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/07/a83b9eeec8c1c3c0e4eda15f06c3a91001bfd2687ea2f07b750719bf9712/ruff-0.17.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:029c37cbd3de48ca37aa12117bead2d065f15da17d66bf84e0d4274013705db2", size = 10394903, upload-time = "2026-10-27T00:33:56.158Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/af/b2/05c39857c2526fcbebe46ad93a8dc97424656dfef14d3ef933abe1ffd331/ruff-0.17.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:692fdb46d0fd9c71e380947dc5fc72f2c3f881073bc1f739e4579376231affbe", size = 10799780, upload-time = "2026-10-27T00:33:58.204Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ec/d9/47171a16739eb7a353936b31c20cf54340531e68c9af7d72fd7a784e235d/ruff-0.17.3-py3-none-win32.whl", hash = "sha256:46539cb031b01fd29ae0a02142483c46640b233ee12bb1c1b690bffa1555d5ca", size = 9908481, upload-time = "2026-10-27T00:34:00.087Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/a0/f08c1631bfd81faa6a90eaf70c37c786c11bed2046302b56bb506c25e1a0/ruff-0.17.3-py3-none-win_amd64.whl", hash = "sha256:56b8ffb3f3b3cbccb8b76b71b38261b7ed982ef5d20f5b447b1b61a7f4949b24", size = 10341333, upload-time = "2026-10-27T00:34:02.099Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/d5/4ad4ed31413c301430918e70d3d38ae6f097af0766cb9ab8c9d502b2a4d6/ruff-0.17.3-py3-none-win_arm64.whl", hash = "sha256:81fce74bcd6be0e9da7c67c7553fd0f1f12964a2052cd728ef917b937a5ca1d9", size = 9854332, upload-time = "2026-10-27T00:34:03.847Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shellingham"
|
||||
version = "1.5.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "songsplit"
|
||||
version = "0.1.0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "pydantic" },
|
||||
{ name = "rich" },
|
||||
{ name = "typer" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
dev = [
|
||||
{ name = "pytest" },
|
||||
{ name = "pytest-cov" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "pydantic", specifier = ">=2.7.0" },
|
||||
{ name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0.0" },
|
||||
{ name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=5.0.0" },
|
||||
{ name = "rich", specifier = ">=13.7.0" },
|
||||
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.4.0" },
|
||||
{ name = "typer", specifier = ">=0.12.0" },
|
||||
]
|
||||
provides-extras = ["dev"]
|
||||
|
||||
[[package]]
|
||||
name = "typer"
|
||||
version = "0.27.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-doc" },
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "rich" },
|
||||
{ name = "shellingham" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/03/51/d33db42cc72ffd8c30777547b42d01f0cbf9d95a770457698d0174b3ed71/typer-0.27.3.tar.gz", hash = "sha256:d0396f770a560ab1b0a8504e13b5f254b728cedb05c61cf0359e944e50ce8901", size = 205303, upload-time = "2026-10-06T17:24:16.61Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/07/ea/2e31b67051e91a133189e9c000c222502ddc6969856416de0d095de4c0b0/typer-0.27.3-py3-none-any.whl", hash = "sha256:e50022f28b82a86313e54501317a1db64bf8f8d036ff8cfe5ca7e47675454aff", size = 123312, upload-time = "2026-10-06T17:24:15.054Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.16.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-inspection"
|
||||
version = "0.4.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928, upload-time = "2026-08-12T12:37:25.997Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" },
|
||||
]
|
||||
Reference in New Issue
Block a user