Name | chaparralapi JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | An API for the Chaparral platform |
upload_time | 2024-07-24 00:53:13 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
chaparral
api
bioinformatics
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
## Chaparral Python API
This Python package is a wrapper for the Chaparral API. It provides a simple and convenient interface for interacting with the Chaparral platform.
**Note:** Currently, it supports a limited number of API endpoints. More endpoints will be added in future releases.
## Installation
To install the package, use pip:
```bash
pip install chaparralapi
```
## Example Usage
Here's a quick example of how to use the Chaparral API client:
```python
from chaparralapi import Client
token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
api = Client(token)
# Fetch and print all projects
print(api.get_projects())
# Fetch and print organization details
print(api.get_organization())
# Fetch and print all FASTA databases
print(api.get_databases())
```
## Obtaining the API Token
To get your Chaparral API token, follow these steps:
1. Go to the [Chaparral website](https://chaparral.ai).
2. Open the browser's developer tools (usually F12 or right-click and select "Inspect").
3. Navigate to the "Network" tab.
4. Look for a REST API call and inspect its headers.
5. Copy the token from the `Authorization` header.
6. The token will be valid for 8 hours.
Sure, here is the updated README to include the new endpoints in the `Client` class:
## Endpoints
This section describes the endpoints available in the `Client` class for interacting with the Chaparral API.
#### Project Endpoints
- **Get All Projects:** `get_projects() -> List[Project]`
- Retrieves a list of all projects.
- **Get Project by ID:** `get_project(project_id: str) -> Project`
- Retrieves a specific project by its ID.
- **Create Project:** `create_project(name: str, description: str) -> Project`
- Creates a new project.
- **Update Project:** `update_project(project_id: str, name: str, description: str, tags: List[str]) -> Project`
- Updates an existing project.
- **Delete Project:** `delete_project(project_id: str) -> None`
- Deletes a project by its ID.
- **Tag Projects:** `tag_projects(project_ids: List[str], tags: List[str]) -> List[Project]`
- Adds tags to multiple projects.
- **Get Projects by Tag:** `get_projects_by_tag(tag: str) -> List[Project]`
- Retrieves projects that have a specific tag.
#### Organization Endpoints
- **Get Organization:** `get_organization() -> Organization`
- Retrieves the details of the organization.
- **Update Organization:** `update_organization(organization_id: str, name: str) -> Organization`
- Updates the organization's name.
- **Invite to Organization:** `invite_to_organization(email: str) -> None`
- Invites a new member to the organization.
- **Get Resource Usage:** `get_resource_usage() -> OrganizationUsage`
- Retrieves the resource usage of the organization.
#### Database Endpoints
- **Get All Databases:** `get_databases() -> List[Database]`
- Retrieves a list of all databases.
- **Get Database by ID:** `get_database(database_id: str) -> Database`
- Retrieves a specific database by its ID.
- **Update Database:** `update_database(database_id: str, name: str, organism: str, decoy_tag: Optional[str]) -> Database`
- Updates an existing database.
- **Create Database:** `create_database(database_bytes: bytes, filename: str) -> Database`
- Creates a new database.
- **Delete Database:** `delete_database(database_id: str) -> None`
- Deletes a database by its ID.
#### Search Result Endpoints
- **Get All Search Results:** `get_search_results() -> List[SearchResult]`
- Retrieves a list of all search results.
- **Get Search Result by ID:** `get_search_result(search_result_id: str) -> Optional[SearchResult]`
- Retrieves a specific search result by its ID.
- **Get Search Result Download:** `get_search_result_download(search_result_id: str) -> SearchResultDownload`
- Retrieves the download URLs for a specific search result.
- **Fetch Config JSON:** `fetch_config_json(search_result_id: str) -> str`
- Fetches the config JSON file for a specific search result.
- **Fetch Matched Fragments Parquet:** `fetch_matched_fragments_parquet(search_result_id: str) -> str`
- Fetches the matched fragments parquet file for a specific search result.
- **Fetch Peptide CSV:** `fetch_peptide_csv(search_result_id: str) -> str`
- Fetches the peptide CSV file for a specific search result.
- **Fetch Proteins CSV:** `fetch_proteins_csv(search_result_id: str) -> str`
- Fetches the proteins CSV file for a specific search result.
- **Fetch Results JSON:** `fetch_results_json(search_result_id: str) -> str`
- Fetches the results JSON file for a specific search result.
- **Fetch Results Parquet:** `fetch_results_parquet(search_result_id: str) -> str`
- Fetches the results parquet file for a specific search result.
#### QC Endpoints
- **Get QC Scores:** `get_qc_scores(search_result_id: str) -> List[QcScore]`
- Retrieves the QC scores for a specific search result.
- **Get QC IDs:** `get_qc_ids(search_result_id: str) -> List[QcId]`
- Retrieves the QC IDs for a specific search result.
- **Get QC Precursors:** `get_qc_precursors(search_result_id: str) -> List[QcPrecursor]`
- Retrieves the QC precursors for a specific search result.
#### User Profile Endpoints
- **Get User Profile:** `get_user_profile() -> Profile`
- Retrieves the user's profile information.
- **Update User Profile:** `update_user_profile(first_name: str, last_name: str) -> Profile`
- Updates the user's profile information.
#### Project File Endpoints
- **Get Project Files:** `get_project_files(project_id: str) -> List[ProjectFile]`
- Retrieves the files for a specific project.
- **Get Project File:** `get_project_file(project_id: str, file_id: str) -> ProjectFile`
- Retrieves a specific file from a project by its ID.
- **Upload Project File:** `upload_project_file(project_id: str, file_bytes: bytes, filename: str)`
- Uploads a file to a specific project.
#### Search Submission Endpoints
- **Submit Search:** `submit_search(project_id: str, search_settings: Dict) -> None`
- Submits a search request for a specific project.
Raw data
{
"_id": null,
"home_page": null,
"name": "chaparralapi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "chaparral, api, bioinformatics",
"author": null,
"author_email": "Patrick Garrett <pgarrett@scripps.edu>",
"download_url": "https://files.pythonhosted.org/packages/bc/80/c9b8cd1348be6595c101ea7697c586604c452bc8b350b38880555c651e74/chaparralapi-0.1.1.tar.gz",
"platform": null,
"description": "## Chaparral Python API\n\nThis Python package is a wrapper for the Chaparral API. It provides a simple and convenient interface for interacting with the Chaparral platform.\n\n**Note:** Currently, it supports a limited number of API endpoints. More endpoints will be added in future releases.\n\n## Installation\n\nTo install the package, use pip:\n\n```bash\npip install chaparralapi\n```\n\n## Example Usage\n\nHere's a quick example of how to use the Chaparral API client:\n\n```python\nfrom chaparralapi import Client\n\ntoken = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'\napi = Client(token)\n\n# Fetch and print all projects\nprint(api.get_projects())\n\n# Fetch and print organization details\nprint(api.get_organization())\n\n# Fetch and print all FASTA databases\nprint(api.get_databases())\n```\n\n## Obtaining the API Token\n\nTo get your Chaparral API token, follow these steps:\n\n1. Go to the [Chaparral website](https://chaparral.ai).\n2. Open the browser's developer tools (usually F12 or right-click and select \"Inspect\").\n3. Navigate to the \"Network\" tab.\n4. Look for a REST API call and inspect its headers.\n5. Copy the token from the `Authorization` header.\n6. The token will be valid for 8 hours.\n\nSure, here is the updated README to include the new endpoints in the `Client` class:\n\n## Endpoints\n\nThis section describes the endpoints available in the `Client` class for interacting with the Chaparral API.\n\n#### Project Endpoints\n\n- **Get All Projects:** `get_projects() -> List[Project]`\n - Retrieves a list of all projects.\n\n- **Get Project by ID:** `get_project(project_id: str) -> Project`\n - Retrieves a specific project by its ID.\n\n- **Create Project:** `create_project(name: str, description: str) -> Project`\n - Creates a new project.\n\n- **Update Project:** `update_project(project_id: str, name: str, description: str, tags: List[str]) -> Project`\n - Updates an existing project.\n\n- **Delete Project:** `delete_project(project_id: str) -> None`\n - Deletes a project by its ID.\n\n- **Tag Projects:** `tag_projects(project_ids: List[str], tags: List[str]) -> List[Project]`\n - Adds tags to multiple projects.\n\n- **Get Projects by Tag:** `get_projects_by_tag(tag: str) -> List[Project]`\n - Retrieves projects that have a specific tag.\n\n#### Organization Endpoints\n\n- **Get Organization:** `get_organization() -> Organization`\n - Retrieves the details of the organization.\n\n- **Update Organization:** `update_organization(organization_id: str, name: str) -> Organization`\n - Updates the organization's name.\n\n- **Invite to Organization:** `invite_to_organization(email: str) -> None`\n - Invites a new member to the organization.\n\n- **Get Resource Usage:** `get_resource_usage() -> OrganizationUsage`\n - Retrieves the resource usage of the organization.\n\n#### Database Endpoints\n\n- **Get All Databases:** `get_databases() -> List[Database]`\n - Retrieves a list of all databases.\n\n- **Get Database by ID:** `get_database(database_id: str) -> Database`\n - Retrieves a specific database by its ID.\n\n- **Update Database:** `update_database(database_id: str, name: str, organism: str, decoy_tag: Optional[str]) -> Database`\n - Updates an existing database.\n\n- **Create Database:** `create_database(database_bytes: bytes, filename: str) -> Database`\n - Creates a new database.\n\n- **Delete Database:** `delete_database(database_id: str) -> None`\n - Deletes a database by its ID.\n\n#### Search Result Endpoints\n\n- **Get All Search Results:** `get_search_results() -> List[SearchResult]`\n - Retrieves a list of all search results.\n\n- **Get Search Result by ID:** `get_search_result(search_result_id: str) -> Optional[SearchResult]`\n - Retrieves a specific search result by its ID.\n\n- **Get Search Result Download:** `get_search_result_download(search_result_id: str) -> SearchResultDownload`\n - Retrieves the download URLs for a specific search result.\n\n- **Fetch Config JSON:** `fetch_config_json(search_result_id: str) -> str`\n - Fetches the config JSON file for a specific search result.\n\n- **Fetch Matched Fragments Parquet:** `fetch_matched_fragments_parquet(search_result_id: str) -> str`\n - Fetches the matched fragments parquet file for a specific search result.\n\n- **Fetch Peptide CSV:** `fetch_peptide_csv(search_result_id: str) -> str`\n - Fetches the peptide CSV file for a specific search result.\n\n- **Fetch Proteins CSV:** `fetch_proteins_csv(search_result_id: str) -> str`\n - Fetches the proteins CSV file for a specific search result.\n\n- **Fetch Results JSON:** `fetch_results_json(search_result_id: str) -> str`\n - Fetches the results JSON file for a specific search result.\n\n- **Fetch Results Parquet:** `fetch_results_parquet(search_result_id: str) -> str`\n - Fetches the results parquet file for a specific search result.\n\n#### QC Endpoints\n\n- **Get QC Scores:** `get_qc_scores(search_result_id: str) -> List[QcScore]`\n - Retrieves the QC scores for a specific search result.\n\n- **Get QC IDs:** `get_qc_ids(search_result_id: str) -> List[QcId]`\n - Retrieves the QC IDs for a specific search result.\n\n- **Get QC Precursors:** `get_qc_precursors(search_result_id: str) -> List[QcPrecursor]`\n - Retrieves the QC precursors for a specific search result.\n\n#### User Profile Endpoints\n\n- **Get User Profile:** `get_user_profile() -> Profile`\n - Retrieves the user's profile information.\n\n- **Update User Profile:** `update_user_profile(first_name: str, last_name: str) -> Profile`\n - Updates the user's profile information.\n\n#### Project File Endpoints\n\n- **Get Project Files:** `get_project_files(project_id: str) -> List[ProjectFile]`\n - Retrieves the files for a specific project.\n\n- **Get Project File:** `get_project_file(project_id: str, file_id: str) -> ProjectFile`\n - Retrieves a specific file from a project by its ID.\n\n- **Upload Project File:** `upload_project_file(project_id: str, file_bytes: bytes, filename: str)`\n - Uploads a file to a specific project.\n\n#### Search Submission Endpoints\n\n- **Submit Search:** `submit_search(project_id: str, search_settings: Dict) -> None`\n - Submits a search request for a specific project.\n",
"bugtrack_url": null,
"license": null,
"summary": "An API for the Chaparral platform",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"chaparral",
" api",
" bioinformatics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b1d996726d5fba9af3a5a0c12a1dffce43c979f374d8c1f03e737b599b311ec3",
"md5": "66456eac428983f51002e2f3a53e63fe",
"sha256": "87163613bc40f03f88fbd6878066a19e18985f65aab5770e24379dd7f297c6a3"
},
"downloads": -1,
"filename": "chaparralapi-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "66456eac428983f51002e2f3a53e63fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 23679,
"upload_time": "2024-07-24T00:53:12",
"upload_time_iso_8601": "2024-07-24T00:53:12.185572Z",
"url": "https://files.pythonhosted.org/packages/b1/d9/96726d5fba9af3a5a0c12a1dffce43c979f374d8c1f03e737b599b311ec3/chaparralapi-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc80c9b8cd1348be6595c101ea7697c586604c452bc8b350b38880555c651e74",
"md5": "52909b066bab86f3a6da02361617640c",
"sha256": "4c997f5c6228c25550aa76da08d0dc244f8449482a198c9e884e2e3462084b8b"
},
"downloads": -1,
"filename": "chaparralapi-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "52909b066bab86f3a6da02361617640c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 17557,
"upload_time": "2024-07-24T00:53:13",
"upload_time_iso_8601": "2024-07-24T00:53:13.087726Z",
"url": "https://files.pythonhosted.org/packages/bc/80/c9b8cd1348be6595c101ea7697c586604c452bc8b350b38880555c651e74/chaparralapi-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-24 00:53:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "chaparralapi"
}