[![Telegram Group](https://img.shields.io/badge/support-join-blue?logo=telegram)](https://t.me/+_AdHkBRnul4xZTg6)
[![PyPI package](https://img.shields.io/pypi/v/polyanalyst6api)](https://pypi.org/project/polyanalyst6api)
[![Downloads](https://static.pepy.tech/badge/polyanalyst6api/month)](https://pepy.tech/project/polyanalyst6api)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/polyanalyst6api)](https://pypi.org/project/polyanalyst6api/)
[![MIT License](https://img.shields.io/github/license/megaputer/polyanalyst6api-py)](https://github.com/Megaputer/polyanalyst6api-py/blob/master/LICENSE)
**_polyanalyst6api_ is a simple and easy to use client library for the PolyAnalyst API.**
This package provides wrappers for PolyAnalyst `Analytical Client`, `Scheduler` and `Drive`.
Using it you can execute nodes, view datasets, run tasks, download/upload files and so on.
## Installation
Python 3.7+ is required. Install and upgrade `polyanalyst6api` with these commands:
```shell
pip install polyanalyst6api
pip install --upgrade polyanalyst6api
```
## Documentation
See [API Reference](https://polyanalyst6api-py.rtfd.io) for the client library methods.
Refer to **PolyAnalyst User Manual** at **Application Programming Interfaces** > **Version 01** for REST API specification.
## Usage
Import an api client and log in to PolyAnalyst server
```python
from polyanalyst6api import API
with API(POLYANALIST_URL, USERNAME, PASSWORD) as api:
# making a request to PolyAnalyst endpoint that require authorization
print(api.get_server_info())
```
### Working with project
Instantiate project wrapper by calling with existing project ID:
```python
prj = api.project(PROJECT_UUID)
```
Set `Python` node code using parent `Parameters` node.
```python
prj.parameters('Parameters (1)').set(
'Dataset/Python',
{'Script': 'result = pandas.DataFrame([{"val": 42}])'}
)
```
Execute `Python` node and wait to complete execution
```python
prj.execute('Python', wait=True)
```
Check node results:
```python
ds = prj.dataset('Python').preview()
assert ds[0]['val'] == 42
```
Save project:
```python
prj.save()
```
### Downloading file from user home folder using PA Drive API
```python
content = api.drive.download_file('README.txt')
with open(r'C:\README.txt', mode='wb+') as local_file:
local_file.write(content)
```
See [polyanalyst6api-python/examples](https://github.com/Megaputer/polyanalyst6api-py/tree/master/examples) for more complex examples.
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Megaputer/polyanalyst6api-py/tree/master/LICENSE) file for details
Raw data
{
"_id": null,
"home_page": "https://github.com/Megaputer/polyanalyst6api-py",
"name": "polyanalyst6api",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": "megaputer, polyanalyst, polyanalyst6api, api",
"author": "yatmanov",
"author_email": "yatmanov@megaputer.ru",
"download_url": "https://files.pythonhosted.org/packages/62/17/0e0468950dbabdc8e801a0a0f6491f12013d9d2c12057d7737d1c4d3ea38/polyanalyst6api-0.35.1.tar.gz",
"platform": null,
"description": "[![Telegram Group](https://img.shields.io/badge/support-join-blue?logo=telegram)](https://t.me/+_AdHkBRnul4xZTg6)\n[![PyPI package](https://img.shields.io/pypi/v/polyanalyst6api)](https://pypi.org/project/polyanalyst6api)\n[![Downloads](https://static.pepy.tech/badge/polyanalyst6api/month)](https://pepy.tech/project/polyanalyst6api)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/polyanalyst6api)](https://pypi.org/project/polyanalyst6api/)\n[![MIT License](https://img.shields.io/github/license/megaputer/polyanalyst6api-py)](https://github.com/Megaputer/polyanalyst6api-py/blob/master/LICENSE)\n\n**_polyanalyst6api_ is a simple and easy to use client library for the PolyAnalyst API.**\n\nThis package provides wrappers for PolyAnalyst `Analytical Client`, `Scheduler` and `Drive`.\nUsing it you can execute nodes, view datasets, run tasks, download/upload files and so on.\n\n## Installation\n\nPython 3.7+ is required. Install and upgrade `polyanalyst6api` with these commands:\n\n```shell\npip install polyanalyst6api\npip install --upgrade polyanalyst6api\n```\n\n## Documentation\n\nSee [API Reference](https://polyanalyst6api-py.rtfd.io) for the client library methods.\n\nRefer to **PolyAnalyst User Manual** at **Application Programming Interfaces** > **Version 01** for REST API specification.\n\n## Usage\n\nImport an api client and log in to PolyAnalyst server\n\n```python\nfrom polyanalyst6api import API\n\nwith API(POLYANALIST_URL, USERNAME, PASSWORD) as api:\n # making a request to PolyAnalyst endpoint that require authorization\n print(api.get_server_info())\n```\n\n### Working with project\n\nInstantiate project wrapper by calling with existing project ID:\n```python\nprj = api.project(PROJECT_UUID)\n```\n\nSet `Python` node code using parent `Parameters` node.\n```python\nprj.parameters('Parameters (1)').set(\n 'Dataset/Python',\n {'Script': 'result = pandas.DataFrame([{\"val\": 42}])'}\n)\n```\n\nExecute `Python` node and wait to complete execution\n```python\nprj.execute('Python', wait=True)\n```\n\nCheck node results:\n```python\nds = prj.dataset('Python').preview()\nassert ds[0]['val'] == 42\n```\n\nSave project:\n```python\nprj.save()\n```\n\n### Downloading file from user home folder using PA Drive API\n\n```python\ncontent = api.drive.download_file('README.txt')\nwith open(r'C:\\README.txt', mode='wb+') as local_file:\n local_file.write(content)\n```\n\nSee [polyanalyst6api-python/examples](https://github.com/Megaputer/polyanalyst6api-py/tree/master/examples) for more complex examples.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/Megaputer/polyanalyst6api-py/tree/master/LICENSE) file for details\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "polyanalyst6api is a PolyAnalyst API client for Python.",
"version": "0.35.1",
"project_urls": {
"Changelog": "https://github.com/Megaputer/polyanalyst6api-py/blob/master/CHANGELOG.md",
"Documentation": "https://polyanalyst6api-py.rtfd.io/",
"Homepage": "https://github.com/Megaputer/polyanalyst6api-py",
"Repository": "https://github.com/Megaputer/polyanalyst6api-py"
},
"split_keywords": [
"megaputer",
" polyanalyst",
" polyanalyst6api",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9542fa38da3610bfbcb1ae60f2b974838432641d7b8e9a53c04709f1ecfdc5d1",
"md5": "9a835fdfa5ff7f7db25d48253aa245a0",
"sha256": "b7ac57ec7168f5c24900d2c0c15e982a282e175ca935f7b85a26a739ba80a3da"
},
"downloads": -1,
"filename": "polyanalyst6api-0.35.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9a835fdfa5ff7f7db25d48253aa245a0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 19424,
"upload_time": "2024-08-21T09:23:46",
"upload_time_iso_8601": "2024-08-21T09:23:46.736762Z",
"url": "https://files.pythonhosted.org/packages/95/42/fa38da3610bfbcb1ae60f2b974838432641d7b8e9a53c04709f1ecfdc5d1/polyanalyst6api-0.35.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "62170e0468950dbabdc8e801a0a0f6491f12013d9d2c12057d7737d1c4d3ea38",
"md5": "c93ee07702b762ebdbed8bf1f0dcfc57",
"sha256": "3a5e8ab253b5358f3812afb28472e4507bf20ccfc419e3e4a78ac4780c93f197"
},
"downloads": -1,
"filename": "polyanalyst6api-0.35.1.tar.gz",
"has_sig": false,
"md5_digest": "c93ee07702b762ebdbed8bf1f0dcfc57",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 17519,
"upload_time": "2024-08-21T09:23:48",
"upload_time_iso_8601": "2024-08-21T09:23:48.650750Z",
"url": "https://files.pythonhosted.org/packages/62/17/0e0468950dbabdc8e801a0a0f6491f12013d9d2c12057d7737d1c4d3ea38/polyanalyst6api-0.35.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 09:23:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Megaputer",
"github_project": "polyanalyst6api-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "polyanalyst6api"
}