Skip to main content

PyPI version Coverage Conda version

openprotein-python

The OpenProtein.AI Python Interface provides a user-friendly library to interact with the OpenProtein.AI REST API, enabling various tasks related to protein analysis and modeling.

Table of Contents

Workflow Description
0 Quick start Quick start guide
1 Installation Install with pip or conda.
2 Python API reference Sessions, jobs and every interface in the Python client.
3 Models Embedding, scoring, generative and structure models, plus GP, SVD and UMAP.
4 PoET Score and generate sequences conditioned on a protein family.
5 Tutorials End-to-end workflows.

Quick-start

Get started with our quickstart README! You can peruse the official documentation for more details!

Installation

To install the python interface using pip, run the following command:

pip install openprotein-python

or with conda:

conda install -c openprotein openprotein-python

Requirements

  • Python 3.10 or higher.
  • Other dependencies as in pyproject.toml

Getting started

Read on below for the quick-start guide, or see the docs for more information!

To begin, create a session using your login credentials.

import openprotein

# replace USERNAME and PASSWORD with your actual login credentials
session = openprotein.connect(USERNAME, PASSWORD)

Job Status

The interface offers Future objects for asynchronous calls, allowing tracking of job status and result retrieval when ready. Given a future, you can check its status and retrieve results.

Checking Job Status

Check the status of an Future using the following methods:

future.refresh()  # call the backend to update the job status
future.done()     # returns True if the job is done, meaning the status could be SUCCESS, FAILED, or CANCELLED

Retrieving Job Results

Once the job has finished, retrieve the results using the following methods:

result = future.wait()     # wait until done and then fetch results

#verbosity is controlled with verbose arg
result = future.get(verbose=True)  # get the result from a finished job

Jobs Interface

Listing Jobs

To view all jobs associated with each session, the following method is available, providing an option to filter results by date, job type, status, or name.

session.jobs.list() 
session.jobs.list(name="my-run")  # filter to jobs with an exact name match

Retrieving Specific Job

For detailed information about a particular job, use the following command with the corresponding job ID:

session.jobs.get(JOB_ID)  # Replace JOB_ID with the ID of the specific job to be retrieved

Naming Jobs

A job can be given a name and description once it's created, to make it easier to find:

session.jobs.update(JOB_ID, name="my-run", description="baseline model")

# equivalent, from a Future
future.rename(name="my-run", description="baseline model")

Resuming Jobs

Jobs from prior workflows can be resumed by loading them by ID.

future = session.jobs.get(JOB_ID)  # Replace JOB_ID with the ID of the job to resume

PoET interface

PoET scores and generates sequences conditioned on a prompt, a set of sequences from the protein family. Model handles are on session.models.

Building a Prompt

Create a prompt from sequences you already have, or sample one from an MSA built by homology search.

model = session.models.poet

seed = "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN"

prompt = session.prompt.create_prompt([seed])

# or
msa = session.align.create_msa(seed)
prompt = msa.sample_prompt(num_sequences=50)

Scoring Sequences

To score sequences, use score with a list of queries and the prompt.

queries = [
    "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN",
    "MALWMRLLPLLVLLALWGPDPASAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN",
    "MALWTRLRPLLALLALWPPPPARAFVNQHLCGSHLVEALYLVCGERGFFYTPKARREVEGPQVGALELAGGPGAGGLEGPPQKRGIVEQCCASVCSLYQLENYCN",
]

future = model.score(queries, prompt=prompt)
scores = future.wait()
# one log-likelihood per query, in the order submitted
# a prompt with several replicates gives one score per replicate

Scoring Single Site Variants

To score every single-site substitution of a sequence, use single_site.

future = model.single_site(seed, prompt=prompt)
scores = future.wait()
# one score per substitution, 20 per position: positions in sequence order,
# substitutions in the order of openprotein.utils.sequence.AMINO_ACIDS

Generating Sequences

To sample new sequences from the prompt, use generate.

future = model.generate(
    prompt=prompt,
    num_samples=100,
    temperature=1.0,
    top_k=15,
)
sequences = future.wait()                   # generated sequences as strings
scores = future.get(output="loglikelihood")  # one log-likelihood per sequence

See more at our Homepage

Metadata

Release files for openprotein-python 0.18.2

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

Source distribution (sdist)

Source distribution for openprotein-python 0.18.2
File Size Uploaded Provenance Actions
openprotein_python-0.18.2.tar.gz 200.1 kB With provenance Details for openprotein_python-0.18.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openprotein-python 0.18.2
File Interpreter ABI Platform Actions
openprotein_python-0.18.2-py3-none-any.whl Python 3 none any Details for openprotein_python-0.18.2-py3-none-any.whl

Total release size: 488.0 kB

Release files / openprotein_python-0.18.2.tar.gz

Download URL openprotein_python-0.18.2.tar.gz
Size 200.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19a1a091b57c8bcf9c8442fa4e9d028762c7b00da11f7f0486ead3421665414e
BLAKE2b-256 checksum
How to use checksums
9858d0109e60dd52bfe6a63a5a0fb65e22ea288582f9ae7c8c18b2e350745e51
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 Nov 24, 2026.

Transparency log

Release files / openprotein_python-0.18.2-py3-none-any.whl

Download URL openprotein_python-0.18.2-py3-none-any.whl
Size 287.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef9ee42a8b2f34c5cf64f4ea010ef4039d909c849b897fb4aa34eeee39835244
BLAKE2b-256 checksum
How to use checksums
01b9139f4cb4f00cf91532bdb95cfc782e0adfe6495aaf15b0f53f38c56035c7
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 Nov 24, 2026.

Transparency log

Security for openprotein-python 0.18.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openprotein_python-0.18.2.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 Nov 24, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.18.2 This release

2 release files Full provenance

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