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)
| File | Size | Uploaded | |
|---|---|---|---|
| botas-0.3.83.tar.gz | 36.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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