Waiting Time Calculation for Automations Based on WiFi and PC Processing
Project description
<<<<<<< HEAD
Nano-Wait Library Documentation
Overview
The Nano-Wait library is designed to automate PC tasks by dynamically calculating the wait time between actions based on system performance and WiFi signal strength. This library is particularly useful for scripting and automation tasks where timing is critical, and variations in system resources and network conditions can impact the execution of actions.
Installation
To use the Nano-Wait library, ensure that the necessary dependencies are installed:
pip install pywifi psutil
Initialization
Before using the Nano-Wait library, you need to create an instance of the PCAutomation class. This instance will provide methods to calculate wait times based on your PC's performance and WiFi signal strength.
from biblioteca import PCAutomation
# Initialize the automation
automation = PCAutomation()
Parameters
speed Type: int Range: 1 to 10 Description: This parameter controls the desired speed of automation. A value of 1 represents the slowest speed with the longest wait times, while a value of 10 represents the fastest speed with the shortest wait times. Adjust this parameter based on your specific requirements and system performance.
Main Functions
wait_wifi(speed) Description: Calculates the necessary wait time between actions when considering both PC performance and WiFi signal strength. Parameters: speed (int): A value between 1 and 10 that controls the speed of automation. Returns: The calculated wait time in seconds as a float.
Below is an example of how to use the Nano-Wait library in a Python automation script:
import pyautogui
import time
from biblioteca import PCAutomation
# Initialize the automation
automation = PCAutomation()
# Set the desired speed of automation
speed = 1
# Press the Windows key and wait for the appropriate time
wait_time = automation.wait_n_wifi(speed=speed)
pyautogui.press('win')
time.sleep(wait_time)
# Type 'chrome' and wait for the appropriate time
wait_time = automation.wait_n_wifi(speed=speed)
pyautogui.write('chrome', interval=0.1)
time.sleep(wait_time)
# Press 'Enter' to open Chrome and wait for the appropriate time
wait_time = automation.wait_wifi(speed=speed)
pyautogui.press('enter')
time.sleep(wait_time) # Wait for Chrome to open
# Type the URL of YouTube and wait for the appropriate time
wait_time = automation.wait_wifi(speed=speed)
pyautogui.write('youtube.com', interval=0.1)
time.sleep(wait_time)
# Press 'Enter' to go to YouTube and wait for the appropriate time
wait_time = automation.wait_n_wifi(speed=speed)
pyautogui.press('enter')
Detailed Functionality
get_wifi_signal()
Description: Scans the available WiFi networks and returns a score (0-10) based on the signal strength of a specified WiFi network.
Internal Usage: Used within the wait_wifi function to determine the WiFi score.
get_pc_score()
Description: Computes a score (0-10) based on CPU and memory usage, indicating the PC's performance.
Internal Usage: Used within both wait_wifi and wait_n_wifi functions to determine the PC performance score.
Conclusion
The Nano-Wait library provides a simple yet powerful way to manage wait times in PC automation scripts by dynamically adjusting based on system and network conditions. By configuring the speed parameter, users can control the pace of automation to match their specific needs.
=======
NanoWait
NanoWait é uma biblioteca Python para automação de tarefas com ajuste dinâmico do tempo de espera com base na qualidade da conexão WiFi e no desempenho do computador. É ideal para situações onde o tempo de espera deve ser ajustado de acordo com a condição da rede e do sistema para garantir que as operações de automação sejam executadas suavemente.
Requisitos Antes de usar o NanoWait, você deve instalar as seguintes bibliotecas:
pywifi: Para verificar a qualidade do sinal WiFi.
psutil: Para monitorar o desempenho do sistema.
pyautogui: Para realizar ações de automação no computador.
Principais Funções wait_wifi: Ela deve ser passada junto com speed e ssid. Ela calcula o tempo de espera considerando o Wifi e o processamento do PC. wait_n_wifi: Ela deve ser passada junto com speed. Ela calcula o tempo de espera considerando o processamento do PC no momento.
01ab9c961b388fc5b69865a3b28d04b4be6679c2
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file nano_wait-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: nano_wait-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2adc6c435a2cdf445a1dfc6004772ccfb74ce0b5a0ae68fecc1b40a1e18a223 |
|
MD5 | f33ff8bddb84ea7c5dfa6050c63557c3 |
|
BLAKE2b-256 | 830081298eb3cd32a064a5eb2e5f2a92f8ec327337501af5eee7ca2afbbf97e9 |