Python REST client for the Anthive single-cell RNA-seq browser (sibling of the Go `vark` CLI)
Project description
pyvark
Python client for the Anthive
single-cell RNA-seq REST API. Sibling of the Go vark
CLI — same backend, two front ends.
API surface verified against anthive REST API 2.7.2 (2026-06-20).
Why the dual name?
The Go CLI ships as a binary called vark. To avoid clobbering it on
the user's $PATH and to keep the PyPI / Codeberg slug obvious, the
distribution name is pyvark but the importable name is vark.
pip install pyvark # distribution
python -c "from vark import AnthiveClient; print('ok')" # usage
(Both CLI and library live next to each other in the same Anthive setup
with no shell collision: vark = the Go binary, vark = the Python
import.)
Install
From Codeberg (no PyPI publish yet):
pip install git+ssh://git@codeberg.org/mfiers/pyvark.git
Editable from a local checkout:
git clone ssh://git@codeberg.org/mfiers/pyvark.git
cd pyvark
pip install -e .
# with pandas for `format='dataframe'` support:
pip install -e ".[pandas]"
Pyodide / JupyterLite:
import micropip
await micropip.install("pyvark")
from vark import AnthiveClient
client = AnthiveClient() # auto-detects {origin}/api/ in the browser
Minimal example
from vark import AnthiveClient
client = AnthiveClient(
"https://my.anthive.example/api",
auth=("user", "password"),
)
# What's on this server?
print(client.get_version()["version"])
databases = client.get_databases()
print(f"{len(databases)} datasets available")
# Pick a dataset and show its metadata fields
info = client.get_database_info(databases[0]["id"])
print(info["title"], info["n_cells"], "cells")
# Render a UMAP scatter server-side and write the PNG
plot = client.get_plot(
info["id"], "scatter",
color="cell_type",
palette_categorical="tab20",
width=6, height=5, dpi=150,
)
open("umap.png", "wb").write(plot["bytes"])
# The X-Plot-Caption header carries anthive's prose figure legend —
# this is the ONLY place the multi-sentence caption exists.
print(plot["caption"])
API coverage (highlights)
get_root,get_health,get_metrics,get_version,get_changelog— version + latency telemetry (/healthexposesmean_response_ms/p50_response_ms/n_samples).get_databases,get_database_info,get_group(group_id)— catalog + per-collection landing-page data (API 2.5+).get_plot(db_id, geom, ...)— every server-side geom:scatter,hexbin,kde2d,violin,box,bar,histogram,ecdf,kde,heatmap,rolling,volcano,ma,forest,de_heatmap. Captures theX-Plot-Captionresponse header (the multi-sentence figure legend — API 2.7.2+). Supportscolor_scale=auto|sequential| divergent, plot clamps (log2fc_clip,neglog10p_clip,logmean_clip), bargroup_by, hexbin auto-clip (vmin_quantile/vmax_quantile), per-axis transforms (transform_x/transform_y,asinh_scale), KDE knobs (kde_n,kde_bw,n_levels,iso_overlay,point_overlay), marginals / regline overlays. Data export viaformat="csv"/"tsv"returns the dataframe the plot was built from (API 2.6+).list_de_studies,get_de_study,list_de_contrasts,get_de_rows,get_de_by_gene— DE data flow (API 2.3+).analytics_schema,analytics_query,analytics_viz— SELECT-only SQL sandbox + Parquet-backed visualisation.module_score,list_module_scores— on-the-fly and pre-computed module scores.list_genesets,get_geneset,rescan_genesets.pick_fastest(base_urls, ...)— server-selection helper that consumes/healthlatency telemetry.
Tests
# Offline (no server needed):
uv run --with pytest --with requests python -m pytest tests/test_offline.py -v
# Live smoke (round-trip):
ANTHIVE_TEST_URL=https://my.anthive/api \
ANTHIVE_TEST_USER=user ANTHIVE_TEST_PASSWORD=pass \
uv run --with pytest --with requests --with pandas \
python -m pytest tests/test_smoke.py -v
Versioning
pyvark starts at 0.1.0 as a clean break from the legacy
antclient 1.x history that previously lived under
anthive4/antclient/. The Anthive REST API uses its own semver
(X.Y.Z) — see client.AnthiveClient.API_TARGET for the version this
release was last verified against.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvark-0.1.0.tar.gz.
File metadata
- Download URL: pyvark-0.1.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db4d62c37b148490edc49afafd407734687c4ec5d613ee2b23ecfac0c6135d54
|
|
| MD5 |
b4ab6ff28396e6832c8d076a7f2a1d90
|
|
| BLAKE2b-256 |
452948583928f170de751042d5e52f0cb4aa9da671ea20f81e7680ddb757e838
|
File details
Details for the file pyvark-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyvark-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c63f367635cb4a493a4c7228b2b4a04ecb49109c21be476d969c9f6ba02d92e
|
|
| MD5 |
c30a237de309e1204ee1e9ce5dfbe8da
|
|
| BLAKE2b-256 |
75c389dbf048896911d9ea958a1daed8f3fc1fc72f11b8013bad97672d956ef6
|