semvec/pypi-packages huggingface dataset:
sq-GUI 0.0.2
GUI para Square Cloud usando API!
Requires Python: >=3.0

# O GUI

Tente executar:

```
squarecloud
```

O status da plataforma https://squarecloud.dev virá no formato *json* com uma interface gráfica.

```py
import argparse
import PySimpleGUI as sg
import requests
import json

theme_name = "Tan"

def get_api_data(argument):
    url = "https://api.squarecloud.app/v2/service/statistics"
    response = requests.get(url)
    if response.status_code == 200:
        return response.json()
    else:
        return None

parser = argparse.ArgumentParser(description="Obter status da Square Cloud")
parser.add_argument("-s", "--service", dest="service", default="squarecloud", help="O serviço da API Square Cloud a ser usado")

args = parser.parse_args()

if args.service == "squarecloud":
    layout = [
        [sg.Text("Status da Square Cloud")],
        [sg.Button("Get")],
        [sg.Multiline("", size=(30, 14), key="-OUTPUT-", disabled=True)]
    ]

    sg.theme(theme_name)

    window = sg.Window("Square Cloud", layout)

    while True:
        event, values = window.read()
        if event == sg.WINDOW_CLOSED:
            break
        elif event == "Get":
            api_data = get_api_data(args.service)
            if api_data:
                formatted_data = json.dumps(api_data, indent=4)
                window["-OUTPUT-"].update(formatted_data)
            else:
                window["-OUTPUT-"].update("Erro ao obter dados da API.")

    window.close()

else:
    print("Serviço não suportado")
```