{"id":27950832,"url":"https://github.com/obss/pigeons","last_synced_at":"2025-05-07T16:15:59.100Z","repository":{"id":45429730,"uuid":"386603177","full_name":"obss/pigeons","owner":"obss","description":"Simple carrier tool for logs to collaboration applications (currently supporting MSTeams only) with handy features.","archived":false,"fork":false,"pushed_at":"2021-12-14T13:12:22.000Z","size":20,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T16:15:54.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-16T10:48:37.000Z","updated_at":"2022-07-31T23:34:09.000Z","dependencies_parsed_at":"2022-07-19T05:17:22.944Z","dependency_job_id":null,"html_url":"https://github.com/obss/pigeons","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obss%2Fpigeons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obss%2Fpigeons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obss%2Fpigeons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obss%2Fpigeons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obss","download_url":"https://codeload.github.com/obss/pigeons/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252912949,"owners_count":21824066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T16:15:58.465Z","updated_at":"2025-05-07T16:15:59.072Z","avatar_url":"https://github.com/obss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pigeons\n\n![](assets/logo.png)\n\nPigeons is an easy and practical alert tool which enables sending logs to MSTeams. \nIt also supports dynamic filtering of log records with an option to use \nregex to capture records of any logger.\n\n## Installation\n\n### Installing through pip\n\n    pip install pigeons\n\n### Build from source\n    \n    git clone https://github.com/obss/pigeons\n    cd pigeons\n    python setup.py install\n\n## Usage\n\nPigeons is easy to use with just two line of codes.\n    \n    import sys\n\n    from pigeons import init_logger, pigeon_excepthook\n\n    sys.excepthook = pigeon_excepthook\n    logger = init_logger(\n        ...\n    )\n\n### First things, first\n\nFirst of all you need to create an `endpoint` to your MS Teams channel, to obtain your endpoint refer to the Teams' [Incoming Webhook documentation](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).\n\n### With Start Flags\n\nPigeons will look for specified flags in the beginning of the log for \nthe specified log level. If the log message starts with the flag, then\nit will be sent to specified endpoint.\n\n    import logging\n\n    from pigeons import init_logger\n\n    endpoint = \"https://custom_domain.com/api/...\"\n    my_flag = \"!my_flag \"\n    logger = init_logger(\n            endpoint=endpoint,\n            level=logging.INFO, # Default\n            log_to_teams=True,\n            tf_capture_flags=[my_flag],\n            tf_regex=False\n    )\n\n### With Regex\n\nPigeons will look for specified regex in the log for the specified log level. \nIf the log message matches the regex, then it will be sent to specified endpoint.\n\n    import logging\n\n    from pigeons import init_logger\n\n    endpoint = \"https://custom_domain.com/api/...\"\n    my_regex = \"^[a-zA-Z0-9]+$\"\n    logger = init_logger(\n            endpoint=endpoint,\n            level=logging.INFO, # Default\n            log_to_teams=True,\n            tf_capture_flags=[my_regex],\n            tf_regex=True\n    )\n\n### Uncaught Exceptions\n\nPigeons has a custom excepthook for handling uncaught exceptions.\nTo handle uncaught exceptions just override `sys.excepthook` as follows\n\n    importy sys\n    from pigeons import pigeon_excepthook\n\n    sys.excepthook = pigeon_excepthook\n\n### Examples\n\n    # Lower levels will be ignored.\n    logger.debug(\"This log will be ignored.\")\n    \n    # At level=level (logging.INFO)\n    logger.info(\"This log is ignored\".)\n    logger.info(my_flag + \"This log is captured and sent to Teams.\")\n    \n    # Higher levels will always be captured regardless presence of flag.    \n    logger.warning(\"This is sent.\")\n    logger.error(\"This is also sent.\")\n    logger.critical(\"Another captured message.\")\n    logger.fatal(\"And another one.\")\n\n## Contributing\n\nPRs are always welcomed.\n\n### Installation\n\n    git clone https://github.com/obss/pigeons.git\n    cd pigeons\n    python setup.py develop\n    pip install -r requirements-dev.txt\n\n### Tests\n\nTo tests simply run.\n\n    pytest tests/\n\nPigeons uses black to assure code style standard.\n\n    black . --config pyproject.toml\n\n\n## License\n\nLicensed under the [MIT](LICENSE) License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobss%2Fpigeons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobss%2Fpigeons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobss%2Fpigeons/lists"}