polyanalyst6api is a PolyAnalyst API client for Python.
Project description
polyanalyst6api
polyanalyst6api
is a Python library for interacting with PolyAnalyst APIs.
This package provides easy to use wrappers for PolyAnalyst Analytical Client
, Scheduler
and Drive
.
With it you can execute nodes, view datasets, run tasks, download/upload files and so on.
Installation
Python 3.6+ is required. Install, upgrade and uninstall polyanalyst6api-python
with these commands:
$ pip install polyanalyst6api
$ pip install --upgrade polyanalyst6api
$ pip uninstall polyanalyst6api
Documentation
See API Reference for the library methods.
Refer to PolyAnalyst User Manual at Application Programming Interfaces > Version 01 for REST API specification.
Usage
Authentication
Use API
context manager to automatically log in and log out of PolyAnalyst server:
from polyanalyst6api import API
with API(POLYANALIST_URL, USERNAME, PASSWORD) as api:
...
Working with project
Instantiate project wrapper by calling with existing project ID:
prj = api.project(PROJECT_UUID)
Set Python
node code using parent Parameters
node.
prj.parameters('Parameters (1)').set(
'Dataset/Python',
{'Script': 'result = pandas.DataFrame([{"val": 42}])'}
)
Execute Python
node and wait to complete execution
prj.execute('Python', wait=True)
Check node results:
ds = prj.dataset('Python').preview()
assert ds[0]['val'] == 42
Save project:
prj.save()
Downloading file from user home folder using PA Drive API
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 for more complex examples.
License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file polyanalyst6api-0.21.0.tar.gz
.
File metadata
- Download URL: polyanalyst6api-0.21.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3682e0e234f595d8f25e85e238b9a7ca54ee144bd740eb8fbeb5f519e0a101d5 |
|
MD5 | 55399452cabfa977604a94a06be7d69d |
|
BLAKE2b-256 | 76b9ed443939bc34c9dccd8cd746692e3f5d97bc4e1a8aa0939741ad8522e4bd |
File details
Details for the file polyanalyst6api-0.21.0-py3-none-any.whl
.
File metadata
- Download URL: polyanalyst6api-0.21.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4122cbb5c6d3f958ea2bcf851607b3777efbf6acdd6fb5c7cdd5d6141d6483f1 |
|
MD5 | f8e24b2b24d40782d99b9b447b289516 |
|
BLAKE2b-256 | fc3fd15f2a785e0736ebe722b77bfa418bc010d4b5ca075414b9a4b0bd3a6720 |