enerplex


Nameenerplex JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/NoxelS/enerplex-api-client
SummaryEnerplex API Client
upload_time2025-01-27 20:10:41
maintainerNone
docs_urlNone
authorNoel Schwabenland
requires_python>=3.9
licenseMIT License
keywords energen enerplex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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:

```bash
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:

```env
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

```python
from enerplex import get_target_proteins

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

### Fetch Ligands

```python
from enerplex import get_ligands

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

### Download Files

```python
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

```python
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:

```python
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}")
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NoxelS/enerplex-api-client",
    "name": "enerplex",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "energen enerplex",
    "author": "Noel Schwabenland",
    "author_email": "noel@lusi.uni-sb.de",
    "download_url": "https://files.pythonhosted.org/packages/05/25/240dc5eb160bd698bb66d405f97634bd85b62bc12e6a6b9efa06f52f9bbb/enerplex-0.2.1.tar.gz",
    "platform": null,
    "description": "Enerplex API Client\n==========================\n\nThe 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.\n\n## Features\n\n- **Authentication**: Securely authenticate with the Enerplex API using user credentials.\n- **Target Proteins**: Retrieve and manage information about target proteins.\n- **Ligands**: Fetch ligands associated with specific proteins and upload new ligands.\n- **Embeddings**: Retrieve embeddings for proteins and ligands.\n- **File Management**: Download and manage files related to proteins, ligands, and embeddings.\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install enerplex\n```\n\n## Setup\n\nThe package uses environment variables for configuration. Either set environment variable or create a `.env` file in your project directory with the following variables:\n\n```env\nENERPLEX_API_URL=<your-api-url>\nENERPLEX_API_USER=<your-username>\nENERPLEX_API_USER_PASSWORD=<your-password>\n```\n\n## Usage\n\n### Authentication\n\nThe package automatically handles authentication. Tokens are refreshed as needed to ensure seamless interaction with the API.\n\n### Fetch Target Proteins\n\n```python\nfrom enerplex import get_target_proteins\n\nproteins = get_target_proteins()\nfor protein in proteins:\n    print(protein.name)\n```\n\n### Fetch Ligands\n\n```python\nfrom enerplex import get_ligands\n\nligands = get_ligands(protein_identifier=123)\nfor ligand in ligands:\n    print(ligand.id, ligand.name)\n```\n\n### Download Files\n\n```python\nfrom enerplex import download_target_protein_file\nfrom pathlib import Path\n\nprotein = ...  # A DBTargetProtein object\ndownload_target_protein_file(protein, path=Path(\"/path/to/save/file\"))\n```\n\n### Upload Ligands\n\n```python\nfrom enerplex import upload_ligand\nfrom pathlib import Path\n\nligand = upload_ligand(\n    target_name=\"ProteinX\",\n    score=92.5,\n    scoring_function=\"Docking\",\n    ligand_structure_file_path=Path(\"/path/to/ligand/file\")\n)\nprint(ligand.id, ligand.name)\n```\n\n## Contributing\n\nContributions 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.\n\n## License\n\nThis package is licensed under the MIT License. See the `LICENSE` file for more details.\n\n## Support\n\nFor any issues or questions, please open an issue on the GitHub repository or contact the maintainer directly.\n\n---\n\n### Example Workflow\n\nHere's a complete example that retrieves a target protein, downloads its associated file, and uploads a new ligand:\n\n```python\nfrom enerplex import get_target_proteins, download_target_protein_file, upload_ligand, DBProteinLigandComplex, DBTargetProtein\nfrom pathlib import Path\n\n# Retrieve proteins\nproteins: list[DBTargetProtein] = get_target_proteins()\nselected_protein: DBTargetProtein = proteins[0]\n\n# Download protein file\ndownload_target_protein_file(selected_protein, path=Path(\"protein_file.pdb\"))\n\n# Build a ligand with some workflow\n# ...\n\n# Upload the new ligand\nnew_ligand: DBProteinLigandComplex  = upload_ligand(\n    target_name=selected_protein.name,\n    score=-9.3,\n    scoring_function=\"Vina\",\n    ligand_structure_file_path=Path(\"ligand_structure.pdb\")\n)\nprint(f\"Uploaded ligand: {new_ligand.id}, {new_ligand.name}\")\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Enerplex API Client",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/NoxelS/enerplex-api-client"
    },
    "split_keywords": [
        "energen",
        "enerplex"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1e9d6e16e870ebae0f714b21f30b63ea14e0784e4e476aa231724ed2a01c1ec2",
                "md5": "42cc5cb34635d23c6d73a5d714d379c8",
                "sha256": "446d2ac10cda547b3c0334de2483b89dafb4af62c1684726dd73c758c0058108"
            },
            "downloads": -1,
            "filename": "enerplex-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "42cc5cb34635d23c6d73a5d714d379c8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11133,
            "upload_time": "2025-01-27T20:10:39",
            "upload_time_iso_8601": "2025-01-27T20:10:39.256087Z",
            "url": "https://files.pythonhosted.org/packages/1e/9d/6e16e870ebae0f714b21f30b63ea14e0784e4e476aa231724ed2a01c1ec2/enerplex-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0525240dc5eb160bd698bb66d405f97634bd85b62bc12e6a6b9efa06f52f9bbb",
                "md5": "d292f910642e31a995983a40824b5a0c",
                "sha256": "509517499065429790a895ce4b74b047afab47c091522da52befd8d70c5e2c39"
            },
            "downloads": -1,
            "filename": "enerplex-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d292f910642e31a995983a40824b5a0c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10773,
            "upload_time": "2025-01-27T20:10:41",
            "upload_time_iso_8601": "2025-01-27T20:10:41.469439Z",
            "url": "https://files.pythonhosted.org/packages/05/25/240dc5eb160bd698bb66d405f97634bd85b62bc12e6a6b9efa06f52f9bbb/enerplex-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-27 20:10:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NoxelS",
    "github_project": "enerplex-api-client",
    "github_not_found": true,
    "lcname": "enerplex"
}
        
Elapsed time: 0.38700s