Skip to main content

Libreria Python asincrona per interagire con PocketBase e SDC, pensata per Windmill

Project description

windmill-sdk

pipeline status coverage report

pre-commit enabled code style: black

Libreria Python asincrona per interagire con sistemi PocketBase e SDC, pensata per l'uso all'interno di Windmill.

✨ Funzionalità

  • Recupero asincrono dei tenant da PocketBase (filtrabile)
  • Interrogazione dei servizi e utenti da API SDC con autenticazione automatica
  • Compatibilità futura con Directus tramite interfaccia unificata
  • Supporto alla validazione con Pydantic
  • Invio opzionale di notifiche su Slack in caso di errore

📦 Installazione

pip install windmill-sdk
# oppure
poetry add windmill-sdk

⚙️ Requisiti

  • Python 3.10+
  • httpx, pydantic, pytest, respx, pytest-asyncio

🚀 Esempio d’uso

import asyncio
from windmill_sdk.clients.pocketbase import PocketBaseClient
from windmill_sdk.clients.sdc import SDCClient

async def main():
    pb = PocketBaseClient("https://pb.example.com", "admin", "password")
    await pb.authenticate()
    tenants = await pb.list_tenants(filters={"identifier": "oc-pnrr-1"})
    await pb.close()

    for tenant in tenants:
        sdc = SDCClient(str(tenant.production_url), "sdc_user", "sdc_pass")
        services = await sdc.list_services()
        await sdc.close()
        for service in services:
            print(service.name)

asyncio.run(main())

✅ Test

pytest

📁 Struttura del progetto

windmill_sdk/
├── clients/
│   ├── pocketbase.py
│   ├── sdc.py
│   ├── directus.py
│   └── base_client.py
├── models.py
├── notifiers/
│   └── slack.py

🧪 Esecuzione dei test

Per eseguire la suite di test e controllare che tutto funzioni correttamente:

pytest

Assicurati di avere le dipendenze installate:

pip install -r requirements-dev.txt

✅ Verifica della copertura

Per eseguire i test e generare un report di copertura del codice:

pytest --cov=windmill_sdk --cov-report=term-missing

Questo comando:

  • Esegue tutti i test
  • Mostra a terminale le righe di codice non coperte
  • Usa il modulo windmill_sdk come riferimento per il calcolo della copertura

Puoi anche generare un report HTML navigabile:

pytest --cov=windmill_sdk --cov-report=html

Il report sarà disponibile nella cartella htmlcov/index.html.

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

windmill_sdk-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

windmill_sdk-1.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file windmill_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: windmill_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.0 Darwin/25.0.0

File hashes

Hashes for windmill_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7e5bca2ded78d2e370c77e961c19ad20414a5a6e9fcde9d17566ac8402aab9b9
MD5 d3bf091ff18c81434a8af17923c875bf
BLAKE2b-256 a96e6dfc2deb1bc6d6e5a96d3958d5b2dc598f0ee372a4a406a8cccfb596c3e8

See more details on using hashes here.

File details

Details for the file windmill_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: windmill_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.0 Darwin/25.0.0

File hashes

Hashes for windmill_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f59405d5aa95045813f05ed950c5801f6d0f3efe67143fc89c209812ef476a9
MD5 4548d99e7a9fd3167dd4076f28401299
BLAKE2b-256 f43adb3fb5a90cec9d478736f252850621717173a823412d619f142c8ac6201e

See more details on using hashes here.

Supported by

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