Metadata-Version: 2.1
Name: bbm
Version: 0.0.10
Summary: 📊 Buzzni Batch process Monitor.
Project-URL: homepage, https://github.com/buzzni/bbm
Project-URL: bug-tracker, https://github.com/buzzni/bbm/issues
Author-email: damonbuzzni <damon@buzzni.com>
License-Expression: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.7.0
Requires-Dist: prettytable
Requires-Dist: pytz
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: kafka
Requires-Dist: confluent-kafka>=1.6.0; extra == 'kafka'
Provides-Extra: test
Requires-Dist: black; extra == 'test'
Requires-Dist: isort; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: requests-mock; extra == 'test'
Description-Content-Type: text/markdown

# bbm
📊 Buzzni Batch process Monitor -> BBM 

</p>
<p align="center">
<a href="https://pypi.org/project/bbm" target="_blank">
    <img src="https://img.shields.io/pypi/v/bbm?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypi.org/project/bbm" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/bbm?color=%2334D058" alt="Supported Python versions">
</a>
</p>

## Installation
```bash
pip install bbm
```

## Example
### logging
```python
from bbm import Interval, logging, setup


@logging()
def temp_func():
    return "Hello World"


@logging(process_name="custom_name_of_process", interval=Interval.A_DAY)
def temp_func2():
    return "Hello World"


if __name__ == "__main__":
    setup(es_url="your-es-url", index_prefix="your-index-prefix")
    temp_func()
    temp_func2()
```
### post report
```python
from bbm import reporter, setup

if __name__ == "__main__":
    # init bbm
    setup(es_url="your-es-url", index_prefix="your-index-prefix")
    
    # init reporter and send simple messages
    reporter = reporter.Reporter(slack_token="your-slack-token", slack_channel_id="your-slack-channel-id")
    post_response = reporter.post_message(title="title", text="text")
    ts = post_response["ts"]
    post_message_to_thread = reporter.post_message(title="title", text="text", ts=ts)
    
    # send report    
    reporter.post_report()
```

### Report sample
1. Need to check report
![report_sample](https://raw.githubusercontent.com/buzzni/bbm/main/doc/images/example1.png)
2. Full report (It will be sent as a file at 'need to check report' thread)
![report_sample](https://raw.githubusercontent.com/buzzni/bbm/main/doc/images/example2.png)