Skip to main content

polyanalyst6api is a PolyAnalyst API client for Python.

Project description

Build status PyPI package Downloads Supported Python versions MIT 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:

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


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.34.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

polyanalyst6api-0.34.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polyanalyst6api-0.34.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

File hashes

Hashes for polyanalyst6api-0.34.0.tar.gz
Algorithm Hash digest
SHA256 ae9b5045188f043fe8623ab88ed6bec179f9f95b2098a47202377fa8e6e378f8
MD5 05c6f20599ea4a02249c0f74e10c2162
BLAKE2b-256 5cb1508b06f248f6b2fbfc9e9943acba1b02d4356183456066e13fa3f8d41903

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polyanalyst6api-0.34.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

File hashes

Hashes for polyanalyst6api-0.34.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b23275b9c224924844a4775c331aee8b1c78fada40f7c671dc0c9ab67ed56378
MD5 4736a9648e3fada2f47e27916b5b0954
BLAKE2b-256 35746c7b5e4b68f40c0afdf5a5809cd3e7dd777342e8e3b853296bcf0598086e

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