Skip to main content
botas logo

botas

A lightweight, multi-language library for building Microsoft Teams bots — this is the core Python package.

For zero-boilerplate FastAPI hosting, see botas-fastapi.

Installation

pip install botas

Quick start (with FastAPI)

from botas import BotApplication
from botas_fastapi import bot_auth_dependency
from fastapi import Depends, FastAPI, Request

bot = BotApplication()

@bot.on("message")
async def on_message(ctx):
    await ctx.send(f"You said: {ctx.activity.text}")

app = FastAPI()

@app.post("/api/messages", dependencies=[Depends(bot_auth_dependency())])
async def messages(request: Request):
    body = await request.body()
    await bot.process_body(body.decode())
    return {}

Or use the higher-level botas-fastapi wrapper for a simpler setup:

from botas_fastapi import BotApp

app = BotApp()

@app.on("message")
async def on_message(ctx):
    await ctx.send(f"You said: {ctx.activity.text}")

app.start()

API

BotApplication

The core bot class — web-framework-agnostic.

Method Description
on(type, handler) Register a handler for an activity type (also works as a @decorator)
on_invoke(name, handler) Register a handler for an invoke activity by name (also works as a @decorator)
use(middleware) Add a middleware to the turn pipeline (runs in registration order)
process_body(body) Process a raw JSON body string

Authentication options

BotApplicationOptions fields (also resolved from environment variables):

Option Env variable Description
client_id CLIENT_ID Azure AD application (bot) ID
client_secret CLIENT_SECRET Azure AD client secret
tenant_id TENANT_ID Azure AD tenant ID (default: common)
managed_identity_client_id MANAGED_IDENTITY_CLIENT_ID Managed identity client ID
token_factory — Custom async token factory (scope, tenant_id) -> str

Documentation

License

MIT

Metadata

Release files for botas 0.3.83

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

Source distribution (sdist)

Source distribution for botas 0.3.83
File Size Uploaded
botas-0.3.83.tar.gz 36.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for botas 0.3.83
File Interpreter ABI Platform
botas-0.3.83-py3-none-any.whl Python 3 none any Details

Total release size: 67.0 kB

Release files / botas-0.3.83.tar.gz

Download URL botas-0.3.83.tar.gz
Size 36.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8b40ef00895e3afcbd838a0566d2760cf867ca4dcfb42dd5f7faf00fcdfb1b91
BLAKE2b-256 checksum
How to use checksums
87337a9daf650dc6046874a0e03b39347f08edb8874201ad7a255c8590957bdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 May 2, 2026.

Transparency log

Release files / botas-0.3.83-py3-none-any.whl

Download URL botas-0.3.83-py3-none-any.whl
Size 30.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82132b71a130132ad571f87e666bcba6f5fcee2a40122557ff8e47bb56e7af08
BLAKE2b-256 checksum
How to use checksums
9533801e91a1e795890fd836f9aefd169738d514ab4b53fced2a9578b0d9572f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 May 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.83 This release

2 release files

0.3.61

2 release files

0.3.33

2 release files

0.3.31

2 release files

0.3.25

2 release files

0.3.18

2 release files

0.3.6

2 release files

0.2.3

2 release files

0.1.80

2 release files

0.1.77

2 release files

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