smsgora 1.0.0__tar.gz → 1.0.2__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.
- {smsgora-1.0.0/src/smsgora.egg-info → smsgora-1.0.2}/PKG-INFO +158 -156
- {smsgora-1.0.0 → smsgora-1.0.2}/README.md +2 -0
- {smsgora-1.0.0 → smsgora-1.0.2}/pyproject.toml +5 -5
- {smsgora-1.0.0 → smsgora-1.0.2}/setup.cfg +4 -4
- {smsgora-1.0.0 → smsgora-1.0.2}/src/smsgora/__init__.py +1 -1
- {smsgora-1.0.0 → smsgora-1.0.2/src/smsgora.egg-info}/PKG-INFO +158 -156
- {smsgora-1.0.0 → smsgora-1.0.2}/LICENSE +0 -0
- {smsgora-1.0.0 → smsgora-1.0.2}/src/smsgora.egg-info/SOURCES.txt +0 -0
- {smsgora-1.0.0 → smsgora-1.0.2}/src/smsgora.egg-info/dependency_links.txt +0 -0
- {smsgora-1.0.0 → smsgora-1.0.2}/src/smsgora.egg-info/top_level.txt +0 -0
- {smsgora-1.0.0 → smsgora-1.0.2}/tests/test_smsgora.py +0 -0
|
@@ -1,156 +1,158 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: smsgora
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
5
|
-
Author-email: Tekservix <support@tekservix.com>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://tekservix.com/smsgora/
|
|
8
|
-
Project-URL: Documentation, https://tekservix.com/smsgora/docs/
|
|
9
|
-
Project-URL: Source, https://github.com/
|
|
10
|
-
Project-URL: Issues, https://github.com/
|
|
11
|
-
Keywords: sms,sms-gateway,sms-api,bulk-sms,send-sms,android-sms-gateway,otp,textbee,smsgora,tekservix
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Communications :: Telephony
|
|
16
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
-
Requires-Python: >=3.8
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
License-File: LICENSE
|
|
20
|
-
Dynamic: license-file
|
|
21
|
-
|
|
22
|
-
# smsgora
|
|
23
|
-
|
|
24
|
-
Python client
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- [
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: smsgora
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: SMS Gora SMS Gateway: official Python client by Tekservix. Send and receive SMS through your own Android phones, with delivery reports and signed webhooks.
|
|
5
|
+
Author-email: Tekservix <support@tekservix.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://tekservix.com/smsgora/
|
|
8
|
+
Project-URL: Documentation, https://tekservix.com/smsgora/docs/
|
|
9
|
+
Project-URL: Source, https://github.com/tekservixhq/smsgora-python
|
|
10
|
+
Project-URL: Issues, https://github.com/tekservixhq/smsgora-python/issues
|
|
11
|
+
Keywords: sms,sms-api-gateway,sms-gateway,sms-api,bulk-sms,send-sms,android-sms-gateway,otp,textbee,smsgora,tekservix
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Communications :: Telephony
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# smsgora
|
|
23
|
+
|
|
24
|
+
**SMS Gora SMS Gateway** - official Python client: send and receive SMS through your own Android phones. By Tekservix.
|
|
25
|
+
|
|
26
|
+
Python client for the [SMS Gora SMS Gateway](https://tekservix.com/smsgora/) API.
|
|
27
|
+
|
|
28
|
+
SMS Gora turns Android phones with ordinary SIM cards into an SMS gateway. Your server calls the API, a linked phone sends the text, and replies and delivery reports come back to you. There's no sender ID registration and no per-message fee from us: your mobile operator bills the texts like any SMS.
|
|
29
|
+
|
|
30
|
+
- Zero dependencies (standard library only), Python 3.8+
|
|
31
|
+
- Works in Django, Flask, FastAPI, scripts and cron jobs
|
|
32
|
+
- Webhook signature check built in
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install smsgora
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
Create an API key in the SMS Gora dashboard (SMS Gora -> API keys) and keep it on your server.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import os
|
|
46
|
+
from smsgora import SmsGora
|
|
47
|
+
|
|
48
|
+
sms = SmsGora(api_key=os.environ["SMSGORA_KEY"])
|
|
49
|
+
|
|
50
|
+
result = sms.send_sms(to="+15551234567", message="Your verification code is 482913")
|
|
51
|
+
print(result["message_ids"]) # [1873]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Sending
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from datetime import datetime, timezone
|
|
58
|
+
|
|
59
|
+
# Several recipients (up to 1,000 per call)
|
|
60
|
+
sms.send_sms(to=["+15551234567", "+447700900123"], message="Your order has shipped")
|
|
61
|
+
|
|
62
|
+
# From a chosen phone and SIM, scheduled for later
|
|
63
|
+
sms.send_sms(
|
|
64
|
+
to="+15551234567",
|
|
65
|
+
message="Reminder: your appointment is tomorrow at 10:00",
|
|
66
|
+
device_id=42,
|
|
67
|
+
sim_slot=1, # 0 = SIM 1, 1 = SIM 2
|
|
68
|
+
schedule_at=datetime(2026, 12, 1, 8, 0, tzinfo=timezone.utc),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Different texts for different people in one call (up to 5,000 recipients)
|
|
72
|
+
sms.send_bulk_sms(
|
|
73
|
+
42,
|
|
74
|
+
message_template="Hello, your parcel is ready for pickup.",
|
|
75
|
+
messages=[
|
|
76
|
+
{"recipients": ["+15551234567"], "message": "Hi Aline, parcel #1042 is ready."},
|
|
77
|
+
{"recipients": ["+15557654321"]},
|
|
78
|
+
],
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Delivery status and incoming SMS
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
msg = sms.get_message(1873)
|
|
86
|
+
print(msg["status"]) # queued -> dispatched -> sent -> delivered (or failed)
|
|
87
|
+
|
|
88
|
+
sms.cancel_message(1874) # works while queued or scheduled
|
|
89
|
+
|
|
90
|
+
inbox = sms.list_received_sms(since="2026-11-01", limit=50)
|
|
91
|
+
phones = sms.list_devices()
|
|
92
|
+
account = sms.get_account()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Anything else in the [API reference](https://tekservix.com/smsgora/docs/) is one call away:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
batch = sms.request("GET", "/batches/311")
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Webhooks
|
|
102
|
+
|
|
103
|
+
Add your HTTPS URL in SMS Gora -> Webhooks (or with `create_webhook`) and keep the secret. Each request carries `X-SmsGora-Signature: sha256=...`, an HMAC-SHA256 of the raw body. Check it before trusting the request. Flask example:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import json, os
|
|
107
|
+
from flask import Flask, request, abort
|
|
108
|
+
from smsgora import verify_webhook
|
|
109
|
+
|
|
110
|
+
app = Flask(__name__)
|
|
111
|
+
|
|
112
|
+
@app.post("/sms/webhook")
|
|
113
|
+
def sms_webhook():
|
|
114
|
+
if not verify_webhook(request.get_data(), request.headers.get("X-SmsGora-Signature"),
|
|
115
|
+
os.environ["SMSGORA_WEBHOOK_SECRET"]):
|
|
116
|
+
abort(401)
|
|
117
|
+
event = json.loads(request.get_data())
|
|
118
|
+
if event["event"] == "sms.received":
|
|
119
|
+
print(event["data"]["from"], event["data"]["message"])
|
|
120
|
+
return "", 200 # answer within 10 seconds; queue slow work
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
In Django use `request.body`; in FastAPI use `await request.body()`. Always pass the raw bytes, not re-encoded JSON.
|
|
124
|
+
|
|
125
|
+
## Errors
|
|
126
|
+
|
|
127
|
+
Failed calls raise `SmsGoraError` with `status`, `message`, field `errors` and, on 429, `retry_after` in seconds.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from smsgora import SmsGoraError
|
|
131
|
+
|
|
132
|
+
try:
|
|
133
|
+
sms.send_sms(to="+15551234567", message="Hi")
|
|
134
|
+
except SmsGoraError as err:
|
|
135
|
+
if err.status == 429:
|
|
136
|
+
pass # rate limit (300 requests/minute per key) or plan limit reached
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Never ship the key inside a browser or mobile app: anyone could read it. Call the API from your server.
|
|
140
|
+
|
|
141
|
+
## Migrating from TextBee
|
|
142
|
+
|
|
143
|
+
SMS Gora accepts TextBee-style requests, so most integrations switch by changing the base URL and key. See the [compatibility notes](https://tekservix.com/smsgora/docs/).
|
|
144
|
+
|
|
145
|
+
## Good to know
|
|
146
|
+
|
|
147
|
+
A phone-based gateway suits OTPs, order alerts, reminders and two-way conversations at moderate volume. It isn't meant for mass marketing blasts, and in the US high-volume business texting belongs on registered 10DLC or toll-free numbers.
|
|
148
|
+
|
|
149
|
+
## More from Tekservix
|
|
150
|
+
|
|
151
|
+
- [WAservix WhatsApp API Gateway](https://tekservix.com/waservix/): send WhatsApp messages from your own number (`pip install waservix`)
|
|
152
|
+
- [AI Sales Agent](https://tekservix.com/ai-sales-agent): answers customers on WhatsApp and SMS using your website's content
|
|
153
|
+
- [Website to App](https://tekservix.com/mobile-apps): turn your website into Android and iOS apps
|
|
154
|
+
- Also on npm: `npm install smsgora`
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
MIT
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# smsgora
|
|
2
2
|
|
|
3
|
+
**SMS Gora SMS Gateway** - official Python client: send and receive SMS through your own Android phones. By Tekservix.
|
|
4
|
+
|
|
3
5
|
Python client for the [SMS Gora SMS Gateway](https://tekservix.com/smsgora/) API.
|
|
4
6
|
|
|
5
7
|
SMS Gora turns Android phones with ordinary SIM cards into an SMS gateway. Your server calls the API, a linked phone sends the text, and replies and delivery reports come back to you. There's no sender ID registration and no per-message fee from us: your mobile operator bills the texts like any SMS.
|
|
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "smsgora"
|
|
7
|
-
version = "1.0.
|
|
8
|
-
description = "
|
|
7
|
+
version = "1.0.2"
|
|
8
|
+
description = "SMS Gora SMS Gateway: official Python client by Tekservix. Send and receive SMS through your own Android phones, with delivery reports and signed webhooks."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
12
12
|
authors = [{ name = "Tekservix", email = "support@tekservix.com" }]
|
|
13
13
|
requires-python = ">=3.8"
|
|
14
|
-
keywords = ["sms", "sms-gateway", "sms-api", "bulk-sms", "send-sms", "android-sms-gateway", "otp", "textbee", "smsgora", "tekservix"]
|
|
14
|
+
keywords = ["sms", "sms-api-gateway", "sms-gateway", "sms-api", "bulk-sms", "send-sms", "android-sms-gateway", "otp", "textbee", "smsgora", "tekservix"]
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Programming Language :: Python :: 3",
|
|
17
17
|
"Operating System :: OS Independent",
|
|
@@ -23,5 +23,5 @@ classifiers = [
|
|
|
23
23
|
[project.urls]
|
|
24
24
|
Homepage = "https://tekservix.com/smsgora/"
|
|
25
25
|
Documentation = "https://tekservix.com/smsgora/docs/"
|
|
26
|
-
Source = "https://github.com/
|
|
27
|
-
Issues = "https://github.com/
|
|
26
|
+
Source = "https://github.com/tekservixhq/smsgora-python"
|
|
27
|
+
Issues = "https://github.com/tekservixhq/smsgora-python/issues"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
@@ -1,156 +1,158 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: smsgora
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
5
|
-
Author-email: Tekservix <support@tekservix.com>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://tekservix.com/smsgora/
|
|
8
|
-
Project-URL: Documentation, https://tekservix.com/smsgora/docs/
|
|
9
|
-
Project-URL: Source, https://github.com/
|
|
10
|
-
Project-URL: Issues, https://github.com/
|
|
11
|
-
Keywords: sms,sms-gateway,sms-api,bulk-sms,send-sms,android-sms-gateway,otp,textbee,smsgora,tekservix
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Communications :: Telephony
|
|
16
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
-
Requires-Python: >=3.8
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
License-File: LICENSE
|
|
20
|
-
Dynamic: license-file
|
|
21
|
-
|
|
22
|
-
# smsgora
|
|
23
|
-
|
|
24
|
-
Python client
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- [
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: smsgora
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: SMS Gora SMS Gateway: official Python client by Tekservix. Send and receive SMS through your own Android phones, with delivery reports and signed webhooks.
|
|
5
|
+
Author-email: Tekservix <support@tekservix.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://tekservix.com/smsgora/
|
|
8
|
+
Project-URL: Documentation, https://tekservix.com/smsgora/docs/
|
|
9
|
+
Project-URL: Source, https://github.com/tekservixhq/smsgora-python
|
|
10
|
+
Project-URL: Issues, https://github.com/tekservixhq/smsgora-python/issues
|
|
11
|
+
Keywords: sms,sms-api-gateway,sms-gateway,sms-api,bulk-sms,send-sms,android-sms-gateway,otp,textbee,smsgora,tekservix
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Communications :: Telephony
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# smsgora
|
|
23
|
+
|
|
24
|
+
**SMS Gora SMS Gateway** - official Python client: send and receive SMS through your own Android phones. By Tekservix.
|
|
25
|
+
|
|
26
|
+
Python client for the [SMS Gora SMS Gateway](https://tekservix.com/smsgora/) API.
|
|
27
|
+
|
|
28
|
+
SMS Gora turns Android phones with ordinary SIM cards into an SMS gateway. Your server calls the API, a linked phone sends the text, and replies and delivery reports come back to you. There's no sender ID registration and no per-message fee from us: your mobile operator bills the texts like any SMS.
|
|
29
|
+
|
|
30
|
+
- Zero dependencies (standard library only), Python 3.8+
|
|
31
|
+
- Works in Django, Flask, FastAPI, scripts and cron jobs
|
|
32
|
+
- Webhook signature check built in
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install smsgora
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
Create an API key in the SMS Gora dashboard (SMS Gora -> API keys) and keep it on your server.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import os
|
|
46
|
+
from smsgora import SmsGora
|
|
47
|
+
|
|
48
|
+
sms = SmsGora(api_key=os.environ["SMSGORA_KEY"])
|
|
49
|
+
|
|
50
|
+
result = sms.send_sms(to="+15551234567", message="Your verification code is 482913")
|
|
51
|
+
print(result["message_ids"]) # [1873]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Sending
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from datetime import datetime, timezone
|
|
58
|
+
|
|
59
|
+
# Several recipients (up to 1,000 per call)
|
|
60
|
+
sms.send_sms(to=["+15551234567", "+447700900123"], message="Your order has shipped")
|
|
61
|
+
|
|
62
|
+
# From a chosen phone and SIM, scheduled for later
|
|
63
|
+
sms.send_sms(
|
|
64
|
+
to="+15551234567",
|
|
65
|
+
message="Reminder: your appointment is tomorrow at 10:00",
|
|
66
|
+
device_id=42,
|
|
67
|
+
sim_slot=1, # 0 = SIM 1, 1 = SIM 2
|
|
68
|
+
schedule_at=datetime(2026, 12, 1, 8, 0, tzinfo=timezone.utc),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Different texts for different people in one call (up to 5,000 recipients)
|
|
72
|
+
sms.send_bulk_sms(
|
|
73
|
+
42,
|
|
74
|
+
message_template="Hello, your parcel is ready for pickup.",
|
|
75
|
+
messages=[
|
|
76
|
+
{"recipients": ["+15551234567"], "message": "Hi Aline, parcel #1042 is ready."},
|
|
77
|
+
{"recipients": ["+15557654321"]},
|
|
78
|
+
],
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Delivery status and incoming SMS
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
msg = sms.get_message(1873)
|
|
86
|
+
print(msg["status"]) # queued -> dispatched -> sent -> delivered (or failed)
|
|
87
|
+
|
|
88
|
+
sms.cancel_message(1874) # works while queued or scheduled
|
|
89
|
+
|
|
90
|
+
inbox = sms.list_received_sms(since="2026-11-01", limit=50)
|
|
91
|
+
phones = sms.list_devices()
|
|
92
|
+
account = sms.get_account()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Anything else in the [API reference](https://tekservix.com/smsgora/docs/) is one call away:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
batch = sms.request("GET", "/batches/311")
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Webhooks
|
|
102
|
+
|
|
103
|
+
Add your HTTPS URL in SMS Gora -> Webhooks (or with `create_webhook`) and keep the secret. Each request carries `X-SmsGora-Signature: sha256=...`, an HMAC-SHA256 of the raw body. Check it before trusting the request. Flask example:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import json, os
|
|
107
|
+
from flask import Flask, request, abort
|
|
108
|
+
from smsgora import verify_webhook
|
|
109
|
+
|
|
110
|
+
app = Flask(__name__)
|
|
111
|
+
|
|
112
|
+
@app.post("/sms/webhook")
|
|
113
|
+
def sms_webhook():
|
|
114
|
+
if not verify_webhook(request.get_data(), request.headers.get("X-SmsGora-Signature"),
|
|
115
|
+
os.environ["SMSGORA_WEBHOOK_SECRET"]):
|
|
116
|
+
abort(401)
|
|
117
|
+
event = json.loads(request.get_data())
|
|
118
|
+
if event["event"] == "sms.received":
|
|
119
|
+
print(event["data"]["from"], event["data"]["message"])
|
|
120
|
+
return "", 200 # answer within 10 seconds; queue slow work
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
In Django use `request.body`; in FastAPI use `await request.body()`. Always pass the raw bytes, not re-encoded JSON.
|
|
124
|
+
|
|
125
|
+
## Errors
|
|
126
|
+
|
|
127
|
+
Failed calls raise `SmsGoraError` with `status`, `message`, field `errors` and, on 429, `retry_after` in seconds.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from smsgora import SmsGoraError
|
|
131
|
+
|
|
132
|
+
try:
|
|
133
|
+
sms.send_sms(to="+15551234567", message="Hi")
|
|
134
|
+
except SmsGoraError as err:
|
|
135
|
+
if err.status == 429:
|
|
136
|
+
pass # rate limit (300 requests/minute per key) or plan limit reached
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Never ship the key inside a browser or mobile app: anyone could read it. Call the API from your server.
|
|
140
|
+
|
|
141
|
+
## Migrating from TextBee
|
|
142
|
+
|
|
143
|
+
SMS Gora accepts TextBee-style requests, so most integrations switch by changing the base URL and key. See the [compatibility notes](https://tekservix.com/smsgora/docs/).
|
|
144
|
+
|
|
145
|
+
## Good to know
|
|
146
|
+
|
|
147
|
+
A phone-based gateway suits OTPs, order alerts, reminders and two-way conversations at moderate volume. It isn't meant for mass marketing blasts, and in the US high-volume business texting belongs on registered 10DLC or toll-free numbers.
|
|
148
|
+
|
|
149
|
+
## More from Tekservix
|
|
150
|
+
|
|
151
|
+
- [WAservix WhatsApp API Gateway](https://tekservix.com/waservix/): send WhatsApp messages from your own number (`pip install waservix`)
|
|
152
|
+
- [AI Sales Agent](https://tekservix.com/ai-sales-agent): answers customers on WhatsApp and SMS using your website's content
|
|
153
|
+
- [Website to App](https://tekservix.com/mobile-apps): turn your website into Android and iOS apps
|
|
154
|
+
- Also on npm: `npm install smsgora`
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|