Skip to main content

Findakin

Find a kin for every spectrum.

Findakin answers population questions about collections of astronomical spectra: which look alike, what structure they form, which stand out, which changed in time, and which representation (encoder) is the most physical. It is a local Python library built on spectro-kernel (one spectrum → one vector) and LanceDB (an embedded, versioned, columnar store with a vector index). No server, no account: your spectra stay on your disk.

Status: 0.1 alpha, API may still change. Findakin started as a hosted web application (FastAPI + MongoDB + Qdrant + React, retired in October 2026) and was rebuilt as a local-first library. Landing page: findakin.lelain.net.

spectro-kernel  = algorithms on ONE spectrum   (embeddings, I/O, lines, RV, reduction…)
Findakin        = questions on MANY spectra    (index, neighbours, clusters, anomalies,
                                                trajectories, encoder benchmarks)

Install

pip install findakin                 # core: store, ingestion, kernel recipes, k-NN
pip install "findakin[analysis]"     # + UMAP projection, HDBSCAN clustering
pip install "findakin[vo]"           # + SSAP / Virtual Observatory connectors
pip install "findakin[encoders]"     # + local PyTorch encoders (spectro-kernel embed_pretrained)

Python ≥ 3.11.

Quick start

from findakin import Store

st = Store.open("~/findakin/store")                 # a directory; created if missing

# 1. ingest — FITS (BeSS / ISIS / specINTI / Demetra dialects), CSV, JSON, TXT.
#    Spectra are deduplicated by content; metadata (object, time, instrument,
#    observer, site, resolution, coverage) is extracted from the headers.
report = st.ingest_folder("~/spectra/alphadra", source="staros", tags=["campaign:alphadra"])
print(report)                                       # 1012 files → 987 added, 25 duplicates, 0 errors

# 2. embed — any spectro-kernel strategy; several encoders coexist for the same spectra
enc = st.embed(strategy="dct", dim=256, norm_method="z_score")   # → 'dct:v1:256:nogrid:z_score'
enc_ll = st.embed(strategy="log_lambda", dim=256)                 # Doppler-robust recipe
# tip: with min_max the continuum term dominates the vector and every pair scores ≈ 0.99;
# z_score (zero mean) or continuum_subtracted let the lines drive the similarity.

# 3. ask
st.neighbours("~/spectra/new_alfdra.fits", k=10, encoder=enc)          # k-NN by file…
st.neighbours(some_id, k=10, encoder=enc, where="observer = 'mlelain'")  # …or by id, filtered
ids, X = st.vectors(enc, where="series_id = 'alf dra'")                 # numpy matrix for analysis

from findakin.analysis import cluster_embeddings, detect_anomalies, project_embeddings
labels = cluster_embeddings(X, method="hdbscan")
outliers = detect_anomalies(X, method="lof", contamination=0.02)
xy = project_embeddings(X, method="umap")

Same verbs on the command line:

findakin ingest ~/spectra/alphadra --source staros --tag campaign:alphadra
findakin embed --strategy dct --dim 256
findakin search ~/spectra/new_alfdra.fits -k 10
findakin info

What is in the store

A LanceDB directory, versioned, rebuildable from your files:

Table Content
spectra one row per spectrum: id (content hash), source, object, series_id, t_mjd, instrument, observer, site, resolution, wl_min/wl_max, file_uri, tags, raw header (JSON)
flux_native the native wavelength / flux arrays (re-embed with a new encoder without re-reading files)
emb__<encoder> one table per encoder: (id, vector, provenance) — encoder_id = strategy:model_version:dim:grid:norm
encoders the encoder registry (config, dimension)

series_id groups spectra that form a trajectory in time: an object followed over epochs (default), a night of sky spectra (series_from="night", e.g. aurorae), or a folder.

Roadmap (short)

Phase 0 — store, ingestion, kernel encoders, k-NN, CLI ✅ · Phase 1 — common λ grids (inter-instrument alignment), flux__<grid> tables, vector indexes · Phase 2 — named populations, clusters / anomalies / projections stored as results, trajectory anomalies, Plotly notebook helpers · Phase 3 — learned encoders registry, encoder benchmark with an instrument-leakage score · Phase 4 — findakin-mcp over the store · Phase 5 — thin HTTP façade for STAROS / SpecRelay.

Development

uv venv .venv --python 3.12 && source .venv/bin/activate
uv pip install -e ".[dev]"
pytest -q
ruff check src tests

The landing page lives in website/ (Vite + React, deployed separately).

License

MIT — © 2026 Matthieu Le Lain.

Metadata

Release files for findakin 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for findakin 0.1.1
File Size Uploaded Provenance
findakin-0.1.1.tar.gz 67.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for findakin 0.1.1
File Interpreter ABI Platform
findakin-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 132.8 kB

Release files / findakin-0.1.1.tar.gz

Download URL findakin-0.1.1.tar.gz
Size 67.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1d7b1b9f2770b5c83f1ec74cabe789c10454a5f1dc4ef1e4d2b2a333649bd460
BLAKE2b-256 checksum
How to use checksums
71ad55b2f1c468cbc85e7c229175d5676ba9298f2d1c26e9f776bf0da1fa0b99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / findakin-0.1.1-py3-none-any.whl

Download URL findakin-0.1.1-py3-none-any.whl
Size 65.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48e0a5f0ea2b7d743bf269bc6fa1f6485fd0aa2a61a040a67913e7d88e2a8eac
BLAKE2b-256 checksum
How to use checksums
0da84e218234965d00e772fa2554a0c4230e8c17b774af07b695f3c8547407fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for findakin 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for findakin-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page