API reference¶
pynotify.app
¶
Textual user interface for posting messages to Teams webhooks.
Channel(name, webhook_env_var=None, webhook_url=None)
dataclass
¶
A channel name and one local source for its webhook URL.
ChannelConfigurationError
¶
Bases: ValueError
Raised when the channel configuration cannot be used.
NotifyApp(channels)
¶
Bases: App[None]
Select channels, compose a Teams card, and send it.
Source code in src/pynotify/app.py
123 124 125 | |
build_adaptive_card(heading, message)
¶
Build the Adaptive Card payload accepted by Teams workflows.
Source code in src/pynotify/app.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
default_channels_path()
¶
Return the user-level default rather than a file inside the project.
Source code in src/pynotify/app.py
33 34 35 36 | |
load_channels(path)
¶
Load channels using either an environment variable or local webhook URL.
Source code in src/pynotify/app.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
main()
¶
Run the application or print a clear configuration error.
Source code in src/pynotify/app.py
202 203 204 205 206 207 208 209 | |
post_message(webhook_url, heading, message)
¶
Post one card, raising a descriptive error on delivery failure.
Source code in src/pynotify/app.py
97 98 99 100 101 102 103 104 105 106 107 108 109 | |