Skip to main content

TimelineNetworkUtility

A TimelineNetworkUtility is a small library that composing of Timeline and Network utility function. The timeline can help to manage the execution step of function. The useful of timeline is to help the embedded device to handle the sequence of the data reading from sensor. Which prevented the exceeding of reading speed limit of the hardware. The network utility provided the simple to use of some network function. Which include normal POST, base64 image POST, and client listening (SSE).

Usage

import TimelineNetworkUtility as STLS
import _thread as thread

def interval_time():
	pass;

def off_able():
	print('excute off_able');
	STLS.StepEnable("off_able", False);

def sensor1_read():
	print('read sensor1 data');

def sensor2_read():
	print('read sensor2 data');

def sensor_post():
	BodyP = {
    	'data': 'post data'
    };
    status, data = STLS.SendPOST(BodyP, ServerIP + ":" + ServerPORT, "/PostData.php");
    time = 15.0; # seconds
    off_able_enable = True;
    if not off_able_enable:
        STLS.ChangeStepTime("interval_time", round(time*10/2));
    else:
        STLS.StepEnable("off_able", True);

def image_post():
	BodyP = {
        "base64_image": base64_image
    };
	status, res = STLS.SendPOSTImage(BodyP, ServerIP + ":" + ServerPORT, "/PostImage.php");

def listen_to_server(thread_name, delay):
    try:
        STLS.StartPYTHONListen(ServerIP, ServerPORT, image_post, "/PythonListen.php");
    except KeyboardInterrupt:
        print("^C received, shutting down the listen");

try:
	thread.start_new_thread( listen_to_server, ("Thread-2", 2, ) );
except:
	print("Error: unable to start listen thread");

STLS.AddStep("interval_time", 25, interval_time, True);
STLS.AddStep("sensor1_read", 1, sensor1_read, True);
STLS.AddStep("sensor2_read", 1, sensor2_read, True);

STLS.AddStep("sensor_post", 1, LocalOperate, True);
STLS.AddStep("off_able", 30, off_able, False);
STLS.AddStep("interval_time", 25, interval_time, True);

STLS.EnableLoop(True);
STLS.Start();
STLS.Run();

Metadata

Release files for TimelineNetworkUtility-zzenlightenzz 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TimelineNetworkUtility-zzenlightenzz 0.1.6
File Size Uploaded
TimelineNetworkUtility-zzenlightenzz-0.1.6.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TimelineNetworkUtility-zzenlightenzz 0.1.6
File Interpreter ABI Platform
TimelineNetworkUtility_zzenlightenzz-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / TimelineNetworkUtility-zzenlightenzz-0.1.6.tar.gz

Download URL TimelineNetworkUtility-zzenlightenzz-0.1.6.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5c263d97f6c2fc06b31bed5c693ae5eda671d03254cccffa014d4700b73b6210
BLAKE2b-256 checksum
How to use checksums
26cbae2360c315d10b4813fb9ee8a85f25d08963aa81922add2ffad52fec2670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release files / TimelineNetworkUtility_zzenlightenzz-0.1.6-py3-none-any.whl

Download URL TimelineNetworkUtility_zzenlightenzz-0.1.6-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66ef2cada55fe1cd9c0880d9eb0bf836ba2f21d2d0f9648b0ce8744177a1df58
BLAKE2b-256 checksum
How to use checksums
43cd00efe991546dd3589d6b5a56a44d04af7cf4b5aaf9d758557dbf50e18af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page