Основные сведения
Библиотека предназначена для работы с Polymatica API.
Офлайн-установка
Архив зависимостей для CPython 3.6-3.14 на Linux x86_64:
https://repo.polymatica.ru/analytics/releases/python-deps/polyapi-wheels.tar.gz
Контрольная сумма архива:
https://repo.polymatica.ru/analytics/releases/python-deps/polyapi-wheels.tar.gz.sha256
Проверьте архив до распаковки:
sha256sum -c polyapi-wheels.tar.gz.sha256
tar -xzf polyapi-wheels.tar.gz
Дальнейшая установка описана в файле INSTALL.txt внутри распакованного архива, в каталоге python-deps.
Работа с библиотекой
Основным модулем бизнес-логики является файл business_scenarios.py,
импортировать который можно с помощью команды from polymatica import business_scenarios as sc.
Модуль предоставляет два класса для работы с Полиматикой - BusinessLogic и GetDataChunk.
Методы этих классов можно посмотреть при помощи стандартной функции dir().
Аргументы функций и прочую docstring-документацию модуля и функций можно посмотреть
при помощи стандартной функции help().
Инициализация нового клиентского подключения:
session = sc.BusinessLogic(login="your_login", password="your_password", url="polymatica_server_url", **args)
Пример создания слоя и воспроизведения сценария на этом слое с использованием PolyAPI
Создадим слой:
session.execute_manager_command(command_name="user_layer", state="create_layer")
Запросим список сценариев:
session.execute_manager_command(command_name="scripts", state="get_script_descriptions_list")
Загрузим сценарий на слой, используя полученные на предыдущих шагах идентификаторы слоя и сценария:
session.execute_manager_command(command_name="scripts", state="load_on_layer", runtime_id="d46b7075", script_id="40fc65db", on_load_action=0)
Воспроизведем сценарий:
session.execute_manager_command(command_name="scripts", state="play_to_position", runtime_id="d46b7075", script_id="40fc65db", play_to_position=23, clear_workspace=True)
Получим статус воспроизведения сценария:
session.execute_manager_command(command_name="scripts", state="get_script_status", runtime_id="d46b7075")
Получили ответ, из которого видим, что сценарий воспроизведен успешно:
{'state': 1, 'queries': [{'uuid': '872bdbde-20b9f734-2a5a5ad5-9b08e670', 'command': {'plm_type_code': 227, 'state': 6, 'script_status': {'id': '40fc65db', 'action_name': '', 'status': 3, 'current_step': 24, 'steps_count': 24, 'errors': []}}}]}
Получим информацию о слое:
session.execute_manager_command(command_name="user_layer", state="get_layer", layer_id="d46b7075")
Metadata
Release files for polyapi 5.9.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polyapi-5.9.25.tar.gz | 198.0 kB | Without provenance | Details for polyapi-5.9.25.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polyapi-5.9.25-py3-none-any.whl | Python 3 | none | any | Details for polyapi-5.9.25-py3-none-any.whl |
Total release size: 406.6 kB
Release files / polyapi-5.9.25.tar.gz
| Download URL | polyapi-5.9.25.tar.gz |
|---|---|
| Size | 198.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55cc7d0a55e7f78c1c0ed3b69f2bce1d27206044d1b8112e4ea3c8a8de29a493
|
|
BLAKE2b-256 checksum How to use checksums |
7ad076011126a015d022b2ea088d4932ff4a87b346aabf5039dc8b7978cb7ab8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / polyapi-5.9.25-py3-none-any.whl
| Download URL | polyapi-5.9.25-py3-none-any.whl |
|---|---|
| Size | 208.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a17d36462f2c3e71dc9e4a8544c44137f1e9579f9587b4e0f8a191ad6c477d63
|
|
BLAKE2b-256 checksum How to use checksums |
dc2e0c422ce408139ae472c479bb0e61b1e0359d98ac308b54ea462c65d5ac8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for polyapi 5.9.25
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.