Skip to main content

Python Notification library integrated with PyQt6

Project description

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

NotifyUI

A python lib to help make easy and crazy notifications.

Example

from NotifyUI import NotifyElements

app=NotifyElements.NotifyApplication()
NotifyText(app.window,10,10,"Notify Elements",font=QtGui.QFont("Segoe UI",10,QtGui.QFont.Weight.Normal))
NotifyText(app.window,10,40,"Hello world!",font=QtGui.QFont("Segoe UI",13,QtGui.QFont.Weight.Bold))
NotifyText(app.window,10,70,"Extra text",font=QtGui.QFont("Segoe UI",10,QtGui.QFont.Weight.Normal),color="#a5a5a5")
app.window.setCloseClick(True)
app.send_notification()

Or to simply send a windows 10 inspired notification

from NotifyUI import NotifyElements

NotifyElements.sendWinStyleNotify("Notify Elements","Hello World","This is a test message.")

Default functions


sendWinStyleNotify(app_name,title,msg,fadeTime):

  • Sends a windows 10 inspired style notification.
    app_name: the name of the application.
    title: the title of the notification.
    msg: the message of the notification.
    fadeTime: the fade time of the notificaion. (Must be a QTime object)
    e.g. "Notify Elements","Hello World","This is a test message."
  • Note: This function is a thread. So it won't block the main thread.

Methods of classes

NotifyApplication


send_notification():

  • This sends the notification which you have created so far.

NotifyWindow


setWindowTopLeft():

  • Set the window to the top left of the screen.

setWindowTopRight():

  • Set the window to the top right of the screen.

setWindowBottomLeft():

  • Set the window to the bottom left of the screen.

setWindowBottomRight():

  • Set the window to the BottomRight of the screen.

setBackgroundColor(color):

  • Set the background color of the window.
    color: the color in string format.
    e.g. red or #ff0000 or rgb(255,0,0) or rgba(255,0,0,0.5)

appendStyle(property,value):

  • Append a style to the style sheet.
    property: the property of the style.
    e.g. background-color or border-radius value: the value of the property.
    e.g. red or 10px or rgba(255,0,0,0.5)

addTextElement(x,y,text,font,color):

  • x: x position of the text element inside the window
    y: y position of the text element inside the window
    text: string to be displayed
    font: style of the font (Must be QFont object)
    color: input hex color or rgb() for the color of text
  • Note: the font and color input are optional as they do have a default value

setCloseClick(value):

  • If true, the notification would close when left clicked.
  • Default:- false

setPadding(value):

  • Set the padding of the window.
    value: the padding in pixels.
    e.g. 10 or 20 or 30.
  • Default: 10

setFadeAwayTime(value):

  • Set the fade away time of the window.
    fadeTime: the fade away time in milliseconds.
    e.g. 1000 or 2000 or 3000.
  • Default:- 500

setFadeAtClick(value):

  • Toggle if the window should fade away when left clicked.
    value: True or False.
  • Default: True

autoFade(fade_time):

  • Automatically fade away after the specified time.
    fade_time: the fade time. (Must be a QTime object)

NotifyText


setBackgroundColor(color):

  • Set the background color of the window.
    color: the color in string format.
    e.g. "red" or "#ff0000" or "rgb(255,0,0)" or "rgba(255,0,0,0.5)"

appendStyle(property,value):

  • Append a style to the style sheet.
    property: the property of the style.
    e.g. "background-color" or "border-radius"
    value: the value of the property.
    e.g. "red" or "10px" or "rgba(255,0,0,0.5)"

setFadeAtClick(value):

  • Toggle if the element should fade away when left clicked. value: True or False.
  • Default: True

setFadeAwayTime(value):

  • Set the fade away time of the window.
    fadeTime: the fade away time in milliseconds.
    e.g. 1000 or 2000 or 3000.
  • Default:- 500

NotifyTimer


__init__(call_at_end,end_qtime,*args,**kwargs):

  • This class runs the function passed after the specified time.
    call_at_end: the function to be called after the specified time.
    end_qtime: the time after which the function is called. (Should be a QTime object)
    args: the arguments to be passed to the function.
    kargs: the keyword arguments to be passed to the function.

  • Note:- Declare this as a variable to keep the timer alive.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NotifyUI-0.0.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

NotifyUI-0.0.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file NotifyUI-0.0.3.tar.gz.

File metadata

  • Download URL: NotifyUI-0.0.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for NotifyUI-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fe249cc0558467b50f8c5e096567db0065ca26ff8a2226a22bdeadaf66608186
MD5 ca575998ed84c673d67bf7dcf87bc535
BLAKE2b-256 c33b0783e593b8ecda37d36a5839d3a4f8aa9f2a7cfd54951eb5ba5f4b86c0cd

See more details on using hashes here.

File details

Details for the file NotifyUI-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: NotifyUI-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for NotifyUI-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e4fdf14f07352a5e180c27a67b661472facdf5965cf8282f8be36da38c95467d
MD5 c18f8dfe0ecb581a625db562ad40451b
BLAKE2b-256 f6c29027e9459305568b30cbd014eb378a7a81f705b2ff1b0c74496b4d2a0cf0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page