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.18.0.tar.gz
.
File metadata
- Download URL: polyanalyst6api-0.18.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.1 CPython/3.8.6 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbb2d9fab252f79df5507a3a533a633aa914d53cf6268993c0b827cfabda6145 |
|
MD5 | b2e2d0af32b3f8310dd76614a3a07a7b |
|
BLAKE2b-256 | d5a11172d49f2c44f7d8910915642097a433f55a04c0d903b606433c70bc1359 |
File details
Details for the file polyanalyst6api-0.18.0-py3-none-any.whl
.
File metadata
- Download URL: polyanalyst6api-0.18.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.1 CPython/3.8.6 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03c8af5923381b97f529a2f0bb5d32e54bc02ab597410f5ddbb2a90ef8dd0595 |
|
MD5 | 6733e15e31ff7e3c4382176d9954adcd |
|
BLAKE2b-256 | d7b7492007c132d8c878cdc031f06c58715aeb768e3220f648c8a6f72a7f018e |