windmill-sdk
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_sdkcome 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.
Metadata
Release files for windmill-sdk 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| windmill_sdk-1.0.0.tar.gz | 6.5 kB | Without provenance | Details for windmill_sdk-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| windmill_sdk-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for windmill_sdk-1.0.0-py3-none-any.whl |
Total release size: 16.3 kB
Release files / windmill_sdk-1.0.0.tar.gz
| Download URL | windmill_sdk-1.0.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e5bca2ded78d2e370c77e961c19ad20414a5a6e9fcde9d17566ac8402aab9b9
|
|
BLAKE2b-256 checksum How to use checksums |
a96e6dfc2deb1bc6d6e5a96d3958d5b2dc598f0ee372a4a406a8cccfb596c3e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.12.0 Darwin/25.0.0
|
Release files / windmill_sdk-1.0.0-py3-none-any.whl
| Download URL | windmill_sdk-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f59405d5aa95045813f05ed950c5801f6d0f3efe67143fc89c209812ef476a9
|
|
BLAKE2b-256 checksum How to use checksums |
f43adb3fb5a90cec9d478736f252850621717173a823412d619f142c8ac6201e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.12.0 Darwin/25.0.0
|
Security for windmill-sdk 1.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.