microsoft-teams-common


Namemicrosoft-teams-common JSON
Version 2.0.0a3 PyPI version JSON
download
home_pageNone
SummaryCommon package for Microsoft Teams
upload_time2025-10-18 00:15:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords agents ai bot microsoft teams
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            > [!CAUTION]
> This project is in public preview. We’ll do our best to maintain compatibility, but there may be breaking changes in upcoming releases. 

# Microsoft Teams Common Utilities

<p>
    <a href="https://pypi.org/project/microsoft-teams-common" target="_blank">
        <img src="https://img.shields.io/pypi/v/microsoft-teams-common" />
    </a>
    <a href="https://pypi.org/project/microsoft-teams-common" target="_blank">
        <img src="https://img.shields.io/pypi/dw/microsoft-teams-common" />
    </a>
</p>

Shared utilities including HTTP client, logging, storage, and event handling.
Provides common functionality used across other Teams SDK packages.

<a href="https://microsoft.github.io/teams-ai" target="_blank">
    <img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
</a>

## Features

- **HTTP Client**: Async HTTP client with token support and interceptors
- **Event System**: Type-safe event emitter for application lifecycle management
- **Storage**: Local storage implementations for key-value and list data
- **Logging**: Console logging with formatting and filtering

## HTTP Client

```python
from microsoft.teams.common import Client, ClientOptions

# Create HTTP client
client = Client(ClientOptions(
    base_url="https://api.example.com",
    headers={"User-Agent": "Teams-Bot/1.0"}
))

# Make requests
response = await client.get("/users/me")
data = await client.post("/messages", json={"text": "Hello"})
```

## Event System

```python
from microsoft.teams.common import EventEmitter

# Create type-safe event emitter
emitter = EventEmitter[str]()

# Register handler
def handle_message(data: str):
    print(f"Received: {data}")

subscription_id = emitter.on("message", handle_message)

# Emit event
emitter.emit("message", "Hello World")

# Remove handler
emitter.off(subscription_id)
```

## Storage

```python
from microsoft.teams.common import LocalStorage, ListLocalStorage

# Key-value storage
storage = LocalStorage[str]()
storage.set("key", {"data": "value"})
data = storage.get("key")

# Async operations
await storage.async_set("key", {"data": "value"})
data = await storage.async_get("key")

# List storage
list_storage = ListLocalStorage[str]()
list_storage.append("new-item")
items = list_storage.items()
```

## Logging

