Skip to main content

Landscapy

Landscapy is a Python package for constructing and analysing graph-based fitness landscapes. It supports sequence-aware graph construction, layered fitness and annotation data, landscape models and ruggedness and epistasis analyses, with use cases in sequence similarity network analysis and protein engineering. Landscapy supports a generic interface to deep learning packages, maintained in landscapy-ml.

Requirements and installation

Landscapy supports Python 3.11 and 3.12.

The default installation includes every user-facing feature in the all and ml dependency groups, together with a compatible 1.x release of landscapy-ml:

python -m pip install landscapy

For development from a checkout:

python -m pip install -e ".[dev]"
python -m pytest

See Installation and system requirements for more information on requirements and installation.

Command-line interface and quickstart

landscapy --help

Given an aligned protein FASTA file (sequences.fasta), a minimal portable kNN CLI workflow is:

landscapy knn-landscape \
  --sequences sequences.fasta \
  --output landscape.pkl \
  --k 5 \
  --backend balltree \
  --embedding-domain ohe

The equivalent Python code is:

from pathlib import Path

from fitness_landscape import FitnessLandscape, create_knn_graph
from fitness_landscape.core.graph import _encode_multiallele
from fitness_landscape.utils import fasta_to_prot20_sequences

sequences, aligned_sequences = fasta_to_prot20_sequences(
    "sequences.fasta",
    strict=False,
    return_gapped=True,
)
embedding_sequences = (
    aligned_sequences if aligned_sequences is not None else sequences
)
embeddings, _ = _encode_multiallele(embedding_sequences)

graph = create_knn_graph(
    sequences=sequences,
    k=5,
    embeddings=embeddings,
    embedding_domain="ohe",
    backend="balltree",
    _compute_hamming_edges=True,
)
landscape = FitnessLandscape.from_graph(
    graph,
    embeddings={"ohe": embeddings},
    active_embedding_domain="ohe",
)
landscape.save(Path("landscape.pkl"))

Cookbook

The worked-example cookbook provides examples for common Landscapy usage. Every recipe states its assumptions, expected outputs, and limits of interpretation. Short recipe examples are checked in CI; the networked end-to-end tutorial is run manually.

License

Landscapy is distributed under the MIT License. See LICENSE.

Metadata

Release files for landscapy 1.0.0

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

Source distribution (sdist)

Source distribution for landscapy 1.0.0
File Size Uploaded
landscapy-1.0.0.tar.gz 2.6 MB Details

Built distribution (wheel)

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

Total release size: 2.8 MB

Release files / landscapy-1.0.0.tar.gz

Download URL landscapy-1.0.0.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7850003e60dfd7f5951fdde695df5582159d672a7f67fb17fe8d6d119680b2ca
BLAKE2b-256 checksum
How to use checksums
ad32c462d865b91d7d555735aeeccafa7f0ff2e59aef433bf8b7d554fce16e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release files / landscapy-1.0.0-py3-none-any.whl

Download URL landscapy-1.0.0-py3-none-any.whl
Size 256.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9751fcf9652c9e47b9f056ea8fe5b4788fa96d2b06cd5a1af0ad8170b5f61b9e
BLAKE2b-256 checksum
How to use checksums
e08212ae8838ff4c2998f7ae8c2b9a2f00891673fb586cccca1fdee21693d462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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