lucos-loganne-pythonclient 1.0.2__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.
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: lucos_loganne_pythonclient
3
+ Version: 1.0.2
4
+ Summary: A python client for sending events to lucos_loganne
5
+ Classifier: Programming Language :: Python :: 3
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: requests>=2.28
9
+
10
+ # lucos_loganne_pythonclient
11
+ A python client for sending events to lucos_loganne
@@ -0,0 +1,2 @@
1
+ # lucos_loganne_pythonclient
2
+ A python client for sending events to lucos_loganne
@@ -0,0 +1,31 @@
1
+ import os, sys, requests
2
+ from datetime import datetime
3
+
4
+ try:
5
+ SYSTEM = os.environ["SYSTEM"]
6
+ except KeyError:
7
+ sys.exit("\033[91mSYSTEM environment variable not set\033[0m")
8
+ try:
9
+ LOGANNE_ENDPOINT = os.environ["LOGANNE_ENDPOINT"]
10
+ except KeyError:
11
+ sys.exit("\033[91mLOGANNE_ENDPOINT environment variable not set - needs to be the URL of a running lucos_loganne instance\033[0m")
12
+
13
+ session = requests.Session()
14
+ session.headers.update({
15
+ "User-Agent": SYSTEM,
16
+ "Content-Type": "application/json",
17
+ })
18
+
19
+ def updateLoganne(type: str, humanReadable: str, url: str = None):
20
+ payload = {
21
+ "type": type,
22
+ "source": SYSTEM,
23
+ "humanReadable": humanReadable,
24
+ }
25
+ if url:
26
+ payload["url"] = url
27
+ try:
28
+ loganne_response = session.post(LOGANNE_ENDPOINT, json=payload)
29
+ loganne_response.raise_for_status()
30
+ except Exception as error:
31
+ print("\033[91m [{}] ** Error calling Loganne: {}\033[0m".format(datetime.now().isoformat(), error), flush=True)
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: lucos_loganne_pythonclient
3
+ Version: 1.0.2
4
+ Summary: A python client for sending events to lucos_loganne
5
+ Classifier: Programming Language :: Python :: 3
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: requests>=2.28
9
+
10
+ # lucos_loganne_pythonclient
11
+ A python client for sending events to lucos_loganne
@@ -0,0 +1,8 @@
1
+ README.md
2
+ loganne.py
3
+ pyproject.toml
4
+ lucos_loganne_pythonclient.egg-info/PKG-INFO
5
+ lucos_loganne_pythonclient.egg-info/SOURCES.txt
6
+ lucos_loganne_pythonclient.egg-info/dependency_links.txt
7
+ lucos_loganne_pythonclient.egg-info/requires.txt
8
+ lucos_loganne_pythonclient.egg-info/top_level.txt
@@ -0,0 +1,16 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "lucos_loganne_pythonclient"
7
+ version = "1.0.2"
8
+ description = "A python client for sending events to lucos_loganne"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ classifiers = [
12
+ "Programming Language :: Python :: 3"
13
+ ]
14
+ dependencies = [
15
+ "requests>=2.28"
16
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+