Metadata-Version: 2.1
Name: linenotify-python
Version: 0.1.1
Summary: LINE notify Web API wrapper
Home-page: https://github.com/mukai1011/linenotify-python
License: MIT
Author: Koutaro Mukai
Author-email: mukai.k1011k@outlook.jp
Requires-Python: >=3.7,<3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: Pillow (>=9.3.0,<10.0.0)
Requires-Dist: opencv-python (>=4.6.0.66,<5.0.0.0)
Requires-Dist: pydantic (>=1.10.2,<2.0.0)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Project-URL: Repository, https://github.com/mukai1011/linenotify-python
Description-Content-Type: text/markdown

# linenotify-python

LINE notify Web API wrapper

Plenty of [internal validations](./linenotify/validations.py), easy [error handling](./linenotify/exceptions.py).

## Install

```
pip install linenotify-python
```

## Usage

```python
from os import environ, path

import cv2
import linenotify as ln


TOKEN = environ['LINENOTIFY_TOKEN']


#
# Standard usage
# - Provides all the options described in the documentation.
#
service = ln.Service(TOKEN)

service.notify("text")
service.notify("text + image", cv2.imread(path.join(path.dirname(__file__), "otaku.png")))
service.notify("text + sticker", (446, 1988))
service.notify("text + url", ("http://example.com/thumb.jpg", "https://example.com/body.jpeg"))
service.notify("without notification", notification_disabled=True)

#
# Check API status
# - Status can be obtained from "status" and "notify".
#
status = service.status
status = service.notify("text")

#
# Error handling
# - All exceptions are derived from LINENotifyException, easily caught.
#
invalid_service = ln.Service("invalid token")
try:
    invalid_service.notify("raises an error")
    invalid_service.notify("text + image", cv2.imread("very_large_image.png"))
    invalid_service.notify("text + url", ("url_which_does_not_exist", "same_as_left"))
    # and so on ...

except ln.LINENotifyException:
    pass
```

# API documents

- [LINE Notify API Document](https://notify-bot.line.me/doc/en/)
- [List of available stickers](https://developers.line.biz/en/docs/messaging-api/sticker-list/)

