Date: 2026-02-24
Scope: Transcribe, OCR, notion-cli (sorted by last change in workspace)
notion-cli— 2026-02-24 10:23:44Transcribe— 2026-02-23 08:33:03OCR— 2026-02-21 17:01:11
Across the three projects, the most robust patterns are:
pyproject.toml-first packaging with console script entrypoints.- Typer/Click for CLI ergonomics.
- Rich + Loguru for user-facing UX + structured logging.
- Pydantic settings for configuration (OCR, notion-cli), with
.envhelpers. - PyInstaller for standalone binaries (Transcribe, notion-cli).
Notable gaps seen consistently:
- Some builds rely on manual PyInstaller spec files without automated build pipelines.
- Mixed dependency management patterns (Hatch + uv + ad-hoc dev groups).
- Sparse use of
py.typedand strict typing in Transcribe (OCR and notion-cli are stronger).
- Build system: Hatchling (
pyproject.toml). - CLI entrypoint:
transcribe = audio_transcribe.cli:main. - Standalone build: PyInstaller with two spec files:
transcribe.spec(legacy local path)transcribe-windows-amd64.spec(current path) for Windows AMD64.
- PyInstaller config highlights:
hiddenimportsfor dynamic dependencies (assemblyai, groq, openai, questionary, rich, etc.).- Explicit
datasinclusion forloguru. - UPX compression enabled.
- CLI uses Click with a custom
NormalizedPathto handle trailing quotes and slashes (PowerShell edge cases). - Transcription pipeline:
- Accepts file or folder input and supports globbing.
- Checks for existing raw JSON outputs to avoid repeat API calls.
- Can ingest API JSON directly and parse to canonical
TranscriptionResult. - Handles chunking automatically when file size exceeds API limits (via
ChunkingMixin).
- Audio optimization:
- Uses ffmpeg via pydub and custom helpers to compress or chunk.
- Tracks temporary intermediate files and cleans up after run.
- Supports multiple outputs: text, SRT, word-level SRT, DaVinci Resolve optimized SRT.
- Adds pause markers and filler word handling for DaVinci Resolve workflows.
- Interactive setup wizard (TUI) for API keys.
- Uses a “JSON-first” workflow to rehydrate transcript state.
- Word-level conversion and pause merging logic is well-encapsulated but complex; careful tests are needed.
- PyInstaller spec is handcrafted and may drift from the Python package entrypoint.
- Build system: Hatchling with
pyproject.toml. - CLI entrypoint:
ocr = ocr.main:app(Typer). dependency-groups.devfor dev tooling.- No standalone PyInstaller spec present; installs as a global
uv tool.
- Typer app with async processing and concurrency controls.
- System-wide configuration via pydantic-settings and
.envsetup. - Shared Mistral client instance for efficiency and consistent rate-limiting.
- Strong separation of concerns:
adapters/for API integration.services/for filename generation, folder watching, processing queue.utils/for caching, output, renaming, progress, locks.models/for metadata and settings.
- Intelligent filename generation:
- First-page OCR → confidence check → full document OCR if low confidence.
- Stores YAML frontmatter with metadata and rename history.
- Output saved to
.ocr/subdirectory with consistent naming patterns. - Safe rename workflow that updates both source file and OCR markdown.
- Good example of “smart caching” and “confidence-based escalation.”
- Uses rename logging both in a dedicated log file and in file frontmatter.
- A clear pattern for scalable async processing with good UX feedback.
- Build system: Hatchling (
pyproject.toml). - CLI entrypoint:
notion-cli = notion_cli.main_typer:app. - PyInstaller spec exists (
notion-cli.spec) but is minimal:Analysis(['main.py'])likely outdated or misaligned withsrc/notion_cli/main_typer.py.- No explicit hidden imports.
- Typer-based CLI with multiple command groups (
auth,tasks,task,content,projects). - Logging configured via Loguru with rotating file logs in
~/.notion-cli/logs/. - Uses Pydantic models for tasks and content projects.
- Auth flow:
- Encrypted token storage.
- Login validates token and stores it securely.
- Auth status and integration access checks are first-class commands.
- Multi-format output for tasks: table, simple, json, md, todo.txt.
- Optional verbose logging for deep diagnostics.
- Comprehensive README with operational guidance.
- CLI UX is polished with helpful output formats.
- Logging strategy is strong and can be reused as a scaffold template.
- PyInstaller spec likely needs alignment to the current entrypoint if standalone build is expected.
- Console scripts via
pyproject.toml. - Typer (and Click) for CLI ergonomics.
- Structured logging with Loguru.
- Rich for tables/progress and better UX.
- Pydantic settings with
.envsupport. - Clear separation of adapters/services/utils/models.
- Align PyInstaller specs with actual entrypoints and include
hiddenimportsconsistently. - Standardize on a single packaging + tooling approach (Hatch + uv is reasonable).
- Add
py.typedfor type completeness across all projects. - Tighten CI and add smoke tests for executables.
src/layout withpyproject.tomland a console script entrypoint.- Typer + Rich for UX, Loguru for logging.
- Pydantic settings with layered
.envdiscovery (cwd + home). - Structured error handling with explicit exit codes.
- Optional PyInstaller spec or build workflow template aligned to entrypoint.
- Tests for CLI, config, and critical IO logic.