polyanalyst6api is a PolyAnalyst API client for Python.
Project description
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:
pip install polyanalyst6api
pip install --upgrade polyanalyst6api
Documentation
See API Reference 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
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:
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.28.0.tar.gz
.
File metadata
- Download URL: polyanalyst6api-0.28.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1042-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97cf1344d77e18865679450eed81fd767f14822841691c429de0c90368eff7e2 |
|
MD5 | d55b9beea85410905b5b348d0a3cd84f |
|
BLAKE2b-256 | 44aae10a0cc1af2474c2fc693778f9b7976c304462a20d7aca0aa30ca3a73998 |
File details
Details for the file polyanalyst6api-0.28.0-py3-none-any.whl
.
File metadata
- Download URL: polyanalyst6api-0.28.0-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1042-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d40e7211524ad8f6def0be4b1142d0122b688e685354a3477c943638e566f105 |
|
MD5 | e9b29c4cb9c6af068db13e048a61eb99 |
|
BLAKE2b-256 | 8b4df0d3a559042f793edb1574c0cce4ef1a54000e61c7abd0248e44514c7e2c |