Skip to main content

Enerplex API Client

Project description

Enerplex API Client

The Enerplex API Client is a Python package designed to interact with the Enerplex platform, providing functionality to manage and retrieve data related to target proteins, ligands, and their embeddings. This package facilitates authentication, data retrieval, and file management through a user-friendly interface.

Features

  • Authentication: Securely authenticate with the Enerplex API using user credentials.
  • Target Proteins: Retrieve and manage information about target proteins.
  • Ligands: Fetch ligands associated with specific proteins and upload new ligands.
  • Embeddings: Retrieve embeddings for proteins and ligands.
  • File Management: Download and manage files related to proteins, ligands, and embeddings.

Installation

Install the package using pip:

pip install enerplex

Setup

The package uses environment variables for configuration. Either set environment variable or create a .env file in your project directory with the following variables:

ENERPLEX_API_URL=<your-api-url>
ENERPLEX_API_USER=<your-username>
ENERPLEX_API_USER_PASSWORD=<your-password>

Usage

Authentication

The package automatically handles authentication. Tokens are refreshed as needed to ensure seamless interaction with the API.

Fetch Target Proteins

from enerplex import get_target_proteins

proteins = get_target_proteins()
for protein in proteins:
    print(protein.name)

Fetch Ligands

from enerplex import get_ligands

ligands = get_ligands(protein_identifier=123)
for ligand in ligands:
    print(ligand.id, ligand.name)

Download Files

from enerplex import download_target_protein_file
from pathlib import Path

protein = ...  # A DBTargetProtein object
download_target_protein_file(protein, path=Path("/path/to/save/file"))

Upload Ligands

from enerplex import upload_ligand
from pathlib import Path

ligand = upload_ligand(
    target_name="ProteinX",
    score=92.5,
    scoring_function="Docking",
    ligand_structure_file_path=Path("/path/to/ligand/file")
)
print(ligand.id, ligand.name)

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request. Ensure your code adheres to the existing style and is well-documented.

License

This package is licensed under the MIT License. See the LICENSE file for more details.

Support

For any issues or questions, please open an issue on the GitHub repository or contact the maintainer directly.


Example Workflow

Here's a complete example that retrieves a target protein, downloads its associated file, and uploads a new ligand:

from enerplex import get_target_proteins, download_target_protein_file, upload_ligand, DBProteinLigandComplex, DBTargetProtein
from pathlib import Path

# Retrieve proteins
proteins: list[DBTargetProtein] = get_target_proteins()
selected_protein: DBTargetProtein = proteins[0]

# Download protein file
download_target_protein_file(selected_protein, path=Path("protein_file.pdb"))

# Build a ligand with some workflow
# ...

# Upload the new ligand
new_ligand: DBProteinLigandComplex  = upload_ligand(
    target_name=selected_protein.name,
    score=-9.3,
    scoring_function="Vina",
    ligand_structure_file_path=Path("ligand_structure.pdb")
)
print(f"Uploaded ligand: {new_ligand.id}, {new_ligand.name}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enerplex-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

enerplex-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file enerplex-0.1.0.tar.gz.

File metadata

  • Download URL: enerplex-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for enerplex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47b36349af0afc5d2d6896f90805fffe956355095457b400e2030b5ef8cba5cc
MD5 f58379119e01fdf2edaf579ef9332524
BLAKE2b-256 433e289fbb40f2f8579b52a9fc915f5e5f3928aad8d21dda9607afbbcb7cef25

See more details on using hashes here.

Provenance

The following attestation bundles were made for enerplex-0.1.0.tar.gz:

Publisher: publish.yml on NoxelS/enerplex-api-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enerplex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: enerplex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for enerplex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e237982caccf70cc8ed3d431b8cce6368d5ad05c60b95ea3f9bb7edfbd4a579
MD5 ec238c3295306a1c416b9a91eb8a98b0
BLAKE2b-256 c8af4e3ff9a164d9b7394600b1f3167fc2de8eb7c2f4c05d44e7d56bb6696859

See more details on using hashes here.

Provenance

The following attestation bundles were made for enerplex-0.1.0-py3-none-any.whl:

Publisher: publish.yml on NoxelS/enerplex-api-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page