{"id":17286596,"url":"https://github.com/louis70109/lotify","last_synced_at":"2025-07-28T09:34:39.239Z","repository":{"id":47626351,"uuid":"258730791","full_name":"louis70109/lotify","owner":"louis70109","description":"LINE Notify API wrapper for Python","archived":false,"fork":false,"pushed_at":"2023-12-25T07:30:37.000Z","size":100,"stargazers_count":109,"open_issues_count":3,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T19:18:38.890Z","etag":null,"topics":["line","line-notify","lotify","python","sdk"],"latest_commit_sha":null,"homepage":"https://nijialin.com/2020/05/03/%E7%AC%AC%E4%B8%80%E6%AC%A1%E5%AF%AB-python-%E5%A5%97%E4%BB%B6%E7%9A%84%E5%AF%A6%E6%88%B0%E5%85%A8%E8%A8%98%E9%8C%84/","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/louis70109.png","metadata":{"files":{"readme":"README-zh_TW.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-25T09:14:13.000Z","updated_at":"2024-10-18T05:48:27.000Z","dependencies_parsed_at":"2024-06-19T13:27:26.501Z","dependency_job_id":"3087fd77-2ff1-4594-9d72-85bb953c4dce","html_url":"https://github.com/louis70109/lotify","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Flotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Flotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Flotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Flotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louis70109","download_url":"https://codeload.github.com/louis70109/lotify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094990,"owners_count":21046770,"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":["line","line-notify","lotify","python","sdk"],"created_at":"2024-10-15T09:59:41.456Z","updated_at":"2025-04-09T19:18:44.001Z","avatar_url":"https://github.com/louis70109.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lotify - LINE Notify 客戶端 SDK\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/louis70109/line-notify#contributing)\n[![Build Status](https://travis-ci.com/louis70109/lotify.svg?branch=master)](https://travis-ci.org/louis70109/lotify)\n[![pypi package](https://badge.fury.io/py/lotify.svg)](https://badge.fury.io/py/lotify)\n[![Python Version](https://img.shields.io/badge/Python-%3E%3D%203.5-blue.svg)](https://badge.fury.io/py/lotify)\n\n[English version](https://github.com/louis70109/lotify/blob/master/README.md)\n\n**Lotify** 是個讓你可以快速建立 Notify 機器人的 [LINE Notify](https://notify-bot.line.me/doc/en/) 客戶端 SDK。\n\n![](https://i.imgur.com/Rms5ZNG.png)\n\n如果你不是使用 Python，這裡有其他選擇：\n\n- [Ruby](https://github.com/etrex/lotify)\n- [PHP](https://github.com/eric0324/lotify)\n\n# 如何使用\n\n你需要有一個 **LINE 帳號** 並建立一個 Notify 服務：\n\n![create-a-line-notify](https://i.imgur.com/m9q4jLOl.png)\n\n## 安裝套件\n\n```\npip install lotify\n```\n\n\u003e 你可以在這裡找到範例程式 - [flask-line-notify](https://github.com/louis70109/flask-line-notify)\n\n## 環境變數（Environment variables）\n\n在 `.env` 檔案中設定以下參數或使用 `export` 在 OS 環境中設定，這樣你就不用在 `初始化` 時設定任何參數。\n\n```\nLINE_NOTIFY_CLIENT_ID\nLINE_NOTIFY_CLIENT_SECRET\nLINE_NOTIFY_REDIRECT_URI\n```\n\n## 初始化物件\n\n- 如果你已經設定好 Notify 的環境變數：\n\n```python\nfrom lotify.client import Client\n\nclient = Client()\n```\n\n- 否則：\n\n```python\nfrom lotify.client import Client\n\nclient = Client(\n    client_id='YOUR_CLIENT_ID',\n    client_secret='YOUR_CLIENT_SECRET',\n    redirect_uri='YOUR_URI'\n)\n```\n\n## 取得授權網址\n\n```python\nlink = client.get_auth_link(state='RANDOM_STRING')\nprint(link)\n# https://notify-bot.line.me/oauth/authorize?scope=notify\u0026response_type=code\u0026client_id=QxUxF..........i51eITH\u0026redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fnotify\u0026state=foo\n```\n\n## 取得 access token\n\n```python\naccess_token = client.get_access_token(code='NOTIFY_RESPONSE_CODE')\nprint(access_token)\n# N6g50DiQZk5Xh...25FoFzrs2npkU3z\n```\n\n## 取得狀態\n\n```python\nstatus = client.status(access_token='YOUR_ACCESS_TOKEN')\nprint(status)\n# {'status': 200, 'message': 'ok', 'targetType': 'USER', 'target': 'NiJia Lin'}\n```\n\n## 傳送訊息\n\n![push-notify](https://i.imgur.com/RhvwZVm.png)\n\n```python\nresponse = client.send_message(access_token='YOUR_ACCESS_TOKEN', message='This is notify message')\nprint(response)\n# {'status': 200, 'message': 'ok'}\n```\n\n## 傳送訊息加貼圖\n\n![push-notify-with-sticker](https://i.imgur.com/EWpZahk.png)\n\n你可以在 [這裡](https://devdocs.line.me/files/sticker_list.pdf) 找到 stickerId 和 stickerPackageId\n\n```python\nresponse = client.send_message_with_sticker(\n    access_token='YOUR_ACCESS_TOKEN',\n    message='This is notify message',\n    sticker_id=1,\n    sticker_package_id=1)\nprint(response)\n# {'status': 200, 'message': 'ok'}\n```\n\n## 傳送訊息加檔案\n\n![send-message-with-image-path](https://i.imgur.com/ESCrk8b.png)\n\n```python\nimage = client.send_message_with_image_file(\n    access_token='YOUR_ACCESS_TOKEN',\n    message='This is notify message',\n    file=open('./test_image.png', 'rb')\n)\nprint(image)\n# {'status': 200, 'message': 'ok'}\n```\n\n## 傳送訊息加圖片（URL模式）\n\n![send-message-with-image-url](https://i.imgur.com/0Lxatu9.png)\n\n```python\nimage = client.send_message_with_image_url(\n    access_token='YOUR_ACCESS_TOKEN',\n    message='This is notify message',\n    image_thumbnail='https://i.imgur.com/RhvwZVm.png',\n    image_fullsize='https://i.imgur.com/RhvwZVm.png',\n)\nprint(image)\n# {'status': 200, 'message': 'ok'}\n```\n\n## 撤銷 access token\n\n![revoke-line-notify-token](https://i.imgur.com/7GAAzOi.png)\n\n```python\nrevoke = client.revoke(access_token='YOUR_ACCESS_TOKEN')\nprint(revoke)\n# {'status': 200, 'message': 'ok'}\n```\n\n## 在命令列中使用\n```commandline\nlotify --help\n-t, --access_token TEXT  access token  [required]\n-m, --message TEXT       message to send  [required]\n-u, --image-url TEXT     image url to send\n-f, --image-file TEXT    image file path to send\n```\n\n# 貢獻指南\n\n請先 Fork 再 Clone：\n\n```\ngit clone git@github.com:your-username/line-notify.git\n```\n\n首先，安裝開發環境。\n\n```\npip install -r requirements-dev.txt\n```\n\n執行 `pytest` 確定通過測試：\n\n```\ncd line-notify/\npython -m tox\npython -m pytest --flake8 tests/\n```\n\n# 授權條款\n\n[MIT](https://github.com/louis70109/line-notify/blob/master/LICENSE) © [NiJia Lin](https://nijialin.com/about/) \u0026 [Duncan Huang](https://github.com/ragnaok) \u0026 [Samuel C.A. Lee](https://github.com/CA-Lee)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis70109%2Flotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouis70109%2Flotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis70109%2Flotify/lists"}