openprotein
SDK release/v0.18.0Create an authorized session with openprotein.connect, then use session.models to discover and run models. The session also exposes compatibility interfaces and other platform services, including clustering.
See Set up a Python SDK session for credential precedence and how to use ~/.openprotein/config.toml.
source
Connect and create a OpenProtein session.
usernamestr= NoneThe username of the user. If not provided, taken from the
environment variable OPENPROTEIN_USERNAME or a
configuration file at ~/.openprotein/config.toml.
passwordstr= NoneThe password of the user. If not provided, taken from the
environment variable OPENPROTEIN_PASSWORD or a
configuration file at ~/.openprotein/config.toml.
backendstr | None= Nonetimeoutint= 180session = openprotein.connect("username", "password")13source
Bases: APISession
The base class for accessing OpenProtein API functionality.
usernamestrpasswordstrbackendstrtimeoutint= 180propertydata:DataAPIsource
The data submodule gives access to functionality for uploading and accessing user data.
propertyjobs:JobsAPIsource
The jobs submodule gives access to functionality for listing jobs and checking their status.
propertyalign:AlignAPIsource
The Align submodule gives access to the sequence alignment capabilities by building MSAs and prompts that can be used with PoET.
propertyprompt:PromptAPIsource
The prompt submodule gives access to creating and retrieving prompts and queries used to condition PoET models.
propertyembedding:EmbeddingsAPIsource
The embedding submodule gives access to protein embedding models and their inference endpoints.
propertyembeddings:EmbeddingsAPIsource
The embedding submodule gives access to protein embedding models and their inference endpoints.
propertyclustering:ClusteringAPIsource
The clustering API for fitting hierarchical clustering jobs.
propertypredictor:PredictorAPIsource
The predictor submodule gives access to training and predicting with predictors built on top of embeddings.
propertydesign:DesignAPIsource
The designer submodule gives access to functionality for designing new sequences using models from predictor train.
2source
Bases: requests.Session
A class to handle API sessions. This class provides a connection session to the OpenProtein API.
usernamestrpasswordstrbackendstrtimeoutint= 180methodpost(url, data=None, json=None, **kwargs)source
Sends a POST request. Returns Response object.
urlURL for the new Request object.
data= None(optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the Request.
json= None(optional) json to send in the body of the Request.
\*\*kwargsOptional arguments that request takes.
methodlogin(username, password)source
Authenticate connection to OpenProtein with your credentials.
usernamestrusername
passwordstrpassword
source
Bases: Exception
Raised when the API returns an error.
messagestrsource
Bases: Exception
DeprecationError used for flagging to the user to not use this interface anymore.
source
Bases: Exception
Raised when a parameter has an invalid value.
source
Bases: Exception
Raised when a required parameter is not provided.
source
Bases: Exception
Raised when authentication fails.
source
Bases: Exception
Raised when retrieving results from a job that has failed.
job_idstrfailure_messagestr | None= Nonesource
Bases: Exception
Raised when a job cannot be found or is not valid for the request.
source
Bases: Exception
A job has no units_digest yet.
job_idstrTypes referenced by the interfaces above.
source
Bases: Exception
Raised when waiting on a job or request times out.