|
| 1 | +# WxPusher |
| 2 | + |
| 3 | +[](https://badge.fury.io/py/wxpusher) |
| 4 | +[](https://pypi.python.org/pypi/wxpusher/) |
| 5 | +[](https://pypi.python.org/pypi/wxpusher/) |
| 6 | +[](https://pepy.tech/project/wxpusher) |
| 7 | + |
| 8 | +WxPusher Python SDK. |
| 9 | + |
| 10 | +*Read this in other languages: [English](README-en.md), [简体中文](README.md).* |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +### Installation |
| 15 | + |
| 16 | +```shell |
| 17 | +pip install -U wxpusher |
| 18 | +``` |
| 19 | + |
| 20 | +### Usage |
| 21 | + |
| 22 | +```python |
| 23 | +from wxpusher import WxPusher |
| 24 | +WxPusher.send_message('<content>', '<uids>', '<appToken>') |
| 25 | +WxPusher.query_message('<messageId>') |
| 26 | +WxPusher.create_qrcode('<extra>', '<validTime>', '<appToken>') |
| 27 | +WxPusher.query_user('<page>', '<page_size>', '<appToken>') |
| 28 | +``` |
| 29 | + |
| 30 | +## Running the tests |
| 31 | + |
| 32 | +### Setup configuration |
| 33 | + |
| 34 | +Configuration is necessary since the tests depend on VALID `appToken` and `uids`. |
| 35 | + |
| 36 | +Frist, copy the configuration sample `config.sample.py` under `python/wxpusher/tests/` to `config.py` |
| 37 | + |
| 38 | +```shell |
| 39 | +cd python/wxpusher/tests |
| 40 | +cp config.sample.py config.py |
| 41 | +``` |
| 42 | + |
| 43 | +Then, fill in the corresponding information in `config.py`. |
| 44 | + |
| 45 | +### Trigger the tests |
| 46 | + |
| 47 | +With proper configuration, you can run the tests with tox |
| 48 | + |
| 49 | +```shell |
| 50 | +tox |
| 51 | +``` |
| 52 | + |
| 53 | +or nose directly |
| 54 | + |
| 55 | +```shell |
| 56 | +nosetests |
| 57 | +``` |
| 58 | + |
| 59 | +## TODO |
| 60 | + |
| 61 | +- [x] Basic structure with PyPI uploaded. |
| 62 | +- [x] Send Message. |
| 63 | +- [x] Query Message. |
| 64 | +- [x] Create QRCode. |
| 65 | +- [x] Query User. |
| 66 | +- [ ] More client validators. |
| 67 | +- [ ] Command line scripts. |
| 68 | +- [ ] Better documentation. |
| 69 | +- [ ] More robust unittest. |
| 70 | + |
| 71 | +## Contribution |
| 72 | + |
| 73 | +- Comments or suggestions via github issues. |
| 74 | +- Pull requests are welcome absolutely. |
0 commit comments