glances_api 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glances_api-0.3.3 → glances_api-0.3.4}/LICENSE +1 -1
- {glances_api-0.3.3 → glances_api-0.3.4}/PKG-INFO +9 -1
- {glances_api-0.3.3 → glances_api-0.3.4}/README.rst +8 -0
- {glances_api-0.3.3 → glances_api-0.3.4}/glances_api/__init__.py +9 -1
- {glances_api-0.3.3 → glances_api-0.3.4}/pyproject.toml +1 -1
- {glances_api-0.3.3 → glances_api-0.3.4}/setup.py +2 -2
- {glances_api-0.3.3 → glances_api-0.3.4}/glances_api/exceptions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-2022 Fabian Affolter <fabian@affolter-engineering.ch>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: glances-api
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Python API for interacting with Glances
|
|
5
5
|
Home-page: https://github.com/home-assistant-ecosystem/python-glances-api
|
|
6
6
|
License: MIT
|
|
@@ -44,6 +44,14 @@ Or on a Fedora-based system or on a CentOS/RHEL machine with has EPEL enabled.
|
|
|
44
44
|
|
|
45
45
|
$ sudo dnf -y install python3-glances-api
|
|
46
46
|
|
|
47
|
+
|
|
48
|
+
For Nix or NixOS is `pre-packed module <https://search.nixos.org/packages?channel=unstable&query=glances-api>`_
|
|
49
|
+
available. The lastest release is usually present in the ``unstable`` channel.
|
|
50
|
+
|
|
51
|
+
.. code:: bash
|
|
52
|
+
|
|
53
|
+
$ nix-env -iA nixos.python3Packages.glances-api
|
|
54
|
+
|
|
47
55
|
Usage
|
|
48
56
|
-----
|
|
49
57
|
|
|
@@ -20,6 +20,14 @@ Or on a Fedora-based system or on a CentOS/RHEL machine with has EPEL enabled.
|
|
|
20
20
|
|
|
21
21
|
$ sudo dnf -y install python3-glances-api
|
|
22
22
|
|
|
23
|
+
|
|
24
|
+
For Nix or NixOS is `pre-packed module <https://search.nixos.org/packages?channel=unstable&query=glances-api>`_
|
|
25
|
+
available. The lastest release is usually present in the ``unstable`` channel.
|
|
26
|
+
|
|
27
|
+
.. code:: bash
|
|
28
|
+
|
|
29
|
+
$ nix-env -iA nixos.python3Packages.glances-api
|
|
30
|
+
|
|
23
31
|
Usage
|
|
24
32
|
-----
|
|
25
33
|
|
|
@@ -22,6 +22,7 @@ class Glances(object):
|
|
|
22
22
|
verify_ssl=True,
|
|
23
23
|
username=None,
|
|
24
24
|
password=None,
|
|
25
|
+
httpx_client=None,
|
|
25
26
|
):
|
|
26
27
|
"""Initialize the connection."""
|
|
27
28
|
schema = "https" if ssl else "http"
|
|
@@ -33,13 +34,20 @@ class Glances(object):
|
|
|
33
34
|
self.username = username
|
|
34
35
|
self.password = password
|
|
35
36
|
self.verify_ssl = verify_ssl
|
|
37
|
+
self.httpx_client = httpx_client
|
|
36
38
|
|
|
37
39
|
async def get_data(self, endpoint):
|
|
38
40
|
"""Retrieve the data."""
|
|
39
41
|
url = "{}/{}".format(self.url, endpoint)
|
|
40
42
|
|
|
43
|
+
httpx_client = (
|
|
44
|
+
self.httpx_client
|
|
45
|
+
if self.httpx_client
|
|
46
|
+
else httpx.AsyncClient(verify=self.verify_ssl)
|
|
47
|
+
)
|
|
48
|
+
|
|
41
49
|
try:
|
|
42
|
-
async with
|
|
50
|
+
async with httpx_client as client:
|
|
43
51
|
if self.password is None:
|
|
44
52
|
response = await client.get(str(url))
|
|
45
53
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "glances_api"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.4"
|
|
4
4
|
description = "Python API for interacting with Glances"
|
|
5
5
|
authors = ["Fabian Affolter <fabian@affolter-engineering.ch>"]
|
|
6
6
|
homepage = "https://github.com/home-assistant-ecosystem/python-glances-api"
|
|
@@ -12,9 +12,9 @@ install_requires = \
|
|
|
12
12
|
|
|
13
13
|
setup_kwargs = {
|
|
14
14
|
'name': 'glances-api',
|
|
15
|
-
'version': '0.3.
|
|
15
|
+
'version': '0.3.4',
|
|
16
16
|
'description': 'Python API for interacting with Glances',
|
|
17
|
-
'long_description': 'python-glances-api\n==================\n\nA Python client for interacting with `Glances <https://nicolargo.github.io/glances/>`_.\n\nThis module is not official, developed, supported or endorsed by Glances.\n\nInstallation\n------------\n\nThe module is available from the `Python Package Index <https://pypi.python.org/pypi>`_.\n\n.. code:: bash\n\n $ pip3 install glances_api\n\nOr on a Fedora-based system or on a CentOS/RHEL machine with has EPEL enabled.\n\n.. code:: bash\n\n $ sudo dnf -y install python3-glances-api\n\nUsage\n-----\n\nThe file ``example.py`` contains an example about how to use this module.\n\nLicense\n-------\n\n``python-glances-api`` is licensed under MIT, for more details check LICENSE.\n',
|
|
17
|
+
'long_description': 'python-glances-api\n==================\n\nA Python client for interacting with `Glances <https://nicolargo.github.io/glances/>`_.\n\nThis module is not official, developed, supported or endorsed by Glances.\n\nInstallation\n------------\n\nThe module is available from the `Python Package Index <https://pypi.python.org/pypi>`_.\n\n.. code:: bash\n\n $ pip3 install glances_api\n\nOr on a Fedora-based system or on a CentOS/RHEL machine with has EPEL enabled.\n\n.. code:: bash\n\n $ sudo dnf -y install python3-glances-api\n\n\nFor Nix or NixOS is `pre-packed module <https://search.nixos.org/packages?channel=unstable&query=glances-api>`_\navailable. The lastest release is usually present in the ``unstable`` channel.\n\n.. code:: bash\n\n $ nix-env -iA nixos.python3Packages.glances-api\n\nUsage\n-----\n\nThe file ``example.py`` contains an example about how to use this module.\n\nLicense\n-------\n\n``python-glances-api`` is licensed under MIT, for more details check LICENSE.\n',
|
|
18
18
|
'author': 'Fabian Affolter',
|
|
19
19
|
'author_email': 'fabian@affolter-engineering.ch',
|
|
20
20
|
'maintainer': None,
|
|
File without changes
|