CLI integration for BioCypher ecosystem packages
Project description
biotope
| Package | |
| Meta |
CLI for the BioCypher ecosystem: Croissant-described data → BioCypher knowledge graph, with git-like metadata version control.
Status: pre-alpha, developer-facing. APIs and CLI will change. Not yet suitable for end users.
Install
uv pip install biotope # or
uv pip install -e ".[dev]" # editable, with test deps
From init to a knowledge graph
# 1. Scaffold a project.
biotope init my-kg --purpose "What approved drugs target genes in T2D?"
cd my-kg
# 2. Declare intent — what entities and relations the graph must contain.
# Non-interactive (agent-friendly):
biotope map --entity gene --entity disease --entity drug \
--relation gene_associated_with_disease
# 3. Bring in data and its Croissant metadata.
biotope add data/opentargets --license CC-BY-4.0 --creator "Open Targets"
biotope annotate apply data/opentargets # after reviewing data/opentargets/.biotope.yaml
# 4. Generate an unresolved mapping scaffold from your declared intent.
# The file has one slot per entity/relation plus an inspector appendix
# listing record sets, field kinds, identifier-like fields, and sample rows.
biotope map scaffold .biotope/datasets/data/opentargets.jsonld
# 5. Resolve the slots. Two equivalent paths:
# a) Wizard (humans): biotope map
# b) Edit `mappings/*.yaml` directly, then validate (agents):
# biotope map inspect <croissant> --json # field catalogue
# biotope map preview --json # status + projected schema + sample tuples
# 6. Optional: align entities across multiple mappings.
biotope propose-alignment mappings/*.mapping.yaml --out alignment.yaml
# 7. Build a runnable BioCypher project. Strict: rejects unresolved slots.
biotope build
biotope view
biotope init is a pure scaffolder. All non-autogeneratable metadata is supplied as CLI flags — by a user or an agent reading AGENTS.md. Semantic decisions (which record set, which fields, which transforms) are made by the human or copilot; biotope only enumerates options, validates, and previews.
Architecture
Two layers, both in this repo:
| Layer | Module | Role |
|---|---|---|
| Project & VCS | biotope.commands.* |
init, add, commit, status, log, push, pull, mv, check-data — git-like metadata workflow |
| KG construction | biotope.croissant.* |
spec, codegen, acquisition, mapping, alignment, scaffold, registry — Croissant → BioCypher project |
biotope.croissant.api exposes scaffold_mapping, propose_alignment, materialize, discover_sources as pure functions; the CLI verbs are thin wrappers. The mapping authoring surface lives under biotope.commands.map (Click group) and biotope.commands.map_wizard (Rich-based guided flow).
The agent surface is AGENTS.md (template lives at biotope/templates/AGENTS.md, copied into every project by init). No MCP server — agents drive the same CLI a human uses.
Commands
init project scaffolding
map (inspect|scaffold|preview) semantic mapping (intent + wizard + agent path)
add mv status commit log push pull git-like metadata VCS
check-data checksum verification
discover registry-aware source ranking
propose-alignment cross-mapping same_node equivalences
build view benchmark build + inspect a graph
read chat NLP ingestion, conversation (promises)
search annotate get config legacy / auxiliary
biotope describe and the heuristic biotope propose-mapping were removed/deprecated. Intent capture is now biotope map --entity ... --relation ...; scaffolding is biotope map scaffold. propose-mapping remains as a deprecated alias for the scaffold subcommand.
See docs/architecture.md for the data-flow diagram and docs/api-docs/ for per-command reference.
Development
uv sync --extra dev
uv run pytest
uv run ruff check biotope tests
Build backend is hatchling; lockfile is uv.lock. CI runs uv sync + uv run pytest on Python 3.10 and 3.12.
Copyright
Copyright © 2025–2026 BioCypher Team. Apache 2.0.
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 biotope-0.7.0.tar.gz.
File metadata
- Download URL: biotope-0.7.0.tar.gz
- Upload date:
- Size: 367.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf6fef7ffe636b08d6b633f9b76897482a5b6b461fde83c87c0bab3af36de6f
|
|
| MD5 |
c24b954c2581d64e815606bc317144dd
|
|
| BLAKE2b-256 |
0391e56cfdf06e8321fff12da8ea49224d59a2a3ccbf4a406ade5709cda4aa50
|
Provenance
The following attestation bundles were made for biotope-0.7.0.tar.gz:
Publisher:
release-please.yaml on biocypher/biotope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biotope-0.7.0.tar.gz -
Subject digest:
bcf6fef7ffe636b08d6b633f9b76897482a5b6b461fde83c87c0bab3af36de6f - Sigstore transparency entry: 1630778055
- Sigstore integration time:
-
Permalink:
biocypher/biotope@475fc3ba90e44d3c633217f4fa63d573000cd060 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/biocypher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yaml@475fc3ba90e44d3c633217f4fa63d573000cd060 -
Trigger Event:
push
-
Statement type:
File details
Details for the file biotope-0.7.0-py3-none-any.whl.
File metadata
- Download URL: biotope-0.7.0-py3-none-any.whl
- Upload date:
- Size: 180.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c98f2fabd2d01c94e695f16371e22d72c52a2ce72f8aa08b8184582b0c210bb5
|
|
| MD5 |
222fec6742c38877c84ab2513140a9d8
|
|
| BLAKE2b-256 |
7aebcdd4fe5fc9a99b7523e119b9752b6825983ac5e5138f96c7518fbbb9239b
|
Provenance
The following attestation bundles were made for biotope-0.7.0-py3-none-any.whl:
Publisher:
release-please.yaml on biocypher/biotope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biotope-0.7.0-py3-none-any.whl -
Subject digest:
c98f2fabd2d01c94e695f16371e22d72c52a2ce72f8aa08b8184582b0c210bb5 - Sigstore transparency entry: 1630778059
- Sigstore integration time:
-
Permalink:
biocypher/biotope@475fc3ba90e44d3c633217f4fa63d573000cd060 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/biocypher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yaml@475fc3ba90e44d3c633217f4fa63d573000cd060 -
Trigger Event:
push
-
Statement type: