Skip to main content

gchatUts

Biblioteca python para envio de mensagens formatadas via webHook do google chat

Uso

Importando a Biblioteca

from gchatUts import GChat

Criando uma Instância

from gchatUts import GChat,UiCard

g = GChat(webhook="SEU_WEB_HOOK")

#CRIA O CARD COM O TITULO E O ICONE APENAS
card = UiCard(
            title      = "Titulo do Processo",
            image_url  = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f699.png", #ICONE TDO TITULO
        )

#ENVIA A MENSAGEM SO COM O TITULO
g.send_card(card)

Base Card

Envios Simples

from gchatUts import GChat,UiCard
from gchatUts.sections import SectionSuccess,SectionWarn,SectionError

g = GChat(webhook="SEU_WEB_HOOK")

#SESSAO DE SUCESSO
successSection = SectionSuccess(
    title = "A tarefa foi concluída com sucesso.",
    text  = "Todos os processos foram validados."
)

#SESSAO DE ERRO
errorSection = SectionError(
    title = "A tarefa foi concluída com erro.",
    text  = '''Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type="email"]"}
  (Session info: chrome=140.0.7339.186); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
Stacktrace:
	GetHandleVerifier [0x0x7ff65c5c6b55+79621]
	Get'''
)

#SESSAO WARN
warnSection = SectionWarn(
    title = "A tarefa foi com alertas.",
    text  = "Atençao...."
)
#CRIA O CARD COM O TITULO E O ICONE APENAS
card = UiCard(
            title     = "Titulo do Processo",
            image_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f699.png", #ICONE TDO TITULO
            sections  = [successSection,errorSection,warnSection] #ADCIONA AS SECOES ABAIXO DO TITULO
        )

card.send()

Logo do Robô

Criando Resumo RPA

from gchatUts.sections import *
from gchatUts.uikit import UiButton
from gchatUts import UiCard


#CRIA O RESUMO
sectionResumo = SectionResumo(
            data_start = "23/12/1991",   #DATA DE EXECUCAO
            hora_start = "18:43:02",     #HORA DE INICIO
            hora_end   = "19:20:45",     #HORA DE TERMINO
            duracao    = "00:37:57",     #TEMPO DE EXECUCAO
            target     = f"5 / 10",      #QUANTOS ITENS CONCLUIDOS
            maquina    = True
)

resume_card = UiCard(
            title     = "Titulo do Processo",
            subtitle  = "subtitulo aqui", 
            image_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f699.png", #ICONE TDO TITULO
            sections  = [sectionResumo]
        )

g.send_card(resume_card)

Logo do Robô

Exemplos de Texto

from gchatUts import GChat,UiCard
from gchatUts.sections import SectionText

textSection = SectionText(
    title = "Texto Simples", #OPCIONAL
    text  = "Texto de exemplo\nOutro texto\nFim"
)
textSection2 = SectionText(
    text  = "Texto sem titulo"
)
textSection3 = SectionText(
    title    = "Texto Simples",              #OPCIONAL
    text     = "Texto de exemplo com Icone",
    icon_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f916.png"
)

textSection4 = SectionText(
    title    = "Texto Simples",                                                                          #OPCIONAL
    text     = "Texto de exemplo com Botoes a direita",
    icon_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f916.png",
    right_button = UiButton(text="Google",url="https://www.google.com")
)

textSection5 = SectionText(
    title    = "Texto Simples",                                                                          #OPCIONAL
    text     = "Texto de exemplo com Botoes a baixo",
    icon_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f916.png",
    bottom_buttons= [
        UiButton(text="Google",url="https://www.google.com"),
        UiButton(text="Youtube",url="https://www.youtube.com"),
        ]
)

#CRIA O CARD COM O TITULO E O ICONE APENAS
text_card = UiCard(
            title     = "Titulo do Processo",
            subtitle  = "subtitulo aqui", 
            image_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f699.png", #ICONE TDO TITULO
            sections=[textSection,textSection2,textSection3,textSection4,textSection5]
        )

g.send_card(text_card)

Logo do Robô

Exemplo de ETAPA

from gchatUts import GChat,UiCard
from gchatUts.sections import SectionEtapa

