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 · Documentation: findakin.lelain.net/docs.
spectro-kernel = algorithms on ONE spectrum (embeddings, I/O, lines, RV, reduction…)
Findakin = questions on MANY spectra (index, neighbours, clusters, anomalies,
trajectories, encoder benchmarks)
Three stars of a pro-am campaign (STAROS) read back as spectra after ingestion, embedding and grouping. The documentation works through this population and through 566 SDSS stars, with provenance.
Install
pip install findakin # core: store, ingestion, kernel recipes, k-NN, analysis toolbox
pip install "findakin[viz]" # + the Plotly views (maps, overlays, cluster means, trajectories…)
pip install "findakin[analysis]" # + UMAP, HDBSCAN, self-organising maps (minisom)
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/staros", source="staros", tags=["campaign:staros"])
print(report) # 406 files → 406 added, 0 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="resolution > 15000") # …or by id, filtered
ids, X = st.vectors(enc, where="series_id = 'alf dra'") # numpy matrix for analysis
from findakin.analysis import cluster_embeddings, cluster_stability, detect_anomalies, decompose, series_trajectory
res = cluster_embeddings(X, method="agglomerative", n_clusters=2) # Ward; linkage kept for a dendrogram
cluster_stability(X, method="agglomerative", n_clusters=2) # is the partition reproducible?
weird = detect_anomalies(X, method="urf", contamination=0.05) # unsupervised random forest weirdness
stack = st.flux_matrix(where="series_id = 'alf Dra'") # the spectra on one grid
pca = decompose(stack.flux, "pca", n_components=5) # eigenspectra + reconstruction error
ids_s, t, XS = st.series("alf Dra", enc) # one series in time order
tr = series_trajectory(XS, t, ids=ids_s, period=51.42) # outliers, change points, orbital phase
# 4. look — every view is a Plotly figure (pip install "findakin[viz]")
from findakin import viz
viz.cluster_spectra(stack.wavelength, stack.flux, res.labels) # clusters read back as spectra
viz.leakage_view(project_embeddings(X).points, meta, by=("object", "instrument"))
viz.trajectory_plot(tr, x="phase", y=pca.weights[:, 0]) # the orbit, folded
Every method is glue over scikit-learn, scipy, astropy, minisom or plotly, cites its reference in the docstring, and returns a result aligned with the input ids.
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) |
results |
analyses stored with their provenance: name, kind, encoder, params, {id: value} payload, store version |
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 2a — population toolbox
(clusters + stability, URF anomalies, eigenspectra / NMF, trajectories, SOM), stored results,
Plotly views ✅ · Phase 1 — common λ grids in the store, flux__<grid> tables, vector
indexes · Phase 2b — named populations, SIMBAD aliases, notebook templates · Phase 3 —
learned encoders registry, benchmark with an instrument-leakage score · Phase 4 —
findakin-mcp over the store · Phase 5 — thin HTTP façade for applications.
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.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| findakin-0.2.1.tar.gz | 94.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| findakin-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 189.3 kB
Release files / findakin-0.2.1.tar.gz
| Download URL | findakin-0.2.1.tar.gz |
|---|---|
| Size | 94.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
feba0f7c4b927137a7c429b3a37a7aaf6a8fd7ac8b52a35bd4540d251550444c
|
|
BLAKE2b-256 checksum How to use checksums |
7fb22dcd5eff85ebf0717f2036b790b3855e0fe513648f3470b16014597a2117
|
| 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 logRelease files / findakin-0.2.1-py3-none-any.whl
| Download URL | findakin-0.2.1-py3-none-any.whl |
|---|---|
| Size | 94.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38be6460332d250e403141c1847db0ca5e4c3c38f1f24adee65ce42800cd84ff
|
|
BLAKE2b-256 checksum How to use checksums |
d70a1c269c3444fb048c4d25b36d522d682d1bbe10bc015bea738f79a9d4568f
|
| 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 logSecurity for findakin 0.2.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.
Attestation for findakin-0.2.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 logA 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.