fzutility is a package that provides various utilities for python programming.
Project description
Funzin VC solution team Utils packages
How to use
Logger
To use the logger package, follow these steps:
-
Import the logger module:
from fz_logger.fz_logger import Logger
-
Create a Logger object in class:
class template(Logger): def __init__(self): super().__init__(level=config["logger"]["level"], save_path=config["logger"]["save_path"]) ...
self.logger.debug("This is a debug message") self.logger.info("This is an info message") self.logger.warning("This is a warning message") self.logger.error("This is an error message") self.logger.critical("This is a critical message")
-
Create a Logger object in not class:
logger = Logger(level="INFO", save_path="app-logs").logger ...
logger.debug("This is a debug message") logger.info("This is an info message") logger.warning("This is a warning message") logger.error("This is an error message") logger.critical("This is a critical message")
MQTT
This module provides a MQTT client implementation. follow these steps:
-
Import the mqttc lient module:
from fz_mqtt.fz_mqtt import MqttClient
-
Create a MqttClient object in class:
config = { "mqtt": { "id": "mqtt_id" "pw": "mqtt_pw" "host": "mqtt_host" "port": 1883 "qos": 1 "pub-topic": "insert your topic" "sub-topic": "insert your topic" } } mqtt_client = MqttTools(config=config)
-
Publish message
self.mqtt_client.pub_message( topic=config["mqtt"]["pub-topic"], msg="your message, )
-
Subscribe message
import threading sub_mqtt = MqttServerClient(config=opt) subscriber_th = threading.Thread(target=sub_mqtt.sub_message, daemon=True) subscriber_th.start()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fzutility-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fzutility-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d74b3972dd11a74f681708622f9832e9c43b0725a51e583fa74debfc51500da3
|
|
| MD5 |
53fa19e957cbb554d92b177993981003
|
|
| BLAKE2b-256 |
1ffae01923c38f69a4714e976b458496835d54cc3781cf4414561155144780af
|