Skip to main content

polyanalyst6api is a PolyAnalyst API client for Python.

Project description

polyanalyst6api

PyPI package Supported Python versions MIT License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyanalyst6api-0.19.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

polyanalyst6api-0.19.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file polyanalyst6api-0.19.0.tar.gz.

File metadata

  • Download URL: polyanalyst6api-0.19.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Windows/10

File hashes

Hashes for polyanalyst6api-0.19.0.tar.gz
Algorithm Hash digest
SHA256 0442bf7c7f6a598de1ee456db4c68e253dae1ab0472766ab34567932a01d08e7
MD5 33abc1f51179acc8d4aba19ef54ad335
BLAKE2b-256 f6c58a2f751e2f77027b7ea04ab4b4b493e8e2d51790fb2ee84a6914700e6265

See more details on using hashes here.

File details

Details for the file polyanalyst6api-0.19.0-py3-none-any.whl.

File metadata

File hashes

Hashes for polyanalyst6api-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58dbf03da50d6e1184f07e34c3c0c328884cbe0832a722b12c9436b0b923294d
MD5 b352a2ed6e4eb91827d0884cf77b930f
BLAKE2b-256 318232f62af273b5f60bd24250aca5687b02292f57f859312d497c14e590d8c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page