smsaero-api-async 3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smsaero_api_async-3.0.0/AUTHORS.md +10 -0
- smsaero_api_async-3.0.0/CONTRIBUTING.md +96 -0
- smsaero_api_async-3.0.0/LICENSE +21 -0
- smsaero_api_async-3.0.0/MANIFEST.in +7 -0
- smsaero_api_async-3.0.0/PKG-INFO +127 -0
- smsaero_api_async-3.0.0/README.md +80 -0
- smsaero_api_async-3.0.0/setup.cfg +4 -0
- smsaero_api_async-3.0.0/setup.py +81 -0
- smsaero_api_async-3.0.0/smsaero/__init__.py +1428 -0
- smsaero_api_async-3.0.0/smsaero/command_line.py +53 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/PKG-INFO +127 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/SOURCES.txt +18 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/dependency_links.txt +1 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/entry_points.txt +2 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/not-zip-safe +1 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/requires.txt +14 -0
- smsaero_api_async-3.0.0/smsaero_api_async.egg-info/top_level.txt +1 -0
- smsaero_api_async-3.0.0/tests/test_devmode.py +68 -0
- smsaero_api_async-3.0.0/tests/test_smsaero.py +804 -0
- smsaero_api_async-3.0.0/tests/test_validators.py +337 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
|
4
|
+
|
5
|
+
You can contribute in many ways:
|
6
|
+
|
7
|
+
## Types of Contributions
|
8
|
+
|
9
|
+
### Report Bugs
|
10
|
+
|
11
|
+
Report bugs at [https://github.com/smsaero/smsaero_python_async/issues](https://github.com/smsaero/smsaero_python_async/issues).
|
12
|
+
|
13
|
+
If you are reporting a bug, please include:
|
14
|
+
|
15
|
+
- Your operating system name and version.
|
16
|
+
- Any details about your local setup that might be helpful in troubleshooting.
|
17
|
+
- Detailed steps to reproduce the bug.
|
18
|
+
|
19
|
+
### Fix Bugs
|
20
|
+
|
21
|
+
Look through the GitHub issues for bugs. Anything tagged with "bug" is open to whoever wants to implement it.
|
22
|
+
|
23
|
+
### Implement Features
|
24
|
+
|
25
|
+
Look through the GitHub issues for features. Anything tagged with "feature" is open to whoever wants to implement it.
|
26
|
+
|
27
|
+
### Write Documentation
|
28
|
+
|
29
|
+
smsaero_python_async could always use more documentation, whether as part of the official smsaero_python_async docs, in docstrings, or even on the web in blog posts, articles, and such.
|
30
|
+
|
31
|
+
### Submit Feedback
|
32
|
+
|
33
|
+
The best way to send feedback is to file an issue at [https://github.com/smsaero/smsaero_python_async/issues](https://github.com/smsaero/smsaero_python_async/issues).
|
34
|
+
|
35
|
+
If you are proposing a feature:
|
36
|
+
|
37
|
+
- Explain in detail how it would work.
|
38
|
+
- Keep the scope as narrow as possible, to make it easier to implement.
|
39
|
+
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
|
40
|
+
|
41
|
+
## Get Started!
|
42
|
+
|
43
|
+
Ready to contribute? Here's how to set up `smsaero_python_async` for local development.
|
44
|
+
|
45
|
+
1. Fork the `smsaero_python_async` repo on GitHub.
|
46
|
+
2. Clone your fork locally and switch to development branch:
|
47
|
+
|
48
|
+
```bash
|
49
|
+
git clone git@github.com:smsaero/smsaero_python_async.git
|
50
|
+
cd smsaero_python_async/
|
51
|
+
git fetch --all
|
52
|
+
git checkout development
|
53
|
+
```
|
54
|
+
|
55
|
+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
|
56
|
+
|
57
|
+
```bash
|
58
|
+
mkvirtualenv smsaero_python_async
|
59
|
+
workon smsaero_python_async
|
60
|
+
python setup.py develop
|
61
|
+
```
|
62
|
+
|
63
|
+
4. Create a branch for local development:
|
64
|
+
|
65
|
+
```bash
|
66
|
+
git checkout -b name-of-your-bugfix-or-feature
|
67
|
+
```
|
68
|
+
|
69
|
+
Now you can make your changes locally.
|
70
|
+
|
71
|
+
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
|
72
|
+
|
73
|
+
```bash
|
74
|
+
make pep8
|
75
|
+
make test
|
76
|
+
tox
|
77
|
+
```
|
78
|
+
|
79
|
+
5. Commit your changes and push your branch to GitHub:
|
80
|
+
|
81
|
+
```bash
|
82
|
+
git add .
|
83
|
+
git commit -m "Your detailed description of your changes."
|
84
|
+
git push origin name-of-your-bugfix-or-feature
|
85
|
+
```
|
86
|
+
|
87
|
+
6. Submit a pull request through the GitHub website.
|
88
|
+
|
89
|
+
|
90
|
+
## Pull Request Guidelines
|
91
|
+
|
92
|
+
Before you submit a pull request, check that it meets these guidelines:
|
93
|
+
|
94
|
+
1. The pull request should include tests.
|
95
|
+
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.md.
|
96
|
+
3. The pull request should work with Python 3.6+, PyPy. Check [https://travis-ci.org/smsaero/smsaero_python_async/pull_requests](https://travis-ci.org/smsaero/smsaero_python_async/pull_requests) and make sure that the tests pass for all supported Python versions.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 SmsAero
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
include README.md
|
2
|
+
include LICENSE
|
3
|
+
include AUTHORS.md
|
4
|
+
include CONTRIBUTING.md
|
5
|
+
include requirements/*
|
6
|
+
recursive-exclude * .DS_Store .env tests __pycache__ *.py[co] .idea* .git* .tox* .cache* .pytest_cache* .coverage dist build .dccache .mypy_cache .vscode* .vscode
|
7
|
+
recursive-include smsaero *.py *.po *.mo
|
@@ -0,0 +1,127 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: smsaero_api_async
|
3
|
+
Version: 3.0.0
|
4
|
+
Summary: SmsAero Async API client
|
5
|
+
Home-page: https://github.com/smsaero/smsaero_python/
|
6
|
+
Author: SmsAero
|
7
|
+
Author-email: admin@smsaero.ru
|
8
|
+
License: MIT
|
9
|
+
Keywords: smsaero,api,smsaero_api_async,sms,hlr,viber
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
11
|
+
Classifier: Environment :: Web Environment
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Operating System :: OS Independent
|
15
|
+
Classifier: Programming Language :: Python
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
25
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
27
|
+
Classifier: Topic :: Communications :: Telephony
|
28
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
29
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
30
|
+
Requires-Python: >=3.6
|
31
|
+
Description-Content-Type: text/markdown
|
32
|
+
License-File: LICENSE
|
33
|
+
License-File: AUTHORS.md
|
34
|
+
Requires-Dist: setuptools
|
35
|
+
Requires-Dist: aiohttp
|
36
|
+
Provides-Extra: dev
|
37
|
+
Requires-Dist: pytest>=8.2.2; extra == "dev"
|
38
|
+
Requires-Dist: flake8>=7.1.0; extra == "dev"
|
39
|
+
Requires-Dist: ruff>=0.4.10; extra == "dev"
|
40
|
+
Requires-Dist: pylint>=3.2.4; extra == "dev"
|
41
|
+
Requires-Dist: tox>=4.15.1; extra == "dev"
|
42
|
+
Requires-Dist: mypy>=1.10.0; extra == "dev"
|
43
|
+
Requires-Dist: coverage>=7.5.4; extra == "dev"
|
44
|
+
Requires-Dist: bandit>=1.7.9; extra == "dev"
|
45
|
+
Requires-Dist: build>=1.2.1; extra == "dev"
|
46
|
+
Requires-Dist: twine>=5.1.1; extra == "dev"
|
47
|
+
|
48
|
+
# SmsAero async API client
|
49
|
+
|
50
|
+
[](https://badge.fury.io/py/smsaero-api-async)
|
51
|
+
[](https://pypi.org/project/smsaero-api-async/)
|
52
|
+
[](https://pepy.tech/project/smsaero-api-async)
|
53
|
+
[](MIT-LICENSE)
|
54
|
+
|
55
|
+
## Installation (from PyPI):
|
56
|
+
|
57
|
+
```bash
|
58
|
+
pip install -U smsaero-api-async
|
59
|
+
```
|
60
|
+
|
61
|
+
## Usage example:
|
62
|
+
|
63
|
+
Get credentials from account settings page: https://smsaero.ru/cabinet/settings/apikey/
|
64
|
+
|
65
|
+
```python
|
66
|
+
import pprint
|
67
|
+
import asyncio
|
68
|
+
import smsaero
|
69
|
+
|
70
|
+
|
71
|
+
SMSAERO_EMAIL = 'your email'
|
72
|
+
SMSAERO_API_KEY = 'your api key'
|
73
|
+
|
74
|
+
|
75
|
+
async def send_sms(phone: int, message: str) -> None:
|
76
|
+
"""
|
77
|
+
Sends an SMS message
|
78
|
+
|
79
|
+
Parameters:
|
80
|
+
phone (int): The phone number to which the SMS message will be sent.
|
81
|
+
message (str): The content of the SMS message to be sent.
|
82
|
+
"""
|
83
|
+
api = smsaero.SmsAero(SMSAERO_EMAIL, SMSAERO_API_KEY)
|
84
|
+
try:
|
85
|
+
result = await api.send_sms(phone, message)
|
86
|
+
pprint.pprint(result)
|
87
|
+
finally:
|
88
|
+
await api.close_session()
|
89
|
+
|
90
|
+
|
91
|
+
if __name__ == '__main__':
|
92
|
+
asyncio.run(send_sms(70000000000, 'Hello, World!'))
|
93
|
+
```
|
94
|
+
|
95
|
+
#### Exceptions:
|
96
|
+
|
97
|
+
* `SmsAeroException` - base exception class for all exceptions raised by the library.
|
98
|
+
* `SmsAeroConnectionException` - exception raised when there is a connection error.
|
99
|
+
* `SmsAeroNoMoneyException` - exception raised when there is not enough money in the account.
|
100
|
+
|
101
|
+
|
102
|
+
## Command line usage:
|
103
|
+
|
104
|
+
```bash
|
105
|
+
SMSAERO_EMAIL="your email"
|
106
|
+
SMSAERO_API_KEY="your api key"
|
107
|
+
|
108
|
+
smsaero_send --email "$SMSAERO_EMAIL" --api_key "$SMSAERO_API_KEY" --phone 70000000000 --message 'Hello, World!'
|
109
|
+
```
|
110
|
+
|
111
|
+
## Run on Docker:
|
112
|
+
|
113
|
+
```bash
|
114
|
+
docker pull 'smsaero/smsaero_python_async:latest'
|
115
|
+
docker run -it --rm 'smsaero/smsaero_python_async:latest' smsaero_send --email "your email" --api_key "your api key" --phone 70000000000 --message 'Hello, World!'
|
116
|
+
```
|
117
|
+
|
118
|
+
## Compatibility:
|
119
|
+
|
120
|
+
* Currently version of library is compatible with Python 3.6+.
|
121
|
+
|
122
|
+
|
123
|
+
## License:
|
124
|
+
|
125
|
+
```
|
126
|
+
MIT License
|
127
|
+
```
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# SmsAero async API client
|
2
|
+
|
3
|
+
[](https://badge.fury.io/py/smsaero-api-async)
|
4
|
+
[](https://pypi.org/project/smsaero-api-async/)
|
5
|
+
[](https://pepy.tech/project/smsaero-api-async)
|
6
|
+
[](MIT-LICENSE)
|
7
|
+
|
8
|
+
## Installation (from PyPI):
|
9
|
+
|
10
|
+
```bash
|
11
|
+
pip install -U smsaero-api-async
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage example:
|
15
|
+
|
16
|
+
Get credentials from account settings page: https://smsaero.ru/cabinet/settings/apikey/
|
17
|
+
|
18
|
+
```python
|
19
|
+
import pprint
|
20
|
+
import asyncio
|
21
|
+
import smsaero
|
22
|
+
|
23
|
+
|
24
|
+
SMSAERO_EMAIL = 'your email'
|
25
|
+
SMSAERO_API_KEY = 'your api key'
|
26
|
+
|
27
|
+
|
28
|
+
async def send_sms(phone: int, message: str) -> None:
|
29
|
+
"""
|
30
|
+
Sends an SMS message
|
31
|
+
|
32
|
+
Parameters:
|
33
|
+
phone (int): The phone number to which the SMS message will be sent.
|
34
|
+
message (str): The content of the SMS message to be sent.
|
35
|
+
"""
|
36
|
+
api = smsaero.SmsAero(SMSAERO_EMAIL, SMSAERO_API_KEY)
|
37
|
+
try:
|
38
|
+
result = await api.send_sms(phone, message)
|
39
|
+
pprint.pprint(result)
|
40
|
+
finally:
|
41
|
+
await api.close_session()
|
42
|
+
|
43
|
+
|
44
|
+
if __name__ == '__main__':
|
45
|
+
asyncio.run(send_sms(70000000000, 'Hello, World!'))
|
46
|
+
```
|
47
|
+
|
48
|
+
#### Exceptions:
|
49
|
+
|
50
|
+
* `SmsAeroException` - base exception class for all exceptions raised by the library.
|
51
|
+
* `SmsAeroConnectionException` - exception raised when there is a connection error.
|
52
|
+
* `SmsAeroNoMoneyException` - exception raised when there is not enough money in the account.
|
53
|
+
|
54
|
+
|
55
|
+
## Command line usage:
|
56
|
+
|
57
|
+
```bash
|
58
|
+
SMSAERO_EMAIL="your email"
|
59
|
+
SMSAERO_API_KEY="your api key"
|
60
|
+
|
61
|
+
smsaero_send --email "$SMSAERO_EMAIL" --api_key "$SMSAERO_API_KEY" --phone 70000000000 --message 'Hello, World!'
|
62
|
+
```
|
63
|
+
|
64
|
+
## Run on Docker:
|
65
|
+
|
66
|
+
```bash
|
67
|
+
docker pull 'smsaero/smsaero_python_async:latest'
|
68
|
+
docker run -it --rm 'smsaero/smsaero_python_async:latest' smsaero_send --email "your email" --api_key "your api key" --phone 70000000000 --message 'Hello, World!'
|
69
|
+
```
|
70
|
+
|
71
|
+
## Compatibility:
|
72
|
+
|
73
|
+
* Currently version of library is compatible with Python 3.6+.
|
74
|
+
|
75
|
+
|
76
|
+
## License:
|
77
|
+
|
78
|
+
```
|
79
|
+
MIT License
|
80
|
+
```
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"""Setup script for the SmsAero API client package."""
|
2
|
+
|
3
|
+
from setuptools import setup, find_packages
|
4
|
+
|
5
|
+
|
6
|
+
with open("README.md", "r", encoding="utf-8") as file:
|
7
|
+
long_description = file.read()
|
8
|
+
|
9
|
+
|
10
|
+
setup(
|
11
|
+
name="smsaero_api_async",
|
12
|
+
version="3.0.0",
|
13
|
+
description="SmsAero Async API client",
|
14
|
+
keywords=[
|
15
|
+
"smsaero",
|
16
|
+
"api",
|
17
|
+
"smsaero_api_async",
|
18
|
+
"sms",
|
19
|
+
"hlr",
|
20
|
+
"viber",
|
21
|
+
],
|
22
|
+
long_description=long_description,
|
23
|
+
long_description_content_type="text/markdown",
|
24
|
+
author="SmsAero",
|
25
|
+
author_email="admin@smsaero.ru",
|
26
|
+
help_center="https://smsaero.ru/support/",
|
27
|
+
url="https://github.com/smsaero/smsaero_python/",
|
28
|
+
license="MIT",
|
29
|
+
packages=find_packages(exclude=["tests", "tests.*"]),
|
30
|
+
python_requires=">=3.6",
|
31
|
+
include_package_data=True,
|
32
|
+
install_requires=[
|
33
|
+
"setuptools",
|
34
|
+
"aiohttp",
|
35
|
+
],
|
36
|
+
extras_require={
|
37
|
+
"dev": [
|
38
|
+
"pytest >= 8.2.2",
|
39
|
+
"flake8 >= 7.1.0",
|
40
|
+
"ruff >= 0.4.10",
|
41
|
+
"pylint >= 3.2.4",
|
42
|
+
"tox >= 4.15.1",
|
43
|
+
"mypy >= 1.10.0",
|
44
|
+
"coverage >= 7.5.4",
|
45
|
+
"bandit >= 1.7.9",
|
46
|
+
"build >= 1.2.1",
|
47
|
+
"twine >= 5.1.1",
|
48
|
+
],
|
49
|
+
},
|
50
|
+
zip_safe=False,
|
51
|
+
classifiers=[
|
52
|
+
"Development Status :: 5 - Production/Stable",
|
53
|
+
"Environment :: Web Environment",
|
54
|
+
"Intended Audience :: Developers",
|
55
|
+
"License :: OSI Approved :: MIT License",
|
56
|
+
"Operating System :: OS Independent",
|
57
|
+
"Programming Language :: Python",
|
58
|
+
"Programming Language :: Python :: 3.6",
|
59
|
+
"Programming Language :: Python :: 3.7",
|
60
|
+
"Programming Language :: Python :: 3.8",
|
61
|
+
"Programming Language :: Python :: 3.9",
|
62
|
+
"Programming Language :: Python :: 3.10",
|
63
|
+
"Programming Language :: Python :: 3.11",
|
64
|
+
"Programming Language :: Python :: 3.12",
|
65
|
+
"Programming Language :: Python :: 3.13",
|
66
|
+
"Programming Language :: Python :: 3.14",
|
67
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
68
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
69
|
+
"Topic :: Communications :: Telephony",
|
70
|
+
"Topic :: Internet :: WWW/HTTP",
|
71
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
72
|
+
],
|
73
|
+
entry_points={
|
74
|
+
"console_scripts": [
|
75
|
+
"smsaero_send=smsaero.command_line:main",
|
76
|
+
],
|
77
|
+
},
|
78
|
+
options={
|
79
|
+
"bdist_wheel": {"universal": True},
|
80
|
+
},
|
81
|
+
)
|