Metadata-Version: 2.5
Name: covenirbpo-teams-notifier
Version: 2.0.0
Summary: Send Microsoft Teams notifications via an incoming webhook (successor to CovenirBPO.package.TeamsNotificationSubsystem)
Project-URL: Homepage, https://github.com/CovenirBPO/teams-notifier
Project-URL: Source, https://github.com/CovenirBPO/teams-notifier
Project-URL: Issues, https://github.com/CovenirBPO/teams-notifier/issues
Author: Covenir BPO
Maintainer: Covenir BPO
License: MIT License
        
        Copyright (c) 2026 Covenir BPO
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: adaptive-cards,alerting,notifications,teams,webhook
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Requires-Dist: requests>=2.25.0
Description-Content-Type: text/markdown

# TeamsNotificationSubsystem

Send Microsoft Teams notifications through an incoming webhook.

Company-owned successor to `CovenirBPO.package.TeamsNotificationSubsystem` 1.0.0,
which was published to public PyPI under a former employee's personal account and
can no longer be updated by Covenir.

**The import path is unchanged.** Existing code does not need to be edited — only
the install command changes.

## Migration

The old and new distributions both install a top-level `TeamsNotificationSubsystem`
package, so they collide. Uninstall the old one first:

```powershell
python -m pip uninstall -y CovenirBPO.package.TeamsNotificationSubsystem
python -m pip install covenirbpo-teams-notifier
```

That is the whole migration. No source changes, no import changes, same
`TEAMS_WEBHOOK` variable.

If you have a `requirements.txt`, swap the line:

```diff
-CovenirBPO.package.TeamsNotificationSubsystem==1.0.0
+covenirbpo-teams-notifier>=2.0.0
```

## Prerequisites

None beyond Python 3.9+. `requests` is installed automatically as a declared
dependency — unlike 1.0.0, which required installing it by hand.

## Set your Teams webhook environment variable

**Required.**

| Name | Value |
|:--|:--|
| `TEAMS_WEBHOOK` | Your webhook URL |

Note that a webhook is a Power Automate flow with an *owner*. Create it under a
service account, not a personal one — a flow owned by a departing employee stops
delivering when their account is deprovisioned, and it can keep returning
`HTTP 202` while silently dropping messages.

## Usage

Unchanged from 1.0.0:

```python
# Import the package
from TeamsNotificationSubsystem import TeamsNotifier

# Create the notifier object
notifier = TeamsNotifier.TeamsNotifier()

# Choose the message type that you would like to send
notifier.send_error_message('title', 'message')
notifier.send_warning_message('title', 'message')
notifier.send_info_message('title', 'message')
```

### Added in 2.0.0

All additive — nothing existing changed.

```python
notifier.send_basic_message('title', 'message')   # blue card (BasicCard.json)
notifier.send_message('warning', 'title', 'msg')  # severity-driven entry point

# Override the webhook without touching the environment
notifier = TeamsNotifier.TeamsNotifier(webhook_url='https://...')

# Requests time out after 30s by default instead of hanging forever
notifier = TeamsNotifier.TeamsNotifier(timeout=10)
```

Severities are `error` (red), `warning` (yellow), `info` (green) and `basic` (blue).
The `send_*_message` methods now return the `requests.Response`; callers that
ignore the return value are unaffected.

## What changed from 1.0.0

| | 1.0.0 | 2.0.0 |
|:--|:--|:--|
| Ownership | personal PyPI account | Covenir-owned |
| `requests` | undeclared; installed by hand | declared dependency |
| `requires-python` | `>=3.12.1` | `>=3.9` |
| Request timeout | none (could hang forever) | 30s, configurable |
| Card templates | 4 shipped, 3 reachable | 4 shipped, 4 reachable |
| Card JSON | — | byte-identical, so cards render the same |
| Tests | none | `python -m unittest discover -s tests` |

Preserved exactly: import path, class name, method names and signatures, the
`webhook_url` and `resources_folder` attributes, the bare `Exception` and its
message when `TEAMS_WEBHOOK` is unset, and `requests.HTTPError` from
`raise_for_status()` on a failed post.

## Development

```powershell
python -m pip install -e .
python -m unittest discover -s tests -v
python -m build
```

## Publishing

Publish from a **Covenir-owned** account, never a personal one. Add at least two
owners on the PyPI project so a single departure cannot orphan it again.

```powershell
python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*
```
