smsapi-client-2.9.6
توضیحات
SmsAPI client
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | smsapi-client-2.9.6 |
| نام | smsapi-client |
| نسخه کتابخانه | 2.9.6 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | SMSAPI |
| ایمیل نویسنده | bok@smsapi.pl |
| آدرس صفحه اصلی | https://github.com/smsapi/smsapi-python-client |
| آدرس اینترنتی | https://pypi.org/project/smsapi-client/ |
| مجوز | - |
# smsapi-python
[](https://travis-ci.org/smsapi/smsapi-python-client)
[](https://pypi.python.org/pypi/smsapi-client)
Client for SMSAPI.
## COMPATIBILITY
Compatible with Python 2.7+, 3.+.
## REQUIREMENTS
requests
## INSTALLATION
If You have pip installed:
sudo pip install smsapi-client
else You can install manually:
git clone https://github.com/smsapi/smsapi-python-client.git
cd smsapi-python
python setup.py install
## Client instance
If You are smsapi.pl customer You should import
```python
from smsapi.client import SmsApiPlClient
```
else You need to use client for smsapi.com
```python
from smsapi.client import SmsApiComClient
```
## Credentials
#### Access Token
```python
from smsapi.client import SmsApiPlClient
token = "XXXX"
client = SmsApiPlClient(access_token=token)
```
## Examples
#### Send SMS
```python
from smsapi.client import SmsApiPlClient
token = "XXXX"
client = SmsApiPlClient(access_token=token)
send_results = client.sms.send(to="phone number", message="text message")
for result in send_results:
print(result.id, result.points, result.error)
```
- **You can find more examples in "examples" directory in project files.**
## Error handling
```python
from smsapi.client import SmsApiPlClient
from smsapi.exception import SmsApiException
token = "XXXX"
client = SmsApiPlClient(access_token=token)
try:
contact = client.sms.send(to="123123")
except SmsApiException as e:
print(e.message, e.code)
```
## LICENSE
[Apache 2.0 License](https://github.com/smsapi/smsapi-python-client/blob/master/LICENSE)
نیازمندی
| مقدار | نام |
|---|---|
| - | requests |
نحوه نصب
نصب پکیج whl smsapi-client-2.9.6:
pip install smsapi-client-2.9.6.whl
نصب پکیج tar.gz smsapi-client-2.9.6:
pip install smsapi-client-2.9.6.tar.gz