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.19.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 openprotein-python 0.19.0
File Size Uploaded Provenance Actions
openprotein_python-0.19.0.tar.gz 209.5 kB With provenance Details for openprotein_python-0.19.0.tar.gz

Built distribution (wheel)

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

Total release size: 516.6 kB

Release files / openprotein_python-0.19.0.tar.gz

Download URL openprotein_python-0.19.0.tar.gz
Size 209.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f32063e312b9bb38afa3aff5b3a3fdba699baf054d12ed8be1eeb4379bee0024
BLAKE2b-256 checksum
How to use checksums
897c50449c3c4e52c25c8254b357ec722d3cd051d4891b183b9059110b2b01c3
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 Dec 1, 2026.

Transparency log

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

Download URL openprotein_python-0.19.0-py3-none-any.whl
Size 307.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47d1179e400b9416ce2c8a21d19524a76c61d4e11f04f9115b45c3f4eedd1fca
BLAKE2b-256 checksum
How to use checksums
d3b022ae0719a95b81fde481147257d67f08830df8b4f504c5a76e2c9d360cd5
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 Dec 1, 2026.

Transparency log

Security for openprotein-python 0.19.0

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.19.0.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 Dec 1, 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.19.0 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