AsyncPywhatKit.src.Core package

Submodules

AsyncPywhatKit.src.Core.core module

class AsyncPywhatKit.src.Core.core.Box(left, top, width, height, score)

Bases: tuple

height

Alias for field number 3

left

Alias for field number 0

score

Alias for field number 4

top

Alias for field number 1

width

Alias for field number 2

async AsyncPywhatKit.src.Core.core.check_connection() None[source]

Check the Internet connection of the Host Machine

async AsyncPywhatKit.src.Core.core.check_number(number: str) bool[source]

Checks if the Number is Valid or not

async AsyncPywhatKit.src.Core.core.close_tab(wait_time: int = 2) None[source]

Closes the Currently Opened Browser Tab

async AsyncPywhatKit.src.Core.core.find_document()[source]
async AsyncPywhatKit.src.Core.core.find_photo_or_video()[source]
async AsyncPywhatKit.src.Core.core.find_pool()[source]
AsyncPywhatKit.src.Core.core.find_recent_chat()[source]
async AsyncPywhatKit.src.Core.core.findtextbox() None[source]

click on text box

AsyncPywhatKit.src.Core.core.loadImage(img2load, gray: bool)[source]
AsyncPywhatKit.src.Core.core.locateMax_opencv(template: str, screenImage: str, grayscale: bool = False, confidence=0.9, multiscale=False) Box[source]

Locate button using cv2.TemplateMatching algorithm

Parameters:
  • template (str) – The file location of the template image

  • screenImage (PIL.Image) – The screenshot done using pyscreeze

  • grayscale (bool) – Flag to run template matching using grayscale image

  • confidence (float) – Confidence Threshold

  • mulstiscale (bool) – Flag to run mulstiscale template matching from 1 to 0.8

Returns:

a tuple of (x,y,w,h) of the best match

Return type:

Box

AsyncPywhatKit.src.Core.core.locateOnScreen(image, **kwargs)[source]

Locate button on screen using cv2.TemplateMatching algorithm

Parameters:
  • image (str) – The file location of the template image

  • grayscale (bool) – Flag to run template matching using grayscale image

  • confidence (float) – Confidence Threshold

  • mulstiscale (bool) – Flag to run mulstiscale template matching from 1 to 0.8

Returns:

a tuple of (x,y,w,h) of the best match

Return type:

Box

async AsyncPywhatKit.src.Core.core.send_message(message: str, receiver: str, wait_time: int) None[source]

Parses and Sends the Message

AsyncPywhatKit.src.Core.exceptions module

exception AsyncPywhatKit.src.Core.exceptions.CallTimeException[source]

Bases: Exception

Wait time is too short for WhatsApp Web to Open

exception AsyncPywhatKit.src.Core.exceptions.CountryCodeException[source]

Bases: Exception

Country Code is not present in the Phone Number

exception AsyncPywhatKit.src.Core.exceptions.ImageNotFoundException[source]

Bases: Exception

No image was finded while searching with template matching algorithm

exception AsyncPywhatKit.src.Core.exceptions.InternetException[source]

Bases: Exception

Host machine is not connected to the Internet or the connection Speed is Slow

exception AsyncPywhatKit.src.Core.exceptions.InvalidPhoneNumber[source]

Bases: Exception

Phone number given is invalid

exception AsyncPywhatKit.src.Core.exceptions.UnableToAccessApi[source]

Bases: Exception

unable to access pywhatkit api

exception AsyncPywhatKit.src.Core.exceptions.UnsupportedEmailProvider[source]

Bases: Exception

Email provider used to send the Email is not supported

AsyncPywhatKit.src.Core.log module

async AsyncPywhatKit.src.Core.log.format_message(message: str) str[source]

Formats the Message to remove redundant Spaces and Newline chars

async AsyncPywhatKit.src.Core.log.log_image(_time: struct_time, path: str, receiver: str, caption: str) None[source]

Logs the Image Information after it is Sent

async AsyncPywhatKit.src.Core.log.log_message(_time: struct_time, receiver: str, message: str) None[source]

Logs the Message Information after it is Sent

Module contents