text
stringlengths
185
73.3k
repo
stringlengths
7
100
path
stringlengths
4
146
language
stringclasses
7 values
hash
stringlengths
16
16
score
float64
7
8.5
stars
int64
0
237k
#!/usr/bin/env python3 """Pending-baseline helpers for the Learn autodoc pipeline.""" from __future__ import annotations import hashlib import json import os import re from pathlib import Path from typing import Any from urllib.parse import urlparse PENDING_RELATIVE_DIR = Path("data") / "monitor-pending" / "learn" _...
judeper/FSI-AgentGov
scripts/autodoc_defer.py
.py
33e1cc22fe3e222a
7.48
8
#!/usr/bin/env python3 """Parse exact identity markers from autodoc issue bodies/snapshots.""" from __future__ import annotations import json import re from dataclasses import dataclass from typing import Any, Iterable, Mapping _FINGERPRINT_LINE_RE = re.compile(r"^AUTODOC-FINGERPRINT:\s*(\S+)\s*$", re.MULTILINE) _SO...
judeper/FSI-AgentGov
scripts/autodoc_issue_identity.py
.py
93eacd18a4edcdcd
7.48
8
#!/usr/bin/env python3 """Independent CI re-verification of an autodoc *redirect* pull request. The unattended runner opens redirect PRs (a moved Microsoft Learn URL swapped in ``docs/reference/microsoft-learn-urls.md``) and verifies the swap itself before opening the PR. For Stage 2 auto-merge, the merge must additio...
judeper/FSI-AgentGov
scripts/autodoc_redirect_ci_verify.py
.py
2d63c7218fcf2b1a
7.48
8
#!/usr/bin/env python3 """Build deterministic GitHub issue specs for Learn Monitor autodoc routing.""" from __future__ import annotations import argparse import hashlib import json import re import sys from pathlib import Path from typing import Any if __package__: from . import autodoc_classifier as classifier ...
judeper/FSI-AgentGov
scripts/autodoc_route.py
.py
a37d44e48a258119
7.48
8
"""Fail-closed merge-gate orchestrator for autodoc pull requests. Runs the deterministic verifier only. The independent cross-model review runs locally in the unattended runner before a pull request is opened; this CI gate is a deterministic backstop suitable for a branch-protection required check. """ from __future_...
judeper/FSI-AgentGov
scripts/autodoc_verify_gate.py
.py
127005d22ec10773
7.48
8
#!/usr/bin/env python3 """Change Radar roadmap monitor (curation-assist, fail-closed). Fetches the public **Microsoft Release Communications** feed (the Microsoft 365 roadmap), filters to agent-relevant items, and diffs them against a dedicated state file. New, changed, or withdrawn items are written as **pending cand...
judeper/FSI-AgentGov
scripts/change_radar_monitor.py
.py
adbd98b2198abb71
7.48
8
#!/usr/bin/env python3 """Detect drift in the Change Radar feed data and lint its customer-facing copy. The Change Radar page consumes ``docs/javascripts/change-radar-data.json``, which is generated from ``data/change-radar/items.json`` by ``scripts/gen_change_radar_data.py``. This checker enforces three invariants so...
judeper/FSI-AgentGov
scripts/check_change_radar_data_drift.py
.py
206e1d6fb5fd2a41
7.48
8
#!/usr/bin/env python3 """Detect drift between the control manifest and Control Explorer data. The docs-site Control Explorer reads ``docs/javascripts/control-explorer-data.json``. That data must stay aligned with the canonical 79-control manifest in ``assessment/manifest/controls.json`` so search facets and recommend...
judeper/FSI-AgentGov
scripts/check_explorer_data_drift.py
.py
402056eedea71561
7.48
8
# /// script # requires-python = ">=3.12" # dependencies = [ # "packaging==23.1", # "urllib3==2.0.5", # ] # /// """Update ty-pre-commit to the latest version of ty.""" import re import subprocess import tomllib import typing from pathlib import Path import urllib3 from packaging.requirements import Requirement fr...
allganize/ty-pre-commit
mirror.py
.py
e19b89da79069cf3
7.57
13
"""Navimower: private-cloud features with standalone official OAuth/MQTT.""" from __future__ import annotations import asyncio import logging from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ...
vahesoo/NaviMower
custom_components/navimower/__init__.py
.py
5125c650d2f3848e
7.59
14
"""Pure helpers for account-scoped private-cloud identity. Navimow's private app cloud associates an account session with a stable app ``device_id``. Multiple Home Assistant config entries using the same account must therefore present the same identity; otherwise logging in one mower entry can invalidate another entry...
vahesoo/NaviMower
custom_components/navimower/account.py
.py
1400fbd29197c9d1
7.59
14
"""Segway/Ninebot passport authentication with regional account discovery. The account directory is regional. ``lookup_region`` asks the regional passport servers which one owns the e-mail address using signed ``GET /v3/region`` before the password is offered to any server. Synchronous (urllib) on purpose: Home Assi...
vahesoo/NaviMower
custom_components/navimower/api/passport.py
.py
0678beb1f071c163
7.59
14
"""Regional routing for the Navimow mobile-app private cloud. The private account directory is regional. Keep that routing separate from the Smart Home OAuth/MQTT branch: official MQTT continues to use the broker returned by the Smart Home API and is not selected from this table. """ from __future__ import annotation...
vahesoo/NaviMower
custom_components/navimower/api/regions.py
.py
5c8b93688b6610ff
7.59
14
"""Calendar platform for Navimower. Exposes the mower's weekly mowing schedule as a native HA calendar: each scheduled period becomes a (recurring-weekly) event with the target zone in the summary. The entity state is the NEXT upcoming mow, so you get "next cut + zone" for free, plus automations on calendar events. R...
vahesoo/NaviMower
custom_components/navimower/calendar.py
.py
f1763a470b1a27f9
7.59
14
"""Local channel/corridor geometry used by gate automations and the map card.""" from __future__ import annotations from dataclasses import asdict, dataclass import json import re from typing import Any @dataclass(frozen=True, slots=True) class NavimowerChannel: """A rectangular local-coordinate channel.""" ...
vahesoo/NaviMower
custom_components/navimower/channel.py
.py
49bd2b9ec04f3826
7.59
14
"""Narrow semantic corrections layered on the main Navimower coordinator.""" from __future__ import annotations from typing import Any from .api import NavimowAuthError, NavimowError from .coordinator import ( NavimowCoordinator as _BaseNavimowCoordinator, _parse_map_detail, _parse_map_detail_plain, _...
vahesoo/NaviMower
custom_components/navimower/coordinator_semantics.py
.py
4cf0cf5e5c096a95
7.59
14
"""Persistent NaviMower Custom Area polygons and import helpers.""" from __future__ import annotations from dataclasses import dataclass import hashlib import json import re import uuid from typing import Any OPT_CUSTOM_AREAS = "custom_areas" def normalize_polygon(raw: Any) -> list[list[float]] | None: """Retur...
vahesoo/NaviMower
custom_components/navimower/custom_area.py
.py
a3ceba33ef1d4f33
7.59
14
"""Native Home Assistant GPS device tracker for Navimower.""" from __future__ import annotations from typing import Any from homeassistant.components.device_tracker import SourceType, TrackerEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.hel...
vahesoo/NaviMower
custom_components/navimower/device_tracker.py
.py
ddb79e610d4fac68
7.59
14
"""Shared base entity for Navimower. Ties every entity to the single mower device (keyed by vehicle_sn) and to the coordinator's parsed snapshot. """ from __future__ import annotations from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity ...
vahesoo/NaviMower
custom_components/navimower/entity.py
.py
c0ce60c5e465b537
7.59
14
"""Real-time location / zone decoding for Navimow (fork addition). The stock navimow-sdk subscribes to the .../realtimeDate/state, /event and /attributes MQTT channels but NOT /location, and its router drops the location payload (a JSON array, not a dict). This module decodes that topic so the integration can expose l...
vahesoo/NaviMower
custom_components/navimower/location.py
.py
c943beb7c802e785
7.59
14
"""Authenticated HTTP API for the standalone Navimower Map Card.""" from __future__ import annotations from typing import Any from aiohttp import web from homeassistant.components.http import HomeAssistantView from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr, entity...
vahesoo/NaviMower
custom_components/navimower/map_api.py
.py
0dcc1648809664c3
7.59
14
"""Shared map identifier resolution for Navimower cloud endpoints.""" from __future__ import annotations from typing import Any _INVALID_MAP_IDENTIFIERS = {"", "0"} def valid_map_identifier(value: Any) -> bool: """Return whether a cloud map identifier can be used for map requests.""" if value is None: ...
vahesoo/NaviMower
custom_components/navimower/map_identifiers.py
.py
8db121b7364db582
7.59
14
"""Small model-family compatibility helpers.""" from __future__ import annotations from typing import Final # First-generation Navimow H-series models do support selecting one or more # mowing zones, but do not expose the later app feature that lets the user set a # custom zone sequence. Keep this list explicit so ne...
vahesoo/NaviMower
custom_components/navimower/model_support.py
.py
45c34813e0d3f5b0
7.59
14
"""Read-state actions for vendor and Navimower-local notifications. Vendor rows keep the official Navimow H5 mutation contracts and are refreshed from the cloud after each explicit action. Navimower-generated rows use the ``navimower:`` message-id namespace and are marked read only in the local persistent notification...
vahesoo/NaviMower
custom_components/navimower/notification_actions.py
.py
9f835893c0577807
7.59
14
"""Navimow vendor notifications plus the Navimower local notification center. The vendor side uses the main app Notification -> Device feed contract recovered through the 0.4.1 beta line: * POST ``/mowerbot/user/message/vehicleMessageListField`` through p:101, * payload ``message_id`` + ``vehicle_sn`` + ``filter_stat...
vahesoo/NaviMower
custom_components/navimower/notification_feed.py
.py
2733fbe777cf5f2c
7.59
14
"""Number platform for Navimower settings.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from typing import Any from homeassistant.components.number import ( NumberDeviceClass, NumberEntity, NumberEntityDescription, NumberMode, ) from home...
vahesoo/NaviMower
custom_components/navimower/number.py
.py
bf9c491af19b92d0
7.59
14
"""Official Navimow Smart Home OAuth implementation.""" from __future__ import annotations import logging from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryAuthFailed from homeassistant.helpers import config_entry_oauth2_flow from homeassistant.helpers.config_entry_oauth2_fl...
vahesoo/NaviMower
custom_components/navimower/oauth.py
.py
7ba67392d719cf24
7.59
14
"""Dependency-free helpers for freshness-aware position fallback.""" from __future__ import annotations import time from typing import Any CLOUD_GATE_FRESH_SECONDS = 30.0 def _as_float(value: Any) -> float | None: try: return float(value) except (TypeError, ValueError): return None def clo...
vahesoo/NaviMower
custom_components/navimower/position_fallback.py
.py
8c22032e68f224e8
7.59
14
"""Persist and diagnose private-cloud regional routing. Regional host selection lives in :mod:`navimower.api`; this small runtime bridge connects that per-client state to Home Assistant's config entry without making the large coordinator aware of transport-specific routing tables. """ from __future__ import annotation...
vahesoo/NaviMower
custom_components/navimower/private_cloud_region.py
.py
33ed62101bcaf651
7.59
14
"""Resume an existing vendor-retained Navimow mowing task.""" from __future__ import annotations from copy import deepcopy from datetime import UTC, datetime from typing import Any from .const import ACTIVITY_MOWING def _command_number(value: Any) -> str | None: """Extract a vendor command number without retain...
vahesoo/NaviMower
custom_components/navimower/resume.py
.py
5cef66d78724a995
7.59
14
"""Pure helpers for coalescing duplicate Navimower route samples. A vendor pose is identified by timestamp, X/Y, heading and activity. MQTT state/action and resolved zone are observation metadata and may legitimately be missing from one delivery and present in another. Metadata-only differences must enrich the retaine...
vahesoo/NaviMower
custom_components/navimower/route_dedupe.py
.py
934ef23319b34275
7.59
14
# custom_components/avalon_nano3s/config_flow.py import logging from typing import Any import voluptuous as vol from homeassistant import config_entries from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers import config_validation as cv from homeassistant.helpers.selector import SelectSelecto...
jinx-22/avalon_nano3s
custom_components/avalon_nano3s/config_flow.py
.py
41fc502f7a4244dc
7.5
9
from __future__ import annotations from homeassistant.components.light import LightEntity, ColorMode from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.update_coordinator impor...
jinx-22/avalon_nano3s
custom_components/avalon_nano3s/light.py
.py
661d5d3fa163ede7
7.5
9
from __future__ import annotations import logging from homeassistant.components.number import NumberEntity, NumberMode from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.upda...
jinx-22/avalon_nano3s
custom_components/avalon_nano3s/number.py
.py
a289cfae9a2c9c0f
7.5
9
# custom_components/avalon_nano3s/select.py from __future__ import annotations import logging from homeassistant.components.select import SelectEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback...
jinx-22/avalon_nano3s
custom_components/avalon_nano3s/select.py
.py
d23e5f1c35ec4122
7.5
9
# Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Shared path helpers for scripts moved into subdirectories.""" from __future__ import annotations from pathlib import Path import sys def find_repo_root(start: Path) -> Path: cur = start if start.is...
NVDLI/NemoClawDLI
scripts/_bootstrap.py
.py
e87b9009ac9b33ea
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Write a build-time language manifest for the Pages foyer.""" from __future__ import annotations import argparse import json import re from pathlib import Path SKIP_DIRS = {"docs"...
NVDLI/NemoClawDLI
scripts/build/build_language_manifest.py
.py
d5cd05451e8efbb0
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Project every generated explorer/navigation surface to one static artifact root.""" from __future__ import annotations import argparse import os import re from pathlib import Path...
NVDLI/NemoClawDLI
scripts/build/project_artifact_navigation.py
.py
96f0deaeeaccfc5f
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Publish the nemoclaw standalone bundle to S3 for the edX HtmlBlock view. The student-facing edX page is a single HtmlBlock that iframes module pages out of S3. This script keeps t...
NVDLI/NemoClawDLI
scripts/build/publish_edx.py
.py
27e48837627ccb95
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Fail before candidate or publication preparation if a privileged value is in scope.""" from __future__ import annotations import os FORBIDDEN_PREFIXES = ("LIVE_", "AWS_", "COURS...
NVDLI/NemoClawDLI
scripts/ci/assert_unprivileged_environment.py
.py
7c621e692ae256c7
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Create a bounded CDN tree from an already verified Pages candidate.""" from __future__ import annotations import argparse import hashlib import json import shutil from pathlib imp...
NVDLI/NemoClawDLI
scripts/ci/prepare_cdn_publication.py
.py
b1c8c5acea46cca0
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Build the prebuilt vector index for the Module 2b Index Agent (web/nemoclaw/02b-rag.html). This is the "index built offline, once" step the page teaches, made real. It embeds the ...
NVDLI/NemoClawDLI
scripts/materials/build_rag_index.py
.py
2a6938ec1dd5fe40
7.45
7
#!/usr/bin/env python3 # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Wrap scripts/edx/edx_navigator_quick.html in a full HTML5 document and publish to S3 as a standalone, shareable entry point to the nemoclaw course. The navigator was originally an...
NVDLI/NemoClawDLI
scripts/materials/vendor_navigator.py
.py
08cf0939221f200a
7.45
7
"""Provider-abstracted LLM client. Dispatches to OpenRouter (aiohttp) or Gemini (google-genai SDK) based on LLMSettings.provider. """ import asyncio import logging import aiohttp from google import genai from src.video.config.llm_settings import LLMSettings logger = logging.getLogger(__name__) class LLMCallError...
stkzlv/ContentEngineAI
src/ai/llm_client.py
.py
d000f21d28ef54ef
7.42
6
"""Abstract base class for platform-specific metadata generators. This module defines the common interface that all platform-specific metadata generators (YouTube, TikTok, Instagram) must implement. It provides shared utilities for LLM-based generation while enforcing implementation of platform- specific validation an...
stkzlv/ContentEngineAI
src/ai/platform_metadata/base.py
.py
6dec8e24d8de30f9
7.42
6
"""File-based caching layer for platform metadata. This module provides a persistent cache for PlatformMetadata objects, avoiding regeneration of metadata for unchanged products. Cache entries are keyed by (product_id, platform) and support configurable TTL. Features: - File-based persistence using JSON storage ...
stkzlv/ContentEngineAI
src/ai/platform_metadata/cache.py
.py
6e09c88fa7bcdca9
7.42
6
"""Instagram-specific metadata generator. This module implements Instagram Reels optimization with dual caption styles (ultra-short or SEO-descriptive) and extensive hashtag strategy for maximum reach. """ import logging import re from pathlib import Path import aiohttp from src.ai.platform_metadata.base import Bas...
stkzlv/ContentEngineAI
src/ai/platform_metadata/instagram.py
.py
3a0c7affbc547d86
7.42
6
"""Platform-specific metadata models for YouTube, TikTok, and Instagram. This module defines data structures for platform-optimized metadata generation, including Pydantic configuration models and immutable metadata dataclasses. """ from dataclasses import dataclass, field from datetime import UTC, datetime from pyd...
stkzlv/ContentEngineAI
src/ai/platform_metadata/models.py
.py
20fef6135704bb1a
7.42
6
"""TikTok-specific metadata generator. This module implements TikTok search optimization with SEO-focused caption generation, niche hashtag selection, and validation against generic viral tags. """ import logging import re from pathlib import Path import aiohttp from src.ai.platform_metadata.base import BasePlatfor...
stkzlv/ContentEngineAI
src/ai/platform_metadata/tiktok.py
.py
3f60d267992500f8
7.42
6
"""Shared utilities for platform metadata generation. This module provides common helper functions for LLM-based metadata generation across all platforms. It wraps existing utilities from description_generator.py to reduce code duplication and provides high-level helpers for common patterns. """ import json import lo...
stkzlv/ContentEngineAI
src/ai/platform_metadata/utilities.py
.py
6d747d075c8bfba3
7.42
6
"""YouTube-specific metadata generator. This module implements YouTube Shorts optimization with SEO-focused title/description generation, strategic hashtag placement, and validation against YouTube's requirements. """ import logging import re from pathlib import Path import aiohttp from src.ai.platform_metadata.bas...
stkzlv/ContentEngineAI
src/ai/platform_metadata/youtube.py
.py
48c1972cbc49d8f3
7.42
6
"""Base abstractions for audio provider platform.""" from __future__ import annotations from abc import ABC, abstractmethod from dataclasses import dataclass, field from enum import Enum from pathlib import Path from typing import Any import aiohttp class AudioProvider(str, Enum): """Supported audio provider t...
stkzlv/ContentEngineAI
src/audio/base.py
.py
d2f1e8de9b6c2d9b
7.42
6
"""Registry and factory for audio providers.""" import logging from collections.abc import Callable from typing import Any from .base import AudioProvider, BaseAudioProvider logger = logging.getLogger(__name__) class AudioProviderRegistry: """Registry for audio provider implementations.""" _providers: dic...
stkzlv/ContentEngineAI
src/audio/registry.py
.py
199df15c438dafc0
7.42
6
# src/config_manager.py """Unified configuration manager for both video and scraper systems. This module provides a central entry point for configuration management during the migration from monolithic to modular configuration structure. It handles backward compatibility and provides a unified precedence system. """ ...
stkzlv/ContentEngineAI
src/config_manager.py
.py
7db260fcb87745fd
7.42
6
"""Vercel Blob retention: trim the upload store after publishing. Videos over the direct-upload limit are staged in the user's Vercel Blob store and fetched by the scheduling service when a post goes live. Nothing upstream deletes them, so the store grows until the free tier pauses access and large uploads start faili...
stkzlv/ContentEngineAI
src/publisher/blob_retention.py
.py
53464ad661d2fd12
7.42
6
"""Verify that first comments actually landed on published posts. Zernio accepts ``platformSpecificData.firstComment`` and reports the post published with no error, but the comment can silently fail to post on-platform. The ``posts.get`` response has no comment-delivery field. The platform inbox does: our first commen...
stkzlv/ContentEngineAI
src/publisher/comment_verify.py
.py
6ea02657cf31c12b
7.42
6
"""Build first-comment text for supported platforms. Moves affiliate links from post captions into the first comment, keeping descriptions clean and avoiding algorithm penalties on platforms that deprioritize posts with outbound links in captions. Not every platform can carry a link here. YouTube renders URLs in Shor...
stkzlv/ContentEngineAI
src/publisher/first_comment.py
.py
4557f1bcb78caf73
7.42
6
"""Abstract base class for link-in-bio providers.""" from abc import ABC, abstractmethod from pathlib import Path class BaseLinkInBioProvider(ABC): """Interface for link-in-bio services (Lnk.Bio, Linktree, etc.).""" @abstractmethod async def authenticate(self) -> bool: """Authenticate with the p...
stkzlv/ContentEngineAI
src/publisher/link_in_bio/base.py
.py
f1ed44b0adb0c841
7.42
6
"""Link-in-bio manager — orchestrates provider calls after publish.""" import json import logging from pathlib import Path from typing import TYPE_CHECKING from src.publisher.link_in_bio.base import BaseLinkInBioProvider if TYPE_CHECKING: from src.publisher.models import LinkInBioConfig logger = logging.getLogg...
stkzlv/ContentEngineAI
src/publisher/link_in_bio/manager.py
.py
0af9268e5cdaf3a8
7.42
6
#!/usr/bin/env python3 """Classify an AI system under the EU AI Act (Regulation 2024/1689). Walks through a question tree covering Article 5 (prohibited), Annex III (high-risk categories), limited-risk transparency obligations, and GPAI obligations. Outputs a classification, reasoning, and a next-step checklist for Is...
skills-il/security-compliance
israeli-ai-compliance-kit/scripts/classify_eu_ai_act_risk.py
.py
7d5d2b768a113cfe
7.52
10
#!/usr/bin/env python3 """ Shelter Finder Helper Looks up the Pikud Ha'Oref protection time (zman hitgonenut) for a locality and returns the matching sheltering guidance. The lookup table lives in scripts/protection_times.json, generated from Pikud Ha'Oref's own machine-readable district table: https://www.oref.org.i...
skills-il/security-compliance
israeli-shelter-guide/scripts/shelter_finder.py
.py
ba2a60c241b6e3e6
7.52
10
import os from logging.config import fileConfig from sqlalchemy import engine_from_config, pool from alembic import context # add your model's MetaData object here # for 'autogenerate' support # Import your models here to enable autogenerate from src.config import normalize_database_url from src.models import Base ...
Crossbill-App/crossbill-web
backend/alembic/env.py
.py
55dc3088d9678ba7
7.57
13
"""Remove file_path from books table. Revision ID: 002 Revises: 001 Create Date: 2025-11-09 10:30:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "002" down_revision: str | None = "001" branch_labels: str | ...
Crossbill-App/crossbill-web
backend/alembic/versions/002_remove_file_path_from_books.py
.py
0b22024f7cc79794
7.57
13
"""Add cover column to books table. Revision ID: 003 Revises: 002 Create Date: 2025-11-09 12:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "003" down_revision: str | None = "002" branch_labels: str | Se...
Crossbill-App/crossbill-web
backend/alembic/versions/003_add_cover_to_books.py
.py
d0e37d8933dc6ee0
7.57
13
"""Add deleted_at column to highlights table for soft deletes. Revision ID: 004 Revises: 003 Create Date: 2025-11-10 12:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "004" down_revision: str | None = "0...
Crossbill-App/crossbill-web
backend/alembic/versions/004_add_deleted_at_to_highlights.py
.py
a710c64d817e1cd8
7.57
13
"""Add full-text search support to highlights table. Revision ID: 005 Revises: 004 Create Date: 2025-11-10 12:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from sqlalchemy.dialects import postgresql from alembic import op # revision identifiers, used by Alembic. revision: str = "00...
Crossbill-App/crossbill-web
backend/alembic/versions/005_add_fulltext_search_to_highlights.py
.py
e1e32f82cc58dd69
7.57
13
"""Add chapter_number column to chapters table. Revision ID: 006 Revises: 005 Create Date: 2025-11-11 14:30:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "006" down_revision: str | None = "005" branch_labe...
Crossbill-App/crossbill-web
backend/alembic/versions/006_add_chapter_number_to_chapters.py
.py
92d06506f5c11380
7.57
13
"""Add tags table. Revision ID: 007 Revises: 006 Create Date: 2025-11-13 00:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "007" down_revision: str | None = "006" branch_labels: str | Sequence[str] | Non...
Crossbill-App/crossbill-web
backend/alembic/versions/007_add_tags_table.py
.py
41894873e0aa2171
7.57
13
"""Add book_tags join table for many-to-many relationship. Revision ID: 008 Revises: 007 Create Date: 2025-11-13 00:01:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "008" down_revision: str | None = "007" ...
Crossbill-App/crossbill-web
backend/alembic/versions/008_add_book_tags_join_table.py
.py
2a4f6d8a44e5506f
7.57
13
"""Add highlight_tags table. Revision ID: 009 Revises: 008 Create Date: 2025-11-14 00:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "009" down_revision: str | None = "008" branch_labels: str | Sequence[...
Crossbill-App/crossbill-web
backend/alembic/versions/009_add_highlight_tags_table.py
.py
f5dced9ac35b8242
7.57
13
"""Add highlight_highlight_tags join table for many-to-many relationship. Revision ID: 010 Revises: 009 Create Date: 2025-11-14 00:01:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "010" down_revision: str ...
Crossbill-App/crossbill-web
backend/alembic/versions/010_add_highlight_highlight_tags_join_table.py
.py
00e377d8eb399333
7.57
13
"""Add highlight_tag_groups table and tag_group_id to highlight_tags. Revision ID: 011 Revises: 010 Create Date: 2025-11-18 00:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "011" down_revision: str | No...
Crossbill-App/crossbill-web
backend/alembic/versions/011_add_highlight_tag_groups_table.py
.py
e6c0b8922b50f538
7.57
13
"""Add bookmarks table for tracking reading progress. Revision ID: 012 Revises: 011 Create Date: 2025-11-20 00:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "012" down_revision: str | None = "011" branc...
Crossbill-App/crossbill-web
backend/alembic/versions/012_add_bookmarks_table.py
.py
98a15771d4d1ce89
7.57
13
"""Add users table and associate existing data with admin user. Revision ID: 013 Revises: 012 Create Date: 2025-11-23 00:00:00.000000 """ import os from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "013" down_revision: str ...
Crossbill-App/crossbill-web
backend/alembic/versions/013_add_users_table.py
.py
e73bf36d5eb4b8fe
7.57
13
"""Add hashed_password column to users table. Revision ID: 014 Revises: 013 Create Date: 2025-11-23 00:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "014" down_revision: str | None = "013" branch_labels...
Crossbill-App/crossbill-web
backend/alembic/versions/014_add_hashed_password_to_users.py
.py
12f2b10638a563ae
7.57
13
"""Rename name column to email in users table Revision ID: 015 Revises: 014 Create Date: 2025-01-15 """ from collections.abc import Sequence from alembic import op # revision identifiers, used by Alembic. revision: str = "015" down_revision: str | None = "014" branch_labels: str | Sequence[str] | None = None depen...
Crossbill-App/crossbill-web
backend/alembic/versions/015_rename_name_to_email_in_users.py
.py
1c610d32e15102e2
7.57
13
"""Add content_hash column to highlights for hash-based deduplication. This migration: 1. Adds a content_hash column for hash-based highlight deduplication 2. Computes hashes for all existing highlights based on text + book_title + book_author 3. Removes duplicate highlights (keeping the oldest non-deleted one) 4. Rep...
Crossbill-App/crossbill-web
backend/alembic/versions/016_add_content_hash_to_highlights.py
.py
a2d246881ee3e6f8
7.57
13
"""Add content_hash column to books for hash-based deduplication. This migration: 1. Adds a content_hash column for hash-based book deduplication 2. Computes hashes for all existing books based on title + author 3. Removes duplicate books (keeping the oldest one and reassigning highlights) 4. Adds a unique constraint ...
Crossbill-App/crossbill-web
backend/alembic/versions/017_add_content_hash_to_books.py
.py
778e93e43413e6ab
7.57
13
"""Add last_viewed column to books for tracking recently viewed books. This migration adds a nullable last_viewed timestamp column to the books table. The column is updated whenever a user views a book's details. Revision ID: 018 Revises: 017 Create Date: 2025-12-17 """ from collections.abc import Sequence import ...
Crossbill-App/crossbill-web
backend/alembic/versions/018_add_last_viewed_to_books.py
.py
dbf3ddcc13d72a76
7.57
13
"""Add description column to books for storing book descriptions. This migration adds a nullable description text column to the books table. The description is extracted from KOReader ebook metadata during upload. Revision ID: 019 Revises: 018 Create Date: 2025-12-24 """ from collections.abc import Sequence import...
Crossbill-App/crossbill-web
backend/alembic/versions/019_add_description_to_books.py
.py
6dcf55dbf891cd7f
7.57
13
"""Add language and page_count columns to books for storing book metadata. This migration adds: - language: Language code from ebook metadata (e.g., 'en', 'de') - page_count: Total page count from ebook metadata Both columns are nullable as they may not be available for all ebooks. Revision ID: 020 Revises: 019 Crea...
Crossbill-App/crossbill-web
backend/alembic/versions/020_add_language_and_page_count_to_books.py
.py
5deb449f4cd1f1fa
7.57
13
"""Add flashcards table for study cards from highlights. Revision ID: 021 Revises: 020 Create Date: 2025-12-25 00:00:00.000000 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "021" down_revision: str | None = "020" br...
Crossbill-App/crossbill-web
backend/alembic/versions/021_add_flashcards_table.py
.py
7c7d765951ab1256
7.57
13
"""add_unique_constraint_to_user_email Revision ID: 022 Revises: 021 Create Date: 2025-12-27 10:33:29.894030 """ from collections.abc import Sequence from alembic import op # revision identifiers, used by Alembic. revision: str = "022" down_revision: str | Sequence[str] | None = "021" branch_labels: str | Sequence...
Crossbill-App/crossbill-web
backend/alembic/versions/022_add_unique_constraint_to_user_email.py
.py
66198ab5b4a80961
7.57
13
"""update_book_cover_urls_to_new_endpoint Revision ID: 023 Revises: 022 Create Date: 2025-12-27 11:01:56.841054 """ from collections.abc import Sequence from alembic import op # revision identifiers, used by Alembic. revision: str = "023" down_revision: str | Sequence[str] | None = "022" branch_labels: str | Seque...
Crossbill-App/crossbill-web
backend/alembic/versions/023_update_book_cover_urls_to_new_endpoint.py
.py
89618bd808732982
7.57
13
"""Add reading_sessions table for tracking reading sessions from KOReader. Revision ID: 024 Revises: 023 Create Date: 2026-01-05 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "024" down_revision: str | None = "023" ...
Crossbill-App/crossbill-web
backend/alembic/versions/024_add_reading_sessions_table.py
.py
1fddc3d13e7a1f32
7.57
13
"""Add epub_path column to books table. Revision ID: 025 Revises: 024 Create Date: 2026-01-07 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "025" down_revision: str | None = "024" branch_labels: str | Sequence[str] ...
Crossbill-App/crossbill-web
backend/alembic/versions/025_add_epub_path_to_books.py
.py
4eef7441b1fb3a86
7.57
13
"""Add client_book_id column to books table. Revision ID: 026 Revises: 025 Create Date: 2026-01-08 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision: str = "026" down_revision: str | None = "025" branch_labels: str | Sequence[...
Crossbill-App/crossbill-web
backend/alembic/versions/026_add_client_book_id_to_books.py
.py
30974fe9605ce667
7.57
13
"""Drop content_hash column from books table. The content_hash column is no longer needed as book deduplication is now handled using client_book_id. Revision ID: 028 Revises: 027 Create Date: 2026-01-08 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision identifiers...
Crossbill-App/crossbill-web
backend/alembic/versions/028_drop_content_hash_from_books.py
.py
6c525916bc60a3f2
7.57
13
"""Add start_xpoint and end_xpoint columns to highlights table. These columns store the XML position of highlights in EPUB documents, allowing precise location of highlighted text. Revision ID: 029 Revises: 028 Create Date: 2026-01-09 """ from collections.abc import Sequence import sqlalchemy as sa from alembic i...
Crossbill-App/crossbill-web
backend/alembic/versions/029_add_xpoint_columns_to_highlights.py
.py
6fdd556709a50557
7.57
13
"""Add ai_summary column to reading_sessions table. This column stores AI-generated summaries of reading session content, enabling quick access to summaries without regenerating them. Revision ID: 030 Revises: 029 Create Date: 2026-01-12 """ from collections.abc import Sequence import sqlalchemy as sa from alembi...
Crossbill-App/crossbill-web
backend/alembic/versions/030_add_ai_summary_to_reading_sessions.py
.py
e2eda6f1ef9ff49f
7.57
13
"""Add reading_session_highlights join table and indexes for efficient matching. Revision ID: 031 Revises: 030 Create Date: 2026-01-19 This migration creates: 1. reading_session_highlights - Many-to-many join table between reading_sessions and highlights 2. Composite index on highlights(user_id, book_id, page) for ef...
Crossbill-App/crossbill-web
backend/alembic/versions/031_add_reading_session_highlights_join_table.py
.py
e6ed224447671684
7.57
13
"""Add parent_id to chapters for hierarchical structure. Revision ID: 032 Revises: 031 Create Date: 2026-01-24 This migration adds a self-referential foreign key to support hierarchical chapter structures (e.g., parts, sections, subsections in EPUB TOC). """ from collections.abc import Sequence import sqlalchemy as...
Crossbill-App/crossbill-web
backend/alembic/versions/032_add_parent_to_chapters.py
.py
b9a75108e9e99577
7.57
13
"""Allow duplicate chapter names at different hierarchy levels. Revision ID: 033 Revises: 032 Create Date: 2026-01-24 Changes the unique constraint from (book_id, name) to (book_id, parent_id, name) to allow chapters with the same name under different parent chapters. Example: Both "Harjoitukset" under Part I and "H...
Crossbill-App/crossbill-web
backend/alembic/versions/033_allow_duplicate_chapter_names_at_different_levels.py
.py
d75fb352ce95bc89
7.57
13
"""Reset Epub paths to NULL for all books Revision ID: 034 Revises: 033 Create Date: 2026-01-24 18:37:00.388656 Resets all books epub_paths to NULL to force Koreader to reupload epub files so that the chapter structure will be parsed from the ebooks. Note that this will break the UI of the reading sessions until new...
Crossbill-App/crossbill-web
backend/alembic/versions/034_reset_epub_paths_to_null.py
.py
0b00d2a0dd68c1b6
7.57
13
"""rename epub_path to file_path and add file_type Revision ID: 035 Revises: 034 Create Date: 2026-01-25 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "035" down_revision = "034" branch_labels = None depends_on = None def upgrade() -> None: # Add file_...
Crossbill-App/crossbill-web
backend/alembic/versions/035_rename_epub_path_add_file_type.py
.py
7c60bffce613c98e
7.57
13
"""scope highlight deduplication by book Revision ID: 036 Revises: 035 Create Date: 2026-01-29 """ from alembic import op # revision identifiers, used by Alembic. revision = "036" down_revision = "035" branch_labels = None depends_on = None def upgrade() -> None: """ Update unique constraint to scope dedu...
Crossbill-App/crossbill-web
backend/alembic/versions/036_scope_highlight_deduplication_by_book.py
.py
e87449977d8d323e
7.57
13
"""Recalculate content hashes for highlights and reading_sessions. This migration recalculates content_hash values to match the current hash calculation logic in the domain entities: - Highlights: SHA256(text) - simplified from previous logic - Reading Sessions: SHA256(book_id|user_id|start_time|device_id or '') Thi...
Crossbill-App/crossbill-web
backend/alembic/versions/037_recalculate_content_hashes.py
.py
f26ff8c0803affa5
7.57
13
"""add chapter prereading contents and xpoints Revision ID: 038 Revises: 037 Create Date: 2026-02-07 """ from collections.abc import Sequence import sqlalchemy as sa from sqlalchemy.dialects import postgresql from alembic import op # revision identifiers, used by Alembic. revision: str = "038" down_revision: str ...
Crossbill-App/crossbill-web
backend/alembic/versions/038_add_chapter_prereading_contents_and_xpoints.py
.py
b67f3394b86781f8
7.57
13
"""Add position columns to highlights, reading_sessions, and chapters. Revision ID: 040 Revises: 249c9ffd1b90 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "040" down_revision: str | Sequence[str] | None = "038" branch_labels: str | Sequence[str] | None = N...
Crossbill-App/crossbill-web
backend/alembic/versions/040_add_position_columns.py
.py
27acd09ec12fd26d
7.57
13
"""Add chapter_id column to flashcards table. Revision ID: 042 Revises: 041 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "042" down_revision: str | Sequence[str] | None = "041" branch_labels: str | Sequence[str] | None = None depends_on: str | Sequence[str...
Crossbill-App/crossbill-web
backend/alembic/versions/042_add_chapter_id_to_flashcards.py
.py
9c397aa0002e3a16
7.57
13