| Name | vme JSON |
| Version |
0.0.5
JSON |
| download |
| home_page | None |
| Summary | WeChat Work Message Bot. |
| upload_time | 2024-10-21 02:05:04 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.6 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Python API for [WeChat Work](https://work.weixin.qq.com) Message Bot
**[企业微信](https://work.weixin.qq.com)群机器人 Python 接口和命令行工具。**
About the name: `v` = WeChat, `me` = Me, `vme` = WeChat Me. It's somewhat inspired by Chinese Internet meme "VME50".
**vme** is [listed on PyPI](https://pypi.org/project/vme/).
**vme** is dependency-free.
## Python API
`vme.send()` sends text (`str`) or image (`bytes`). Due to limitations of WeChat Work, only PNG and JPG images under 2M size are allowed. Image is recognized by detecting first few bytes (magic bits) of the binary data. An exception will be raised if payload is neither text nor image.
All texts are sent as markdown. Please note that the markdown features WeChat Work supports are [extremely limited](https://developer.work.weixin.qq.com/document/path/91770#markdown%E7%B1%BB%E5%9E%8B).
`vme.send_file()` is not implemented yet.
```python
import vme
# send text
vme.send('your-bot-key', 'Texts with `minimal markdown` support.')
# send image, only PNG or JPG are supported
image = plot_some_curve(...)
vme.send('your-bot-key', image)
# send file (NOT implemented yet)
vme.send_file('your-bot-key', '/path/to/your/file')
```
## Command Line Tool
`vme` is runnable with `python3 -m vme` or `python3 vme.py` command line.
### Send text or image
Text or image data can only be read through pipe or input redirection:
```bash
# sending texts from another process
echo "hello world" | ./vme.py your-bot-key
# sending an image from file
./vme.py your-bot-key < plot.png
# sending long texts in a file
./vme.py your-bot-key < message.txt
# sending image from another process
my-plot --stdout ... | ./vme.py your-bot-key
```
### Send file
Althrough the API is still not implemented yet, command line semantic for "send this file as a file" is designed.
```bash
# sending a file
./vme.py your-bot-key /path/to/your/file
```
Raw data
{
"_id": null,
"home_page": null,
"name": "vme",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Sun Yijiang <sunyijiang@gmail.com>",
"download_url": null,
"platform": null,
"description": "# Python API for [WeChat Work](https://work.weixin.qq.com) Message Bot\n\n**[\u4f01\u4e1a\u5fae\u4fe1](https://work.weixin.qq.com)\u7fa4\u673a\u5668\u4eba Python \u63a5\u53e3\u548c\u547d\u4ee4\u884c\u5de5\u5177\u3002**\n\nAbout the name: `v` = WeChat, `me` = Me, `vme` = WeChat Me. It's somewhat inspired by Chinese Internet meme \"VME50\".\n\n**vme** is [listed on PyPI](https://pypi.org/project/vme/).\n\n**vme** is dependency-free.\n\n## Python API\n\n`vme.send()` sends text (`str`) or image (`bytes`). Due to limitations of WeChat Work, only PNG and JPG images under 2M size are allowed. Image is recognized by detecting first few bytes (magic bits) of the binary data. An exception will be raised if payload is neither text nor image.\n\nAll texts are sent as markdown. Please note that the markdown features WeChat Work supports are [extremely limited](https://developer.work.weixin.qq.com/document/path/91770#markdown%E7%B1%BB%E5%9E%8B).\n\n`vme.send_file()` is not implemented yet.\n\n```python\nimport vme\n\n# send text\nvme.send('your-bot-key', 'Texts with `minimal markdown` support.')\n\n# send image, only PNG or JPG are supported\nimage = plot_some_curve(...)\nvme.send('your-bot-key', image)\n\n# send file (NOT implemented yet)\nvme.send_file('your-bot-key', '/path/to/your/file')\n```\n\n## Command Line Tool\n\n`vme` is runnable with `python3 -m vme` or `python3 vme.py` command line.\n\n### Send text or image\n\nText or image data can only be read through pipe or input redirection:\n\n```bash\n# sending texts from another process\necho \"hello world\" | ./vme.py your-bot-key\n\n# sending an image from file\n./vme.py your-bot-key < plot.png\n\n# sending long texts in a file\n./vme.py your-bot-key < message.txt\n\n# sending image from another process\nmy-plot --stdout ... | ./vme.py your-bot-key\n```\n\n### Send file\n\nAlthrough the API is still not implemented yet, command line semantic for \"send this file as a file\" is designed.\n\n```bash\n# sending a file\n./vme.py your-bot-key /path/to/your/file\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "WeChat Work Message Bot.",
"version": "0.0.5",
"project_urls": {
"Bug Tracker": "https://github.com/sunyj/vme/issues",
"Homepage": "https://github.com/sunyj/vme"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f1764690b14e4a5f161ba022c7686c29399e1861f6450e26cb9ab008c01c6351",
"md5": "b5ceef90f19545304bfc3a7c311c494e",
"sha256": "b9aa9ae5cc0223acf55ab496f4019a43ca785b971299aa18cfc906b8f7a97dfc"
},
"downloads": -1,
"filename": "vme-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b5ceef90f19545304bfc3a7c311c494e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4347,
"upload_time": "2024-10-21T02:05:04",
"upload_time_iso_8601": "2024-10-21T02:05:04.354686Z",
"url": "https://files.pythonhosted.org/packages/f1/76/4690b14e4a5f161ba022c7686c29399e1861f6450e26cb9ab008c01c6351/vme-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-21 02:05:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sunyj",
"github_project": "vme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "vme"
}