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 |
|---|---|---|---|---|---|---|
"""HTTP Basic auth.
Only one provider needs this so far (MySportsFeeds), but it is a standard scheme and
the alternative is asking users to base64-encode a credential pair by hand and paste it
into an env var — which is both unpleasant and impossible to validate, since a
mis-encoded string is indistinguishable from a ... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/auth/basic.py | .py | 787b58d6ddc3ad68 | 7.48 | 8 |
"""Static-header auth (literal value, env var, or config `secrets` block)."""
from __future__ import annotations
import os
from ..errors import AuthMissingError
from ..spec import AuthStaticHeader
class StaticHeaderAuthProvider:
def __init__(self, spec: AuthStaticHeader, secrets: dict[str, str] | None = None) ... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/auth/header.py | .py | 0e3a1d500079c6e8 | 7.48 | 8 |
"""Kalshi RSA request signing — the OPTIONAL authenticated tier.
Kalshi market data is public; an API key (key id + RSA private key) only raises
rate limits. So unlike every other scheme, missing credentials are NOT an error:
the signer constructs in *inactive* mode and signs nothing, leaving requests
anonymous. When ... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/auth/kalshi.py | .py | 2bffbaab7fe33117 | 7.48 | 8 |
"""Static query-parameter auth (literal value, env var, or config `secrets` block).
For APIs that authenticate with a query parameter rather than a header — e.g. Data
Golf's `?key=`. The value is resolved the same way as static_header (env preferred,
then the config `secrets` block), so a personal/secret key never liv... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/auth/query.py | .py | 052936346ee10cd9 | 7.48 | 8 |
"""Apply spec-declared `classify` blocks to a fetched response.
This is the one place the engine deviates from pure passthrough — and only when an
endpoint opts in with a `classify` block. The deviation is deliberately minimal:
it *adds* a derived tag onto each item of a list, computed from that same item's
own source... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/classify.py | .py | 9d8edc04641a68b6 | 7.48 | 8 |
"""Config resolution: CLI flag > env var > cwd file > user config dir > defaults."""
from __future__ import annotations
import os
from dataclasses import dataclass, field
from pathlib import Path
import yaml
# No response-size cap by default (0 = unlimited). A positive value can still be set
# per provider (provide... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/config.py | .py | c650f82924dfdbf7 | 7.48 | 8 |
"""`sportsdata-mcp coverage` — what actually works from where the user is.
This is deliberately not `doctor`. Doctor is a contract check for maintainers and CI: it
probes every endpoint of every enabled group, goes red on drift, and prints a wall of
URLs. Answering "will this be any use to me?" with that output is lik... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/coverage.py | .py | 8a123b77853fd9a3 | 7.48 | 8 |
"""Relative-date tokens for spec examples.
An example like::
params: {eventDate: "2026-07-02"}
is wrong the moment it is written, and gets more wrong every day. Two things break:
1. **The nightly drift check.** Sportsbet returns HTTP 400 for a racing date five weeks
in the past, so the probe fails and th... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/dates.py | .py | 1fb21babeeb0e0e8 | 7.48 | 8 |
"""Apollo persisted-query dispatcher.
One tool calls any of a provider's persisted GraphQL operations by name. Hashes
are stored server-side in the spec's `graphql.operations` block; the model only
ever supplies an operation name + variables (discovered via the catalogue resource).
Gateways keep APQ registrations in ... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/dispatchers/graphql_persisted.py | .py | be689da64cb32c47 | 7.48 | 8 |
"""Full-query GraphQL dispatcher.
One tool calls any of a provider's GraphQL operations by name. Unlike the
persisted-query dispatcher (which sends a server-stored sha256 hash), this sends
the **literal query text** baked into the spec's ``graphql.operations`` block —
the pattern used by APIs like FanDuel Racing that ... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/dispatchers/graphql_query.py | .py | 9b109f8573695b93 | 7.48 | 8 |
"""Templated-REST dispatcher.
One tool serves a family of parametric REST paths that share a base URL + auth
(e.g. AFL CFS premium, AFL StatsPro). The model supplies an operation name plus
path/query param maps; the catalogue resource lists valid operations.
"""
from __future__ import annotations
import inspect
from... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/dispatchers/templated_rest.py | .py | decb689cbb5975e0 | 7.48 | 8 |
"""DNS-over-HTTPS resolution for providers whose hostnames a network poisons.
Some networks (an ISP or router) return a dead sinkhole IP for a lawful host —
observed live: every ``*.polymarket.com`` name resolving to one unreachable
Azure IP while Google/Cloudflare DNS return the real Cloudflare edge. This
module reso... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/dns.py | .py | 6fe60db8049ef729 | 7.48 | 8 |
"""`sportsdata-mcp doctor` — per-provider reachability + auth + REST contract check.
For every enabled group, doctor mints any required auth token and probes one
representative endpoint, reporting OK / FAIL / SKIP. Because REST providers have
no hash-style drift detector, this is the intended periodic check: a previou... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/doctor.py | .py | cfec052905fab03c | 7.48 | 8 |
"""Error types surfaced to the MCP client."""
from __future__ import annotations
class ToolError(Exception):
"""Base error returned to the MCP client.
`recoverable=True` signals to the model that retrying with different args
(e.g. a valid operation name from the catalogue resource) may succeed.
"""
... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/errors.py | .py | 1a4164ef4989c936 | 7.48 | 8 |
"""Spec-declared, REDUCTIVE response projection.
The engine is a passthrough by design, and this is the second declared exception after
`classify` — but where `classify` *adds* a derived tag, this only ever *removes*. It
cannot invent a value, rename one, or reorder anything: whatever survives is byte-for-byte
what th... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/project.py | .py | 4cccf8a53effe493 | 7.48 | 8 |
"""Keep credentials out of the logs.
Seven providers in this catalogue authenticate with a **query parameter** — Data Golf's
`?key=`, The Odds API's `?apiKey=`, CricketData's `?apikey=`, Sportmonks' `?api_token=`,
iSportsAPI's `?api_key=`, Entity Sport's `?token=`, Odds-API.io's `?apiKey=`. That means
the secret is pa... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/redact.py | .py | 95e1129a639aecd8 | 7.48 | 8 |
"""Refresh persisted-query sha256 hashes from a provider's deployed JS bundle.
Entain's gateway keeps APQ registrations in an evictable cache, and an APQ pair
only has to be self-consistent (``sha256Hash == sha256(query)``) — it does not
have to match the hash precomputed in the JS bundle's manifest. So instead of
tru... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/refresh/entain_hashes.py | .py | 0fade00ce44c25d3 | 7.48 | 8 |
"""Spec → MCP resource registrations.
Three categories:
1. Capability catalogue — sportsdata://capabilities (always registered)
2. Dispatcher catalogues — one per dispatcher (operation lists, no hashes)
3. Reference data — small static lookup tables, lazily populated + cached
"""
from __future__ impo... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/resources/builders.py | .py | e0a81260a5aa1395 | 7.48 | 8 |
"""Self-register the MCP into an AI client's config — the "set it up for me" generator
(commerce Phase 3). Given a licence key it writes the ``mcpServers`` block into Claude
Desktop / Cursor, preserving any other servers, pointing ``command`` at this binary (the
bundled installer binary when frozen, otherwise the ``spo... | DanielTomaro13/sportsdata-mcp | src/sportsdata_mcp/setup_client.py | .py | fb1b62f52e76f131 | 7.48 | 8 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/appcompat_html.py | .py | dab56dd39652a1e6 | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/binder.py | .py | b8aa6fc959cf8450 | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/adapters/compile_db.py | .py | 2afa7d30cff33bea | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | abicheck/abicheck | abicheck/buildsource/baseline_publish.py | .py | 9248b11ecf24ee52 | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/build_cache.py | .py | 9c2b22310162492c | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/comdat_groups.py | .py | cfa480ece615b76a | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/compiler_record.py | .py | 2680fc82d9d8a028 | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/crosscheck_base.py | .py | 3f02dc2bfe7e3401 | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/entity_identity.py | .py | 247f578806cd0f7c | 7.5 | 9 |
# Copyright 2026 Nikolay Petrov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | abicheck/abicheck | abicheck/buildsource/entity_resolver.py | .py | 3964b62b53a0cdf2 | 7.5 | 9 |
#!/usr/bin/env python3
"""
Sparkstation Config Linter
Validates models.yaml for correctness, consistency, and resource feasibility.
"""
import argparse
import json
import os
import sys
from pathlib import Path
# Try to import yaml, fallback to manual parsing
try:
import yaml
HAS_YAML = True
except ImportErro... | kshetrajna12/sparkstation | .pi/skills/sparkstation-config-lint/scripts/lint.py | .py | f43754e3b1e1f304 | 7.42 | 6 |
#!/usr/bin/env python3
"""
Sparkstation Log Analyst
Parses log files and extracts structured events, patterns, and anomalies.
"""
import argparse
import collections
import json
import os
import re
import sys
from datetime import datetime, timedelta
from pathlib import Path
LOG_DIR = Path(os.environ.get("SPARKSTATION... | kshetrajna12/sparkstation | .pi/skills/sparkstation-log-analyst/scripts/analyze.py | .py | dc86524ab5c17ff2 | 7.42 | 6 |
#!/usr/bin/env python3
"""
Sparkstation Memory Profiler
Measures actual GPU/process memory per model container and compares
to declared memory_gb in models.yaml.
"""
import argparse
import json
import os
import re
import subprocess
import sys
import urllib.error
import urllib.request
from pathlib import Path
SUPERVI... | kshetrajna12/sparkstation | .pi/skills/sparkstation-profile-memory/scripts/profile_memory.py | .py | 91d0d59c2945c42c | 7.42 | 6 |
#!/usr/bin/env python3
"""
Sparkstation Security Audit
Reviews configuration, runtime, and deployment for security issues.
"""
import argparse
import json
import os
import re
import stat
import subprocess
import sys
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent.parent.parent
... | kshetrajna12/sparkstation | .pi/skills/sparkstation-security-audit/scripts/audit.py | .py | 0156541440604428 | 7.42 | 6 |
#!/usr/bin/env python3
"""
CLIP embedding server using HuggingFace Transformers.
Provides OpenAI-compatible /v1/embeddings endpoint for both text and images.
"""
import base64
import io
import logging
import os
import time
from typing import List, Optional, Union
import torch
from fastapi import FastAPI, HTTPException... | kshetrajna12/sparkstation | docker/clip/server.py | .py | bf9f5085128fa6dc | 7.42 | 6 |
#!/usr/bin/env python3
"""
Simple FLUX.1-dev image generation server using Diffusers.
Provides OpenAI-compatible /v1/images/generations endpoint.
"""
import base64
import io
import logging
import os
import time
from typing import Optional
import torch
from diffusers import FluxPipeline
from fastapi import FastAPI, HTT... | kshetrajna12/sparkstation | docker/flux/server.py | .py | 814062a198c96c2a | 7.42 | 6 |
"""
Sparkstation gateway proxy — engine-agnostic request metrics + model lifecycle
smoothing, in front of LiteLLM.
Why this exists:
- Request rate / latency / TTFT are measured HERE, at the OpenAI-API boundary,
so the Grafana request panels work identically whether a model is served by
vLLM, SGLang, TensorRT-LLM, ... | kshetrajna12/sparkstation | gateway/proxy.py | .py | cd97f064bbfe321d | 7.42 | 6 |
#!/usr/bin/env python3
"""
Daily maintenance script for Sparkstation.
Performs automated cleanup and health checks:
- Cleans up old log files
- Vacuums SQLite database
- Detects stale/zombie models
- Checks for port leaks
- Generates resource usage report
Usage:
python scripts/maintenance.py [--dry-run] [--verbos... | kshetrajna12/sparkstation | scripts/maintenance.py | .py | e590881930e31391 | 7.42 | 6 |
"""
API key authentication for Supervisor endpoints.
Implements X-API-Key header validation with configurable enforcement.
"""
import hmac
import logging
from typing import Optional
from fastapi import Request, HTTPException, status
from fastapi.security import APIKeyHeader
from supervisor.config import settings
lo... | kshetrajna12/sparkstation | supervisor/auth.py | .py | ba6f29b19a67c1ef | 7.42 | 6 |
"""
Shared helpers for cluster-aware operations.
Every launcher (vllm, sglang, clip, face, species, flux) and the registry's
reconcile loop needs to talk to a specific host's Docker daemon and build URLs
that the gateway can reach. Rather than duplicate the `os.environ.copy();
env['DOCKER_HOST'] = ...` boilerplate eve... | kshetrajna12/sparkstation | supervisor/cluster_helpers.py | .py | 1f29d7cb1d5432bd | 7.42 | 6 |
"""
Centralized error handling for Sparkstation Supervisor.
Provides custom exceptions and error response formatting.
"""
from typing import Optional, Dict, Any
from fastapi import HTTPException, status
class SparkstationError(Exception):
"""Base exception for Sparkstation errors."""
def __init__(
s... | kshetrajna12/sparkstation | supervisor/errors.py | .py | c6fcbec5951e01b1 | 7.42 | 6 |
"""
CLIP launcher for image and text embeddings.
"""
import asyncio
import logging
import subprocess
from datetime import datetime
from pathlib import Path
import httpx
from supervisor.launchers.base import ModelLauncher, LaunchError
from supervisor.models import ModelConfig, ModelInstance, ModelStatus, HealthStatus, ... | kshetrajna12/sparkstation | supervisor/launchers/clip_launcher.py | .py | c01220832b9b5260 | 7.42 | 6 |
"""
Factory for creating model launchers based on backend type.
"""
from supervisor.launchers.base import ModelLauncher
from supervisor.launchers.vllm_launcher import VLLMLauncher
from supervisor.launchers.sglang_launcher import SGLangLauncher
from supervisor.launchers.flux_launcher import FluxLauncher
from supervisor.... | kshetrajna12/sparkstation | supervisor/launchers/factory.py | .py | 0c47c90364523174 | 7.42 | 6 |
"""
FLUX launcher for image generation with FLUX.1-dev.
"""
import asyncio
import logging
import os
import subprocess
from datetime import datetime
from pathlib import Path
from typing import Optional
import httpx
from supervisor.launchers.base import ModelLauncher, LaunchError
from supervisor.models import ModelConfig... | kshetrajna12/sparkstation | supervisor/launchers/flux_launcher.py | .py | a56c19905ce03563 | 7.42 | 6 |
"""
Pre-launch host-memory headroom check for docker-based launchers.
DGX Spark has unified CPU+GPU memory: a model container that overcommits
it does not fail fast — it OOM-kills mid weight-load, or starves the OS
and wedges the whole node (2026-08-18: a 0.88 mem-fraction-static on
worker1 hung the machine; recovery ... | kshetrajna12/sparkstation | supervisor/launchers/host_memory.py | .py | 4e53831405611438 | 7.42 | 6 |
"""
SGLang launcher for DGX Spark with embeddings support.
"""
import asyncio
import logging
import subprocess
from datetime import datetime
from pathlib import Path
from typing import Optional
import httpx
from supervisor.launchers.base import ModelLauncher, LaunchError
from supervisor.launchers.host_memory import che... | kshetrajna12/sparkstation | supervisor/launchers/sglang_launcher.py | .py | 230ea05089b18e0f | 7.42 | 6 |
"""
Species detection launcher for wildlife species identification.
Ensemble: MegaDetector v5a + SpeciesNet + iNat21 ViT-L/14.
"""
import asyncio
import logging
import subprocess
from datetime import datetime
from pathlib import Path
import httpx
from supervisor.launchers.base import ModelLauncher, LaunchError
from su... | kshetrajna12/sparkstation | supervisor/launchers/species_launcher.py | .py | db13ec7cff027fb6 | 7.92 | 6 |
import contextlib
import csv
import io
import time
from pathlib import Path
import httpx
from rich.progress import Progress
from .config import Config
from .db import Database
from .geo import haversine_km
from .models import AirportMatch
__all__ = ["haversine_km", "fetch_ourairports_csv", "download_airports", "enri... | frankea/adsbtrack | adsbtrack/airports.py | .py | 66a45b610b3fdd2c | 7.52 | 10 |
"""Spherical-earth geographic helpers shared across modules.
Consolidates haversine distance, initial bearing, smallest-angle-between-
bearings, and destination-point math so no module has to reimplement
them or reach for a leading-underscore name across module boundaries.
"""
from __future__ import annotations
impo... | frankea/adsbtrack | adsbtrack/geo.py | .py | e6e3b7d218813bf2 | 7.52 | 10 |
"""Helipad discovery via DBSCAN clustering on off-airport flight coordinates.
v7 F1: clusters confirmed takeoff/landing coordinates that are > 2 km from
any airport (i.e., origin_icao IS NULL) to identify repeat-use helipads,
offshore platforms, and hospital pads.
Uses a pure-Python DBSCAN implementation with haversi... | frankea/adsbtrack | adsbtrack/helipads.py | .py | 38dcdd9805bf9aca | 7.52 | 10 |
"""Geometric ILS-alignment detector.
For each runway end at a candidate landing airport, compute per-trace-point
the bearing to the runway threshold and the perpendicular offset from the
extended centerline, then collect contiguous segments of points that are
* within ``max_offset_m`` of the centerline
* moving t... | frankea/adsbtrack | adsbtrack/ils_alignment.py | .py | 729e17e4a180f54b | 7.52 | 10 |
"""Landing airport-matching anchor selection.
When picking which airport a flight was headed for, the "last observed
point" is often a poor proxy: on signal-loss / dropped-on-approach
flights the aircraft may have drifted laterally or climbed back up after
a missed approach. The altitude minimum within the final N min... | frankea/adsbtrack | adsbtrack/landing_anchor.py | .py | 0419955751be3d34 | 7.52 | 10 |
"""Universal aircraft identity lookup (issue #27).
`adsbtrack lookup <hex|registration>` answers hex <-> registration <->
type <-> operator for any country, not just FAA-registered aircraft.
Resolution order:
1. Local first: the hex_crossref cache, then the FAA registry /
Mictronics merge via :func:`hex_crossref.... | frankea/adsbtrack | adsbtrack/lookup.py | .py | f727dd1de3882820 | 7.52 | 10 |
"""METAR/SPECI history client for aviationweather.gov (issue #26).
Diversion and go-around forensics almost always need the destination
weather around the event (OMAA CAVOK during a divert, KTYS microburst
during a go-around). This module fetches METAR/SPECI observations from
the free aviationweather.gov data API and ... | frankea/adsbtrack | adsbtrack/metar.py | .py | 8b733f1fd1bebd81 | 7.52 | 10 |
"""Military ICAO hex allocation ranges and lookup helpers.
The ICAO 24-bit aircraft address scheme assigns blocks to member states;
many states reserve a sub-block for military use. The official mapping
is not published publicly so this module ships a curated starter set
based on community-compiled sources (Mictronics... | frankea/adsbtrack | adsbtrack/mil_hex.py | .py | 680f468bb994ab9d | 7.52 | 10 |
"""Geometric navaid-alignment detector.
For each candidate navaid (pre-filtered by bbox to keep cost bounded) the
algorithm walks the flight's point stream and keeps every point whose
bearing-to-navaid lies within a degree or so of the ground track, subject to
a maximum range. Kept points are split into segments on lo... | frankea/adsbtrack | adsbtrack/navaid_alignment.py | .py | 414acfea15dbf4e0 | 7.52 | 10 |
"""OurAirports navaids.csv ingestion + bounding-box query helper.
Attribution: the per-flight alignment algorithm that consumes this table
(see adsbtrack/navaid_alignment.py) is inspired by xoolive/traffic's
BeaconTrackBearingAlignment (MIT-licensed). No code is copied from
traffic; this module only handles I/O and ta... | frankea/adsbtrack | adsbtrack/navaids.py | .py | 84462f02ad6c1cf4 | 7.52 | 10 |
"""Convert FAA N-numbers (tail numbers) to ICAO hex codes.
US aircraft ICAO addresses range from 0xA00001 to 0xADF7C7.
N-numbers follow the format N[1-9][0-9]{0,4}[A-Z]{0,2} where letters
I and O are excluded from suffixes. The total length after N is at most 5
characters (digits + letters combined).
The encoding use... | frankea/adsbtrack | adsbtrack/nnumber.py | .py | 943c38ac6a7552c9 | 7.52 | 10 |
"""Live callsign -> hex resolution (issue #29).
Everything in adsbtrack is hex-keyed; when casework starts from a
callsign / flight number there was no in-tool path to the airframe.
`adsbtrack resolve <callsign>` asks the open live-traffic APIs
(api.adsb.lol, then opendata.adsb.fi) which airframes are broadcasting
tha... | frankea/adsbtrack | adsbtrack/resolve.py | .py | a5cc5ed0dd683cb1 | 7.52 | 10 |
"""OurAirports runway ingestion.
Downloads `runways.csv` from OurAirports, parses rows into one tuple per
runway end (so "09" and "27" become two rows), and upserts into the local
`runways` table. Idempotent on re-run - repeated refreshes of the same
airport overwrite existing rows without duplicating.
OurAirports us... | frankea/adsbtrack | adsbtrack/runways.py | .py | f18bd2bf1ab6a3e8 | 7.52 | 10 |
"""Solar-position math for day/night classification.
Pure NOAA solar-position approximation, no external dependencies.
The core function is ``solar_altitude_deg(dt_utc, lat, lon)`` which returns
the sun's altitude angle in degrees above the horizon at the given UTC time
and observer coordinates. Night is any time the... | frankea/adsbtrack | adsbtrack/solar.py | .py | 413d8e15d7935bde | 7.52 | 10 |
"""Polygon-based takeoff runway identification.
For each runway end at a known origin airport, build a trapezoid polygon:
a narrow base at the runway threshold, extending ``zone_length_m`` outward
along the departure heading, opening symmetrically by ``opening_deg``.
Filter the flight's first-600-s trace window to poi... | frankea/adsbtrack | adsbtrack/takeoff_runway.py | .py | ab87f55af69cda9c | 7.52 | 10 |
"""Main Textual application for the adsbtrack TUI.
Architecture note. The whole app runs inside a single Screen that owns
a persistent 4-part layout (status strip on top, sidebar on the left,
content pane on the right, action bar at the bottom). The content
pane is a ``ContentSwitcher`` hosting every view as a sibling... | frankea/adsbtrack | adsbtrack/tui/app.py | .py | 9a259d31c51b6e45 | 7.52 | 10 |
"""Tiny braille-canvas for the TUI map view.
Each Unicode braille character (U+2800-U+28FF) encodes a 2x4 dot grid,
which gives the terminal-mode map roughly 8x the effective resolution
of a one-char-per-cell scatter plot. The canvas draws connected line
segments between consecutive trace points (Bresenham), so at-a-g... | frankea/adsbtrack | adsbtrack/tui/braille.py | .py | 4780924be1b76bf3 | 7.52 | 10 |
"""Aircraft list view: filterable table keyed on ICAO hex."""
from __future__ import annotations
from collections.abc import Sequence
from rich.text import Text
from textual import work
from textual.app import ComposeResult
from textual.containers import Vertical
from textual.message import Message
from textual.widg... | frankea/adsbtrack | adsbtrack/tui/views/aircraft.py | .py | 1591dfe7b444b7e3 | 7.52 | 10 |
"""Event feed view: unified chronological stream across event types."""
from __future__ import annotations
from collections.abc import Iterable
from dataclasses import dataclass
from typing import Any
from rich.text import Text
from textual import work
from textual.app import ComposeResult
from textual.containers im... | frankea/adsbtrack | adsbtrack/tui/views/events.py | .py | 9d5290f3c19cb65b | 7.52 | 10 |
"""Flight timeline view: flights for a single aircraft."""
from __future__ import annotations
import re
from collections.abc import Sequence
from dataclasses import dataclass
from rich.text import Text
from textual import work
from textual.app import ComposeResult
from textual.binding import Binding
from textual.con... | frankea/adsbtrack | adsbtrack/tui/views/flights.py | .py | f2cd9b7c64c1bdb8 | 7.52 | 10 |
"""Jump-to-hex modal screen.
Opens over the whole app when the user presses `:` and searches the
current DB for aircraft by ICAO hex, registration, type code, or
description. Pressing Enter on the highlighted match posts an
``AircraftOpenFlights`` message to the parent app which navigates to
the flight timeline for th... | frankea/adsbtrack | adsbtrack/tui/views/jump.py | .py | e9e99b63af38cb4e | 7.52 | 10 |
"""Spoofed-broadcasts audit view."""
from __future__ import annotations
import json
from rich.text import Text
from textual.app import ComposeResult
from textual.containers import Vertical
from textual.widgets import DataTable, Input, Static
from ..queries import SpoofedBroadcast, list_spoofed_broadcasts
from ..wid... | frankea/adsbtrack | adsbtrack/tui/views/spoof.py | .py | f964545018d8e251 | 7.52 | 10 |
"""Per-aircraft status dashboard (card-grid style).
Mirrors the layout in ``design/ui_kits/tui/index.html``: four stat
cards across the top, two wide "bar chart" cards for position-source
mix and mission mix, an Indicators card and a Signal-quality card
side by side, and a wide FAA-registry card at the bottom.
The sn... | frankea/adsbtrack | adsbtrack/tui/views/status.py | .py | c938ec2b9cc1f8f1 | 7.52 | 10 |
"""AccuWeather combined feed generator.
One Atom feed (``feeds/feed_accuweather.xml``) from three AccuWeather surfaces,
each fetched independently so one failing source never sinks the run:
* News https://www.accuweather.com/en/weather-news (and every other
editorial category: space-news, climat... | trvny/feedseek | feed_generators/accuweather.py | .py | bb32a7906972e2a9 | 7.42 | 6 |
"""AI-bridge feed: one combined Atom stream of AI labs and newsletters.
Native RSS sources: Thinking Machines, Ollama, Mistral, Interconnected
(Matt Webb), AI Clock (Substack), the Polish AI blogs Bielik, Promptowy and
Maistry, and Stability AI (news-updates, via the
Squarespace ?format=rss trick — see note below). On... | trvny/feedseek | feed_generators/aibridge.py | .py | d4dedae2c5233c28 | 7.42 | 6 |
"""Anthropic feed generator.
Aggregates Anthropic's three article streams into one **Atom** feed written to
``feeds/feed_anthropic.xml``:
- Anthropic Newsroom https://www.anthropic.com/news
- Anthropic Research https://www.anthropic.com/research
- Anthropic Engineering https://www.anthropic.co... | trvny/feedseek | feed_generators/anthropic.py | .py | 54e08ac614122c07 | 7.42 | 6 |
"""Apple feed: combined Atom from Apple Newsroom, Developer news/releases,
developer-documentation release notes, and Technotes.
Sources:
* Apple Newsroom PL (apple.com/pl/newsroom) — native Atom
* Apple Developer News (developer.apple.com/news) — native RSS
* Apple Developer Releases (developer.apple.com/news/r... | trvny/feedseek | feed_generators/apple.py | .py | 63ba7e1450403c34 | 7.42 | 6 |
"""Find an article's own image when the feed it came from shipped none.
Measured on 11.08.2026 across the 90 published feeds: **14 138 of 18 347
entries (77%) carried no image at all** - no media:content, no media:thumbnail,
no enclosure - so readers render them as a wall of text. 55 of the 82 worst
feeds run through ... | trvny/feedseek | feed_generators/article_image.py | .py | 541cb2f538355e46 | 7.42 | 6 |
"""Audio.com.pl feed: the Polish hi-fi / hi-end / home-cinema portal.
The site publishes one native RSS feed at ``/rss`` (300 items) plus a ``/testy``
section that the feed never touches. Both need help before they are usable:
* ``/rss`` carries **no ``<pubDate>`` at all**, and its ``?dzial=`` parameter
is igno... | trvny/feedseek | feed_generators/audio.py | .py | f458a8ec1dc54b31 | 7.42 | 6 |
"""Beatport Top 100 feed generator.
Beatport's Top 100 page (https://www.beatport.com/top-100) is a Next.js app
with no native RSS/Atom feed, but the full 100-track chart is embedded in the
page's ``__NEXT_DATA__`` JSON blob — so a plain ``requests`` fetch is enough
(no Selenium needed).
The chart is a *ranking* that... | trvny/feedseek | feed_generators/beatport_top100.py | .py | 364f01eb8f352b38 | 7.42 | 6 |
"""Canva combined feed generator.
Canva has no native RSS/Atom feed. Both source pages used to be reachable via
a ``curl_cffi`` Chrome-impersonated fetch of their ``__NEXT_DATA__`` blob, but
canva.com now serves an active Cloudflare interactive challenge
(``cf-mitigated: challenge``) to that fetch too — a JS challenge... | trvny/feedseek | feed_generators/canva.py | .py | 676f22e3563ccfaa | 7.42 | 6 |
"""Cloudflare feed: combined Atom from Cloudflare's native RSS feeds — the
Cloudflare Blog, the developer Changelog, and the Community top topics — plus a
scraper for Cloudflare Research publications, which have no native feed.
The native feed sources are handled by the shared :mod:`multi_rss` pipeline. The
Research s... | trvny/feedseek | feed_generators/cloudflare.py | .py | 80836eb5f57fc378 | 7.42 | 6 |
"""Generate Atom feed for Czwórka — Polskie Radio
(https://czworka.online/).
Czwórka runs on Polskie Radio's classic server-rendered ASP.NET CMS. The
homepage is fully static (no Selenium needed), but it's built almost entirely
from dateless promo carousels, and card titles have category labels glued on
("KulturaRuszy... | trvny/feedseek | feed_generators/czworka.py | .py | 423d78efc1e84b79 | 7.42 | 6 |
"""Daily quote feed generator.
Emits one quote per day as an Atom entry, drawn from a curated ``quotes.json``
list (a GitHub gist of ``{quote, author}`` objects). The pick is deterministic
per calendar day — seeded by the UTC date — so every reader sees the same quote
on a given day and the feed gains exactly one new ... | trvny/feedseek | feed_generators/daily_quote.py | .py | 45721261f3f96dbc | 7.42 | 6 |
#!/usr/bin/env python3
"""Discover RSS/Atom/JSON feed candidates for a site.
Manual scouting tool, not part of the hourly generator pipeline. Use this
when adding a new source to feeds.yaml, to find native feed URLs before
reaching for a scraper.
Usage:
uv run feed_generators/discover.py <url>
Tries the local fe... | trvny/feedseek | feed_generators/discover.py | .py | 2e64b8184de89407 | 7.42 | 6 |
"""Docker feed: combined Atom from Docker's native blog RSS plus scrapers for
the Docker docs release-notes pages, which have no native feed.
The blog (``https://www.docker.com/feed/``) is a real WordPress RSS feed and is
handled by the shared :mod:`multi_rss` pipeline. The release-notes pages on
``docs.docker.com`` a... | trvny/feedseek | feed_generators/docker.py | .py | 195a1eb3dedc0067 | 7.42 | 6 |
"""Electronic Arts feed: combined Atom from EA.com pages.
Sources (none have native RSS; all are scraped):
* EA News PL (ea.com/pl-pl/news) — server-rendered ``<ea-tile>`` cards
with ISO dates in ``eyebrow-secondary-text``
* EA Research & Technology (ea.com/technology) — same ``<ea-tile>``
markup, relative... | trvny/feedseek | feed_generators/ea.py | .py | 70dca7def16f5a88 | 7.42 | 6 |
"""Durable entry identity helpers.
Published entry IDs are reader state: changing one can make an old article look
new again. Keep the currently published URL-derived ID as the compatibility
fallback, but prefer an ID already persisted with the cache entry so a link can
later move without silently changing identity.
"... | trvny/feedseek | feed_generators/entry_identity.py | .py | bf0e10809a57126b | 7.42 | 6 |
"""Safe cache refresh for entries rediscovered by a native feed."""
from __future__ import annotations
from utils import normalize_link, sort_posts_for_feed
SYNTHETIC_TITLE_FIELD = "_feedseek_synthetic_title"
_IMAGE_DIMENSIONS = ("image_width", "image_height")
def _meaningful(value) -> bool:
if value is None:
... | trvny/feedseek | feed_generators/entry_refresh.py | .py | d6823620afd4ec37 | 7.42 | 6 |
#!/usr/bin/env python3
"""Generate a combined Atom feed from selected worksafe 4chan boards.
The official read-only JSON API supplies current OP threads for substantive
worksafe boards. Explicit, warez-heavy, nationalism/flame, and low-signal boards
are deliberately excluded from this public feed. The official 4chan b... | trvny/feedseek | feed_generators/fourchan.py | .py | ee9d57e01ff44010 | 7.42 | 6 |
"""GitHub ecosystem feed: GitHub's own blogs plus the app store built on top
of GitHub Releases.
All regular sources are native RSS:
* The GitHub Blog and its per-topic channels (changelog, engineering,
security, open source, AI/ML, enterprise). The channels are subsets of the
main feed, so the cross-source... | trvny/feedseek | feed_generators/github.py | .py | c4e29ecf9a7e47bd | 7.42 | 6 |
"""Google AI Studio release-notes scraper for the combined Google feed."""
from __future__ import annotations
import re
from datetime import datetime, timezone
import requests
from bs4 import BeautifulSoup
from utils import DEFAULT_HEADERS, sanitize_xml, setup_logging
logger = setup_logging()
AI_STUDIO_CHANGELOG_... | trvny/feedseek | feed_generators/google_ai_studio.py | .py | c64f05422d7354f1 | 7.42 | 6 |
"""Turn a Google News RSS link into the article it actually points at.
Eight generators reach sites that block scrapers (reuters.com answers 403 to
anything automated) through Google News RSS. That works for discovery, but the
links it hands back are wrappers - ``news.google.com/rss/articles/CBMi...`` -
and 2257 publi... | trvny/feedseek | feed_generators/google_news.py | .py | 48bbe192e995d208 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
import enum
import os
import pyvisa
from string import digits
from contextlib import closing
import time
from .automation.arm.rotrics import Dexarm
"""
:meta private:
"""
class Actuate:
"""
Class for managing actuation
"""
de... | lagerdata/lager | box/lager/actuate.py | .py | 90ab7f27e25c8be9 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
"""
hardware_service adapter for ADC nets (create_device factory).
hardware_service resolves ``device`` names against ``lager.{name}`` first, so
this lives at the top of the package as ``adc_hs`` — a role-unique name (the raw
driver module ``labja... | lagerdata/lager | box/lager/adc_hs.py | .py | 6a3d31f51c2450d5 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
"""
hardware_service adapter for robot-arm nets (create_device factory).
See ``adc_hs`` for why this is a role-unique top-level module. The adapter
owns the Dexarm's serial handle inside hardware_service, so the port is opened
once and cached (no ... | lagerdata/lager | box/lager/arm_hs.py | .py | 24a74c54c6e6eae3 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Optional, Tuple, Any
class ArmBackendError(Exception):
"""Base exception for arm backend errors."""
pass
class MovementTimeoutError(ArmBackendError... | lagerdata/lager | box/lager/automation/arm/arm_net.py | .py | 17854457d92eed54 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
# box/lager/arm/dispatcher.py
from __future__ import annotations
import os, sys, json, argparse
from typing import Optional, Tuple, Any
from .rotrics import Dexarm # Dexarm subclasses ArmBase
from .arm_net import ArmBackendError, MovementTimeoutE... | lagerdata/lager | box/lager/automation/arm/dispatcher.py | .py | 31c9f8f9129ebc2a | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import importlib
from types import ModuleType
from typing import Callable, Any
# Import USB exceptions for export
from .usb_net import (
USBBackendError,
LibraryMissingError,
DeviceNotFoundError,
... | lagerdata/lager | box/lager/automation/usb_hub/__init__.py | .py | af0f405d699594d5 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
"""
USB Net wrapper class for the lager Python API.
Provides clean access to USB hub nets (Acroname, YKUSH, Plugable) from Python scripts.
"""
from __future__ import annotations
from typing import Optional
from .dispatcher import _controller_for... | lagerdata/lager | box/lager/automation/usb_hub/usb_net_wrapper.py | .py | a3c6c2cc76dacdea | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
"""
lager.binaries.runner - Run custom binaries on the box
This module provides helpers for executing custom binaries that customers
have uploaded to the box. These binaries are stored in a mounted
directory and can be called via subprocess.
The ... | lagerdata/lager | box/lager/binaries/runner.py | .py | 1bc5b252c41f0d80 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
"""
lager.binaries.store - Disk logic behind the binaries + download-file endpoints.
Shared between the :5000 python-exec service (box/lager/python/service.py)
and the :9000 box HTTP server (box/lager/http_handlers/binaries_handler.py),
following ... | lagerdata/lager | box/lager/binaries/store.py | .py | 7fb5d8c29a39408d | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
class BluetoothError(Exception):
"""Catch-all exception for Bluetooth related errors."""
class ConnectionError(BluetoothError): # pylint: disable=redefined-builtin
"""Raised when a connection is unavailable."""
class RoleError(BluetoothE... | lagerdata/lager | box/lager/blufi/exceptions.py | .py | 2cb60e2ddf298099 | 7.42 | 6 |
# Copyright 2024-2026 Lager Data
# SPDX-License-Identifier: Apache-2.0
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
try:
# cryptography >= 48 ships CFB here; 50.0 deprecates the primitives
# path with removal upstream calls imminent but has not scheduled.
from cryptography.hazmat.... | lagerdata/lager | box/lager/blufi/security/aes.py | .py | 0e4e60ddb69798ea | 7.42 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.