```python
from microsoft.teams.common import ConsoleLogger

# Create console logger
logger = ConsoleLogger().create_logger("my-app")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "microsoft-teams-common",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "agents, ai, bot, microsoft, teams",
    "author": null,
    "author_email": "Microsoft <TeamsAISDKFeedback@microsoft.com>",
    "download_url": "https://files.pythonhosted.org/packages/d3/2a/6400f24a32d1f97ce41f305813999f7b56954db50c7ae4414d41258e4eb7/microsoft_teams_common-2.0.0a3.tar.gz",
    "platform": null,
    "description": "> [!CAUTION]\n> This project is in public preview. We\u2019ll do our best to maintain compatibility, but there may be breaking changes in upcoming releases. \n\n# Microsoft Teams Common Utilities\n\n<p>\n    <a href=\"https://pypi.org/project/microsoft-teams-common\" target=\"_blank\">\n        <img src=\"https://img.shields.io/pypi/v/microsoft-teams-common\" />\n    </a>\n    <a href=\"https://pypi.org/project/microsoft-teams-common\" target=\"_blank\">\n        <img src=\"https://img.shields.io/pypi/dw/microsoft-teams-common\" />\n    </a>\n</p>\n\nShared utilities including HTTP client, logging, storage, and event handling.\nProvides common functionality used across other Teams SDK packages.\n\n<a href=\"https://microsoft.github.io/teams-ai\" target=\"_blank\">\n    <img src=\"https://img.shields.io/badge/\ud83d\udcd6 Getting Started-blue?style=for-the-badge\" />\n</a>\n\n## Features\n\n- **HTTP Client**: Async HTTP client with token support and interceptors\n- **Event System**: Type-safe event emitter for application lifecycle management\n- **Storage**: Local storage implementations for key-value and list data\n- **Logging**: Console logging with formatting and filtering\n\n## HTTP Client\n\n```python\nfrom microsoft.teams.common import Client, ClientOptions\n\n# Create HTTP client\nclient = Client(ClientOptions(\n    base_url=\"https://api.example.com\",\n    headers={\"User-Agent\": \"Teams-Bot/1.0\"}\n))\n\n# Make requests\nresponse = await client.get(\"/users/me\")\ndata = await client.post(\"/messages\", json={\"text\": \"Hello\"})\n```\n\n## Event System\n\n```python\nfrom microsoft.teams.common import EventEmitter\n\n# Create type-safe event emitter\nemitter = EventEmitter[str]()\n\n# Register handler\ndef handle_message(data: str):\n    print(f\"Received: {data}\")\n\nsubscription_id = emitter.on(\"message\", handle_message)\n\n# Emit event\nemitter.emit(\"message\", \"Hello World\")\n\n# Remove handler\nemitter.off(subscription_id)\n```\n\n## Storage\n\n```python\nfrom microsoft.teams.common import LocalStorage, ListLocalStorage\n\n# Key-value storage\nstorage = LocalStorage[str]()\nstorage.set(\"key\", {\"data\": \"value\"})\ndata = storage.get(\"key\")\n\n# Async operations\nawait storage.async_set(\"key\", {\"data\": \"value\"})\ndata = await storage.async_get(\"key\")\n\n# List storage\nlist_storage = ListLocalStorage[str]()\nlist_storage.append(\"new-item\")\nitems = list_storage.items()\n```\n\n## Logging\n\n```python\nfrom microsoft.teams.common import ConsoleLogger\n\n# Create console logger\nlogger = ConsoleLogger().create_logger(\"my-app\")\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Common package for Microsoft Teams",
    "version": "2.0.0a3",
    "project_urls": {
        "Homepage": "https://github.com/microsoft/teams.py/tree/main/packages/common/src/microsoft/teams/common"
    },
    "split_keywords": [
        "agents",
        " ai",
        " bot",
        " microsoft",
        " teams"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f5df498a61c857a4b6ea11e395d4187ee4723d8cc6b7de986d785478fe0b1329",
                "md5": "57db74080fab1ae1983570d4b69e23f7",
                "sha256": "1f34850f4d217d201e88f7d725c0765569336573c290759cc12c76fc254272aa"
            },
            "downloads": -1,
            "filename": "microsoft_teams_common-2.0.0a3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "57db74080fab1ae1983570d4b69e23f7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 15952,
            "upload_time": "2025-10-18T00:15:53",
            "upload_time_iso_8601": "2025-10-18T00:15:53.532081Z",
            "url": "https://files.pythonhosted.org/packages/f5/df/498a61c857a4b6ea11e395d4187ee4723d8cc6b7de986d785478fe0b1329/microsoft_teams_common-2.0.0a3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d32a6400f24a32d1f97ce41f305813999f7b56954db50c7ae4414d41258e4eb7",
                "md5": "f987eda75d504e613cc090d1fcadda6a",
                "sha256": "55c37425e509930b50aaeeadd1e9b1b97a709069d8828a2eef051cd2eaa52b70"
            },
            "downloads": -1,
            "filename": "microsoft_teams_common-2.0.0a3.tar.gz",
            "has_sig": false,
            "md5_digest": "f987eda75d504e613cc090d1fcadda6a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 10133,
            "upload_time": "2025-10-18T00:15:54",
            "upload_time_iso_8601": "2025-10-18T00:15:54.273585Z",
            "url": "https://files.pythonhosted.org/packages/d3/2a/6400f24a32d1f97ce41f305813999f7b56954db50c7ae4414d41258e4eb7/microsoft_teams_common-2.0.0a3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-18 00:15:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "microsoft",
    "github_project": "teams.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "microsoft-teams-common"
}
        
Elapsed time: 3.70199s