Skip to content

Megaputer/polyanalyst6api-py

Repository files navigation

Telegram Group PyPI package Downloads Supported Python versions MIT License

Welcome to the official Python client library for the PolyAnalyst REST API.

This package provides python wrappers for PolyAnalyst applications, such as Analytical Client, Scheduler, Drive. Using polyanalyst6api you can access and edit projects, publications, files and more.

Installation

pip install -u polyanalyst6api

Python 3.7 or later is required.

Documentation

See API Reference for the client library methods.

Refer to PolyAnalyst's User Manual at Application Programming Interfaces > Version 1 for REST API specification.

Usage

Import and initialize a client:

from polyanalyst6api import API

# using an api token
client = API(<POLYANALIST_URL>, token=<API_TOKEN>)

# or using PolyAnalyst user credentials. Note that in this case you need to call .login()
client = API(<POLYANALIST_URL>, <USERNAME>, <PASSWORD>)
client.login()

Request data using client methods:

>>> prj = client.project(<prjUUID>)
>>> prj.status()
{'status': 'Loaded'}

>>> prj.get_node_list()
[{'id': 11,
  'name': 'Internet Source',
  'status': 'synchronized',
  'subtype': 'INET',
  'type': 'DataSource'},
 {'id': 12,
  'name': 'Python',
  'status': 'synchronized',
  'subtype': 'Python',
  'type': 'Dataset'}]

View the examples directory for more code snippets.

License

This project is licensed under the MIT License - see the LICENSE file for details