Skip to main content

chatops-sdk

SDK de Python para convertir cualquier aplicación en un bot del ChatOps Bot Control Center. Declaras funciones con @bot.command() y el SDK genera el manifiesto de comandos a partir de sus type hints. El bot abre un WebSocket saliente hacia el Relay Hub, así que no necesita puertos abiertos ni IP pública.

Instalación

pip install chatops-sdk

Requiere Python 3.11 o superior.

Uso

import os
from typing import Literal

from fastapi import FastAPI
from chatops_sdk import BotAgent, CommandContext, UIBlock

os.environ.setdefault("CHATOPS_HUB_URL", "ws://localhost:8000/ws/bot")
os.environ.setdefault("CHATOPS_BOT_TOKEN", "bot_xxxxxxxxxxxx:secreto")

bot = BotAgent(name="Mi-Bot", version="1.0.0", environment="production", project="Pagos")


@bot.command(name="deploy", description="Despliega un servicio")
async def deploy(ctx: CommandContext, service: str, env: Literal["staging", "prod"] = "staging", dry_run: bool = False):
    await ctx.report_progress(40, f"Construyendo {service}...")
    return [
        UIBlock.header(f"✅ {service} desplegado en {env}"),
        UIBlock.metrics([("Duración", "42s"), ("Réplicas", "3", "up")]),
    ]


app = FastAPI(lifespan=bot.lifespan)   # conecta al arrancar y reconecta con backoff
  • CHATOPS_HUB_URL: URL del Hub (ws://…/ws/bot o wss://…/ws/bot).
  • CHATOPS_BOT_TOKEN: token del bot (bot_<id>:<secreto>), que se obtiene en el Control Center con + Nuevo Bot.

Versiones

Sigue semver. El protocolo con el Relay Hub es un contrato cerrado: un cambio incompatible en los sobres o en los UIBlock implica subir la versión mayor.

Licencia

MIT.

Metadata

Release files for chatops-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)

Source distribution for chatops-sdk 1.0.0
File Size Uploaded Provenance Actions
chatops_sdk-1.0.0.tar.gz 28.4 kB Without provenance Details for chatops_sdk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chatops-sdk 1.0.0
File Interpreter ABI Platform Actions
chatops_sdk-1.0.0-py3-none-any.whl Python 3 none any Details for chatops_sdk-1.0.0-py3-none-any.whl

Total release size: 49.4 kB

Release files / chatops_sdk-1.0.0.tar.gz

Download URL chatops_sdk-1.0.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
771ac1b84583602732e51e1c5dd0dc64e0b0d7104d0940160e5a372df4c2d3e6
BLAKE2b-256 checksum
How to use checksums
d95de5750b2da86d9cd7a93d9f980eacb32b7196c10ae87c93c0d203d4b78706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / chatops_sdk-1.0.0-py3-none-any.whl

Download URL chatops_sdk-1.0.0-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c857bff8fb63560b9530a422aedff7e7faed7dc90b7442f7428c0372c4436f7f
BLAKE2b-256 checksum
How to use checksums
f144b7b5f345c854613268279222446fd3648ed583de1f89b4b4a580074e1d1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for chatops-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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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