| Name | ansys-platform-instancemanagement JSON |
| Version |
1.1.2
JSON |
| download |
| home_page | |
| Summary | A Python wrapper for Ansys platform instancemanagement |
| upload_time | 2023-08-10 09:00:57 |
| maintainer | |
| docs_url | None |
| author | |
| requires_python | >=3.8 |
| license | |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
=====
PyPIM
=====
|pyansys| |PyPI| |codecov| |CI| |MIT| |black|
.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
:target: https://docs.pyansys.com/
:alt: PyAnsys
.. |PyPI| image:: https://img.shields.io/pypi/v/ansys-platform-instancemanagement
:target: https://pypi.org/project/ansys-platform-instancemanagement/
:alt: PyPI
.. |codecov| image:: https://codecov.io/gh/pyansys/pypim/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pyansys/pypim
:alt: Code Coverage
.. |CI| image:: https://github.com/pyansys/pypim/actions/workflows/ci_cd.yml/badge.svg
:target: https://github.com/pyansys/pypim/actions/workflows/ci_cd.yml
:alt: GitHub Workflow Status (branch)
.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT License
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat
:target: https://github.com/psf/black
:alt: black
`PyPIM <https://pypim.docs.pyansys.com>`_ exposes a Pythonic interface to
communicate with the Product Instance Management (PIM) API.
What is the PIM API?
============================================
The PIM API is a gRPC API, enabling both library and app developers to
start a product in a remote environment and communicate with its API.
The PIM API is intended to be as simple as possible to be adaptable in a variety of
network and software infrastructures. Using this API does not require any
knowledge of its infrastructure. You need only know which product to
start and which API the product exposes. The PIM API itself exposes very few
features and assumes that all the configuration is set on a server.
The PIM API is not intended to manage stateless services, to be a job management
system, or a fully featured service orchestration API. Its purpose is to expose
a minimum feature set for managing service-oriented apps.
Getting started
===============
To use PyPIM, you must have access to the PIM API.
.. note::
The PIM API is a work in progress. Even though the API definition and the
PyPIM client are published, the service itself is not publicly exposed.
PyPIM itself is pure Python and relies on `gRPC`_.
.. _`gRPC`: https://grpc.io/
Installation
------------
The ``ansys-platform-instancemanagement`` package is tested for Python 3.7 through
Python 3.10 on Windows and Linux.
.. code-block::
pip install ansys-platform-instancemanagement
Configuration
-------------
By default, PyPIM is configured externally instead of via code. Anywhere in the
local storage, create a configuration file with this format:
.. code-block:: json
{
"version": 1,
"pim": {
"uri": "dns:pim.svc.com:80",
"headers": {
"metadata-info": "value"
},
"tls": false
}
}
Then, define the environment variable
``ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG`` to point to this configuration file.
Usage
-----
PyPIM is a single module called ``ansys.platform.instancemanagement``, shortened
to ``pypim``.
To start MAPDL and communicate with PyPIM, use this code:
.. code-block:: python
import ansys.platform.instancemanagement as pypim
from ansys.mapdl.core import Mapdl
if pypim.is_configured():
with pypim.connect() as pim:
with pim.create_instance(
product_name="mapdl", product_version="221"
) as instance:
instance.wait_for_ready()
channel = instance.build_grpc_channel(
options=[("grpc.max_receive_message_length", 8 * 1024**2)]
)
mapdl = Mapdl(channel=channel)
mapdl.prep7()
...
You can also use PyPIM without the ``with`` statement, as shown in this code:
.. code-block:: python
import ansys.platform.instancemanagement as pypim
from ansys.mapdl.core import Mapdl
if pypim.is_configured():
pim = pypim.connect()
instance = pim.create_instance(product_name="mapdl", product_version="221")
channel = instance.build_grpc_channel(
options=[("grpc.max_receive_message_length", 8 * 1024**2)]
)
mapdl = Mapdl(channel=channel)
mapdl.prep7()
...
instance.delete()
pim.close()
Integration
-----------
PyPIM can be integrated in PyAnsys libraries to transparently switch to a remote
instance in a suitable environment. This process is described in `Integration <https://pypim.docs.pyansys.com/version/dev/integration.html>`_
in the PyPIM documentation.
For example, starting MAPDL with PyPIM is as simple as using this code:
.. code-block:: python
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()
Raw data
{
"_id": null,
"home_page": "",
"name": "ansys-platform-instancemanagement",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "\"ANSYS, Inc.\" <pyansys.core@ansys.com>",
"keywords": "",
"author": "",
"author_email": "\"ANSYS, Inc.\" <pyansys.core@ansys.com>",
"download_url": "https://files.pythonhosted.org/packages/10/16/c78dc035a3a357f0796e75b41aa7a77f6ff36f5866c57c3f99781ffc7bef/ansys_platform_instancemanagement-1.1.2.tar.gz",
"platform": null,
"description": "=====\nPyPIM\n=====\n|pyansys| |PyPI| |codecov| |CI| |MIT| |black|\n\n.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC\n :target: https://docs.pyansys.com/\n :alt: PyAnsys\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/ansys-platform-instancemanagement\n :target: https://pypi.org/project/ansys-platform-instancemanagement/\n :alt: PyPI\n\n.. |codecov| image:: https://codecov.io/gh/pyansys/pypim/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/pyansys/pypim\n :alt: Code Coverage\n\n.. |CI| image:: https://github.com/pyansys/pypim/actions/workflows/ci_cd.yml/badge.svg\n :target: https://github.com/pyansys/pypim/actions/workflows/ci_cd.yml\n :alt: GitHub Workflow Status (branch)\n\n.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg\n :target: https://opensource.org/licenses/MIT\n :alt: MIT License\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat\n :target: https://github.com/psf/black\n :alt: black\n\n`PyPIM <https://pypim.docs.pyansys.com>`_ exposes a Pythonic interface to\ncommunicate with the Product Instance Management (PIM) API.\n\nWhat is the PIM API?\n============================================\n\nThe PIM API is a gRPC API, enabling both library and app developers to\nstart a product in a remote environment and communicate with its API.\n\nThe PIM API is intended to be as simple as possible to be adaptable in a variety of\nnetwork and software infrastructures. Using this API does not require any\nknowledge of its infrastructure. You need only know which product to\nstart and which API the product exposes. The PIM API itself exposes very few\nfeatures and assumes that all the configuration is set on a server.\n\nThe PIM API is not intended to manage stateless services, to be a job management\nsystem, or a fully featured service orchestration API. Its purpose is to expose\na minimum feature set for managing service-oriented apps.\n\nGetting started\n===============\nTo use PyPIM, you must have access to the PIM API.\n\n.. note::\n The PIM API is a work in progress. Even though the API definition and the\n PyPIM client are published, the service itself is not publicly exposed.\n\nPyPIM itself is pure Python and relies on `gRPC`_.\n\n.. _`gRPC`: https://grpc.io/\n\nInstallation\n------------\nThe ``ansys-platform-instancemanagement`` package is tested for Python 3.7 through\nPython 3.10 on Windows and Linux.\n\n.. code-block::\n\n pip install ansys-platform-instancemanagement\n\nConfiguration\n-------------\n\nBy default, PyPIM is configured externally instead of via code. Anywhere in the\nlocal storage, create a configuration file with this format:\n\n.. code-block:: json\n\n {\n \"version\": 1,\n \"pim\": {\n \"uri\": \"dns:pim.svc.com:80\",\n \"headers\": {\n \"metadata-info\": \"value\"\n },\n \"tls\": false\n }\n }\n\nThen, define the environment variable\n``ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG`` to point to this configuration file.\n\nUsage\n-----\nPyPIM is a single module called ``ansys.platform.instancemanagement``, shortened\nto ``pypim``.\n\nTo start MAPDL and communicate with PyPIM, use this code:\n\n.. code-block:: python\n\n import ansys.platform.instancemanagement as pypim\n from ansys.mapdl.core import Mapdl\n\n if pypim.is_configured():\n with pypim.connect() as pim:\n with pim.create_instance(\n product_name=\"mapdl\", product_version=\"221\"\n ) as instance:\n instance.wait_for_ready()\n channel = instance.build_grpc_channel(\n options=[(\"grpc.max_receive_message_length\", 8 * 1024**2)]\n )\n mapdl = Mapdl(channel=channel)\n mapdl.prep7()\n ...\n\nYou can also use PyPIM without the ``with`` statement, as shown in this code:\n\n.. code-block:: python\n\n import ansys.platform.instancemanagement as pypim\n from ansys.mapdl.core import Mapdl\n\n if pypim.is_configured():\n pim = pypim.connect()\n instance = pim.create_instance(product_name=\"mapdl\", product_version=\"221\")\n channel = instance.build_grpc_channel(\n options=[(\"grpc.max_receive_message_length\", 8 * 1024**2)]\n )\n mapdl = Mapdl(channel=channel)\n mapdl.prep7()\n ...\n instance.delete()\n pim.close()\n\nIntegration\n-----------\n\nPyPIM can be integrated in PyAnsys libraries to transparently switch to a remote\ninstance in a suitable environment. This process is described in `Integration <https://pypim.docs.pyansys.com/version/dev/integration.html>`_\nin the PyPIM documentation.\n\nFor example, starting MAPDL with PyPIM is as simple as using this code:\n\n.. code-block:: python\n\n from ansys.mapdl.core import launch_mapdl\n\n mapdl = launch_mapdl()\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A Python wrapper for Ansys platform instancemanagement",
"version": "1.1.2",
"project_urls": {
"Discussions": "https://github.com/ansys/pypim/discussions",
"Documentation": "https://pypim.docs.pyansys.com/",
"Issues": "https://github.com/ansys/pypim/issues",
"Releases": "https://github.com/ansys/pypim/releases",
"Source": "https://github.com/pyansys/pypim"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "141fa05b62b999ca895ea66e7dbc6242e8121ea578d71fff1055b6cea7e45a51",
"md5": "e2a1a99c75e1b121b43790f4d61e5f20",
"sha256": "52afe4755c4233985a1f5f33cdb2a163a53db5cee75f04c3a4e47fc81e1d0bb1"
},
"downloads": -1,
"filename": "ansys_platform_instancemanagement-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e2a1a99c75e1b121b43790f4d61e5f20",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 18470,
"upload_time": "2023-08-10T09:00:55",
"upload_time_iso_8601": "2023-08-10T09:00:55.390622Z",
"url": "https://files.pythonhosted.org/packages/14/1f/a05b62b999ca895ea66e7dbc6242e8121ea578d71fff1055b6cea7e45a51/ansys_platform_instancemanagement-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1016c78dc035a3a357f0796e75b41aa7a77f6ff36f5866c57c3f99781ffc7bef",
"md5": "6d1a0500ba56b93f33998ea01543a462",
"sha256": "940d7a27d26e4c6d1228da5e139948fc4b1388f7cc7c3f5356b2b3b41e8d7c48"
},
"downloads": -1,
"filename": "ansys_platform_instancemanagement-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "6d1a0500ba56b93f33998ea01543a462",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 15519,
"upload_time": "2023-08-10T09:00:57",
"upload_time_iso_8601": "2023-08-10T09:00:57.370651Z",
"url": "https://files.pythonhosted.org/packages/10/16/c78dc035a3a357f0796e75b41aa7a77f6ff36f5866c57c3f99781ffc7bef/ansys_platform_instancemanagement-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-10 09:00:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ansys",
"github_project": "pypim",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "ansys-platform-instancemanagement"
}