2024-11-05 22:21:35 -08:00
.. These are examples of badges you might want to add to your README:
please update the URLs accordingly
.. image :: https://api.cirrus-ci.com/github/<USER>/pylibmeshctrl.svg?branch=main
:alt: Built Status
:target: https://cirrus-ci.com/github/<USER>/pylibmeshctrl
.. image :: https://readthedocs.org/projects/pylibmeshctrl/badge/?version=latest
:alt: ReadTheDocs
:target: https://pylibmeshctrl.readthedocs.io/en/stable/
.. image :: https://img.shields.io/coveralls/github/<USER>/pylibmeshctrl/main.svg
:alt: Coveralls
:target: https://coveralls.io/r/<USER>/pylibmeshctrl
.. image :: https://img.shields.io/pypi/v/pylibmeshctrl.svg
:alt: PyPI-Server
:target: https://pypi.org/project/pylibmeshctrl/
.. image :: https://img.shields.io/conda/vn/conda-forge/pylibmeshctrl.svg
:alt: Conda-Forge
:target: https://anaconda.org/conda-forge/pylibmeshctrl
.. image :: https://pepy.tech/badge/pylibmeshctrl/month
:alt: Monthly Downloads
:target: https://pepy.tech/project/pylibmeshctrl
.. image :: https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Twitter
:alt: Twitter
:target: https://twitter.com/pylibmeshctrl
.. image :: https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold
:alt: Project generated with PyScaffold
:target: https://pyscaffold.org/
|
meshctrl
2024-12-02 11:47:45 -08:00
========
2024-11-05 22:21:35 -08:00
2024-12-02 11:47:45 -08:00
Library for remotely interacting with a
`MeshCentral <https://meshcentral.com/> `__ server instance
2024-11-05 22:21:35 -08:00
2024-12-02 11:47:45 -08:00
Installation
------------
2024-11-05 22:21:35 -08:00
2024-12-13 17:10:34 -08:00
pip install libmeshctrl
2024-12-02 11:47:45 -08:00
Usage
-----
This module is implemented as a primarily asynchronous library
2024-12-02 13:39:40 -08:00
(asyncio), mostly through the `Session <https://pylibmeshctrl.readthedocs.io/en/latest/api/meshctrl.html#meshctrl.session.Session> `__ class. Because the library is asynchronous, you must wait for it to be
2024-12-02 11:47:45 -08:00
initialized before interacting with the server. The preferred way to do
this is to use the async context manager pattern:
.. code :: python
import meshctrl
2024-12-02 13:39:40 -08:00
async with meshctrl.Session(url, **options):
2024-12-02 11:47:45 -08:00
print(await session.list_users())
2024-12-02 11:52:52 -08:00
...
2024-12-02 11:47:45 -08:00
However, if you prefer to instantiate the object yourself, you can
2024-12-02 13:39:40 -08:00
simply use the `initialized <https://pylibmeshctrl.readthedocs.io/en/latest/api/meshctrl.html#meshctrl.session.Session.initialized> `__ property:
2024-12-02 11:47:45 -08:00
.. code :: python
2024-12-02 13:41:16 -08:00
session = meshctrl.Session(url, **options)
2024-12-02 11:47:45 -08:00
await session.initialized.wait()
Note that, in this case, you will be rquired to clean up tho session
2024-12-02 13:39:40 -08:00
using its `close <https://pylibmeshctrl.readthedocs.io/en/latest/api/meshctrl.html#meshctrl.session.Session.close> `__ method.
2024-12-02 11:47:45 -08:00
Session Parameters
------------------
`` url `` : URL of meshcentral server to connect to. Should start with
either "ws://" or "wss://".
`` options `` : optional parameters. Described at `Read the
Docs <https://pylibmeshctrl.readthedocs.io/en/latest/api/meshctrl.html#module-meshctrl.session>`__
API
---
API is documented in the `API
2024-12-02 11:52:52 -08:00
Docs <https://pylibmeshctrl.readthedocs.io/en/latest/api/meshctrl.html>`__
2024-11-05 22:21:35 -08:00
.. _pyscaffold-notes:
Note
====
This project has been set up using PyScaffold 4.6. For details and usage
information on PyScaffold see https://pyscaffold.org/.