Metadata-Version: 2.1
Name: slack-notifications
Version: 0.0.2
Summary: Send notifications to slack channel with supporting attachments and fields
Home-page: https://github.com/oztqa/slack_notifications
Author: Mikhail Trifonov
Author-email: trifonov.net@gmail.com
License: UNKNOWN
Description: # Slack notifications
        
        ## Installation
        
        ```bash
        pip install slack-notifications
        ```
        
        ## Simple usage
        
        ```python
        import os
        
        from slack_notifications import send_notify
        
        
        os.environ['SLACK_ACCESS_TOKEN'] = 'xxx'
        
        
        send_notify('channel-name', username='Bot', text='@channel This is test message')
        ```
        
        
        ## Use attachments
        
        ```python
        import os
        
        from slack_notifications import send_notify, Attachment
        
        
        os.environ['SLACK_ACCESS_TOKEN'] = 'xxx'
        
        
        attachment = Attachment(
            title='Attachment title',
            pretext='Attachment pretext',
            text='Attachment text',
            footer='Attachment footer',
            color='green',
        )
        
        send_notify('channel-name', username='Bot', text='@channel This is test message', attachments=[attachment])
        ```
        
        
        ## Attachment fields
        
        ```python
        import os
        
        from slack_notifications import send_notify, Attachment, AttachmentField
        
        
        os.environ['SLACK_ACCESS_TOKEN'] = 'xxx'
        
        
        field = AttachmentField(
            title='Field title',
            value='Field value',
        )
        
        attachment = Attachment(
            title='Attachment title',
            pretext='Attachment pretext',
            text='Attachment text',
            footer='Attachment footer',
            fields=[field],
            color='green',
        )
        
        send_notify('channel-name', username='Bot', text='@channel This is test message', attachments=[attachment])
        ```
        
        ## Init attachment color
        
        ```python
        from slack_notifications import init_color
        
        
        init_color('green', '#008000')
        ```
        
        ## Call slack resource
        
        ```python
        import os
        
        from slack_notifications import call_resource, Resource
        
        
        os.environ['SLACK_ACCESS_TOKEN'] = 'xxx'
        
        
        response = call_resource(Resource('users.info', 'GET'), params={'user': 'W1234567890'})
        ```
        
        
        ## Resource iterator
        
        ```python
        import os
        
        from slack_notifications import resource_iterator, Resource
        
        
        os.environ['SLACK_ACCESS_TOKEN'] = 'xxx'
        
        
        for user in resource_iterator(Resource('users.list', 'GET'), 'members'):
            pass
        ```
        
        ## Raise exception if error was given
        
        ```python
        import os
        
        from slack_notifications import send_notify
        
        
        os.environ['SLACK_ACCESS_TOKEN'] = 'xxx'
        
        
        send_notify('channel-name', username='Bot', text='@channel This is test message', raise_exc=True)
        ```
        
        
        # Objects
        
        ## AttachmentField
        
        * title=None
        * value=None
        * short=False
        
        ## Attachment
        
        * image_url=None,
        * thumb_url=None,
        * author_name=None,
        * author_link=None,
        * author_icon=None,
        * title=None,
        * title_link=None,
        * text=None,
        * pretext=None,
        * footer=None,
        * footer_icon=None,
        * timestamp=None,
        * fields: List[AttachmentField] = None,
        * color=None
        
Keywords: slack notifications
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Description-Content-Type: text/markdown