#CRIA O OBJETO DAS ETAPAS COM A COLUNA DE CADA ETAPA E ATRIBUI UM ID PARA CADA
sectionEtapa = SectionEtapa(
            [
                Etapa(titulo="step1",icone="✈️",id_etapa="1"),
                Etapa(titulo="step2",icone="➕",id_etapa="2"),
                Etapa(titulo="step3",icone="🛡️",id_etapa="3"),
                Etapa(titulo="step4",icone="⬆️",id_etapa="4"),
                Etapa(titulo="step5",icone="⚖️",id_etapa="5")
            ]
        )

#ADCIONA UM ITEM NA LISTA
sectionEtapa.add_job(
                descricao = "NOME DO PROCESSO",
                etapas = [
                    ItemEtapa(id_etapa='1',   status=ItemEtapa.STS_SUCC ), 
                    ItemEtapa(id_etapa='2',   status=ItemEtapa.STS_WARN),
                    ItemEtapa(id_etapa='3',  status=ItemEtapa.STS_DANG),
                    ItemEtapa(id_etapa='4', status=ItemEtapa.STS_BLUE),
                    ItemEtapa(id_etapa='5',   status=ItemEtapa.STS_BLCK) 
                    ]
                )

#CRIA O CARD COM O TITULO E O ICONE APENAS
etapa_card = UiCard(
            title     = "Titulo do Processo",
            subtitle  = "subtitulo aqui", 
            image_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f699.png", #ICONE TDO TITULO
            sections=[sectionEtapa]
        )

g.send_card(etapa_card)

Logo do Robô

Exemplo de card customizado

from gchatUts.sections import UiSection
from gchatUts.uikit import UiColumns,UiDecoratedText


custom_sec = UiSection(
    widgets=[
        UiColumns(columns=[
            UiColumn(widgets=[
                UiDecoratedText(
                    top_label= "<b>HOSTNAME</b>",
                    text="SRV-PROD-01"
                ),
                UiDecoratedText(
                    top_label= "<b>USUÁRIO</b>",
                    text="admin_bot"
                )
            ]),
            UiColumn(widgets=[
                UiDecoratedText(
                    top_label= "<b>ROBÔ</b>",
                    text="Worker_Alpha"
                ),
                UiDecoratedText(
                    top_label= "<b>STATUS</b>",
                    text="<b><font color=\"#2ecc71\">● DEPLOY</font></b>"
                )
            ])
        ])
    ]
)

#CRIA O CARD COM O TITULO E O ICONE APENAS
custom_card = UiCard(
            title     = "Titulo do Processo",
            subtitle  = "subtitulo aqui", 
            image_url = "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/png/128/emoji_u1f699.png", #ICONE TDO TITULO
            sections=[custom_sec]
        )

g.send_card(custom_card)

Metadata

Release files for gchatUts 1.0.5

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

Source distribution (sdist)

Source distribution for gchatUts 1.0.5
File Size Uploaded Provenance Actions
gchatuts-1.0.5.tar.gz 9.8 kB With provenance Details for gchatuts-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gchatUts 1.0.5
File Interpreter ABI Platform Actions
gchatuts-1.0.5-py3-none-any.whl Python 3 none any Details for gchatuts-1.0.5-py3-none-any.whl

Total release size: 18.8 kB

Release files / gchatuts-1.0.5.tar.gz

Download URL gchatuts-1.0.5.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b3dd1b3ee238d65b5efa63b601a888f13a4017c8172520c220c7ba24cecc2b4e
BLAKE2b-256 checksum
How to use checksums
a793b64658f8725c55a2e2a51ae0bf80e93a5e70c31299674b0681d348a37de8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Release files / gchatuts-1.0.5-py3-none-any.whl

Download URL gchatuts-1.0.5-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e1db9788f736f9ca7cac6b1d0c0033dbd4c9c4d77f5ff128e5b24b84f021671
BLAKE2b-256 checksum
How to use checksums
07ff28df8d955f42dc3114307d6f5e245ffca28df00e798abafbf47042b817bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Security for gchatUts 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gchatuts-1.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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