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.
@@ -1,156 +1,158 @@
1
- Metadata-Version: 2.4
2
- Name: smsgora
3
- Version: 1.0.0
4
- Summary: Official Python client for the SMS Gora SMS Gateway: 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/ellyj164/smsgora-python
10
- Project-URL: Issues, https://github.com/ellyj164/smsgora-python/issues
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 for the [SMS Gora SMS Gateway](https://tekservix.com/smsgora/) API.
25
-
26
- 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.
27
-
28
- - Zero dependencies (standard library only), Python 3.8+
29
- - Works in Django, Flask, FastAPI, scripts and cron jobs
30
- - Webhook signature check built in
31
-
32
- ## Install
33
-
34
- ```bash
35
- pip install smsgora
36
- ```
37
-
38
- ## Quick start
39
-
40
- Create an API key in the SMS Gora dashboard (SMS Gora -> API keys) and keep it on your server.
41
-
42
- ```python
43
- import os
44
- from smsgora import SmsGora
45
-
46
- sms = SmsGora(api_key=os.environ["SMSGORA_KEY"])
47
-
48
- result = sms.send_sms(to="+15551234567", message="Your verification code is 482913")
49
- print(result["message_ids"]) # [1873]
50
- ```
51
-
52
- ## Sending
53
-
54
- ```python
55
- from datetime import datetime, timezone
56
-
57
- # Several recipients (up to 1,000 per call)
58
- sms.send_sms(to=["+15551234567", "+447700900123"], message="Your order has shipped")
59
-
60
- # From a chosen phone and SIM, scheduled for later
61
- sms.send_sms(
62
- to="+15551234567",
63
- message="Reminder: your appointment is tomorrow at 10:00",
64
- device_id=42,
65
- sim_slot=1, # 0 = SIM 1, 1 = SIM 2
66
- schedule_at=datetime(2026, 12, 1, 8, 0, tzinfo=timezone.utc),
67
- )
68
-
69
- # Different texts for different people in one call (up to 5,000 recipients)
70
- sms.send_bulk_sms(
71
- 42,
72
- message_template="Hello, your parcel is ready for pickup.",
73
- messages=[
74
- {"recipients": ["+15551234567"], "message": "Hi Aline, parcel #1042 is ready."},
75
- {"recipients": ["+15557654321"]},
76
- ],
77
- )
78
- ```
79
-
80
- ## Delivery status and incoming SMS
81
-
82
- ```python
83
- msg = sms.get_message(1873)
84
- print(msg["status"]) # queued -> dispatched -> sent -> delivered (or failed)
85
-
86
- sms.cancel_message(1874) # works while queued or scheduled
87
-
88
- inbox = sms.list_received_sms(since="2026-11-01", limit=50)
89
- phones = sms.list_devices()
90
- account = sms.get_account()
91
- ```
92
-
93
- Anything else in the [API reference](https://tekservix.com/smsgora/docs/) is one call away:
94
-
95
- ```python
96
- batch = sms.request("GET", "/batches/311")
97
- ```
98
-
99
- ## Webhooks
100
-
101
- 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:
102
-
103
- ```python
104
- import json, os
105
- from flask import Flask, request, abort
106
- from smsgora import verify_webhook
107
-
108
- app = Flask(__name__)
109
-
110
- @app.post("/sms/webhook")
111
- def sms_webhook():
112
- if not verify_webhook(request.get_data(), request.headers.get("X-SmsGora-Signature"),
113
- os.environ["SMSGORA_WEBHOOK_SECRET"]):
114
- abort(401)
115
- event = json.loads(request.get_data())
116
- if event["event"] == "sms.received":
117
- print(event["data"]["from"], event["data"]["message"])
118
- return "", 200 # answer within 10 seconds; queue slow work
119
- ```
120
-
121
- In Django use `request.body`; in FastAPI use `await request.body()`. Always pass the raw bytes, not re-encoded JSON.
122
-
123
- ## Errors
124
-
125
- Failed calls raise `SmsGoraError` with `status`, `message`, field `errors` and, on 429, `retry_after` in seconds.
126
-
127
- ```python
128
- from smsgora import SmsGoraError
129
-
130
- try:
131
- sms.send_sms(to="+15551234567", message="Hi")
132
- except SmsGoraError as err:
133
- if err.status == 429:
134
- pass # rate limit (300 requests/minute per key) or plan limit reached
135
- ```
136
-
137
- Never ship the key inside a browser or mobile app: anyone could read it. Call the API from your server.
138
-
139
- ## Migrating from TextBee
140
-
141
- 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/).
142
-
143
- ## Good to know
144
-
145
- 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.
146
-
147
- ## More from Tekservix
148
-
149
- - [WAservix WhatsApp API Gateway](https://tekservix.com/waservix/): send WhatsApp messages from your own number (`pip install waservix`)
150
- - [AI Sales Agent](https://tekservix.com/ai-sales-agent): answers customers on WhatsApp and SMS using your website's content
151
- - [Website to App](https://tekservix.com/mobile-apps): turn your website into Android and iOS apps
152
- - Also on npm: `npm install smsgora`
153
-
154
- ## License
155
-
156
- MIT
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.0"
8
- description = "Official Python client for the SMS Gora SMS Gateway: send and receive SMS through your own Android phones, with delivery reports and signed webhooks."
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/ellyj164/smsgora-python"
27
- Issues = "https://github.com/ellyj164/smsgora-python/issues"
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
+
@@ -12,7 +12,7 @@ import urllib.parse
12
12
  import urllib.request
13
13
 
14
14
  __all__ = ["SmsGora", "SmsGoraError", "verify_webhook"]
15
- __version__ = "1.0.0"
15
+ __version__ = "1.0.2"
16
16
 
17
17
  DEFAULT_BASE_URL = "https://tekservix.com/smsgora/api/v1"
18
18
 
@@ -1,156 +1,158 @@
1
- Metadata-Version: 2.4
2
- Name: smsgora
3
- Version: 1.0.0
4
- Summary: Official Python client for the SMS Gora SMS Gateway: 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/ellyj164/smsgora-python
10
- Project-URL: Issues, https://github.com/ellyj164/smsgora-python/issues
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 for the [SMS Gora SMS Gateway](https://tekservix.com/smsgora/) API.
25
-
26
- 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.
27
-
28
- - Zero dependencies (standard library only), Python 3.8+
29
- - Works in Django, Flask, FastAPI, scripts and cron jobs
30
- - Webhook signature check built in
31
-
32
- ## Install
33
-
34
- ```bash
35
- pip install smsgora
36
- ```
37
-
38
- ## Quick start
39
-
40
- Create an API key in the SMS Gora dashboard (SMS Gora -> API keys) and keep it on your server.
41
-
42
- ```python
43
- import os
44
- from smsgora import SmsGora
45
-
46
- sms = SmsGora(api_key=os.environ["SMSGORA_KEY"])
47
-
48
- result = sms.send_sms(to="+15551234567", message="Your verification code is 482913")
49
- print(result["message_ids"]) # [1873]
50
- ```
51
-
52
- ## Sending
53
-
54
- ```python
55
- from datetime import datetime, timezone
56
-
57
- # Several recipients (up to 1,000 per call)
58
- sms.send_sms(to=["+15551234567", "+447700900123"], message="Your order has shipped")
59
-
60
- # From a chosen phone and SIM, scheduled for later
61
- sms.send_sms(
62
- to="+15551234567",
63
- message="Reminder: your appointment is tomorrow at 10:00",
64
- device_id=42,
65
- sim_slot=1, # 0 = SIM 1, 1 = SIM 2
66
- schedule_at=datetime(2026, 12, 1, 8, 0, tzinfo=timezone.utc),
67
- )
68
-
69
- # Different texts for different people in one call (up to 5,000 recipients)
70
- sms.send_bulk_sms(
71
- 42,
72
- message_template="Hello, your parcel is ready for pickup.",
73
- messages=[
74
- {"recipients": ["+15551234567"], "message": "Hi Aline, parcel #1042 is ready."},
75
- {"recipients": ["+15557654321"]},
76
- ],
77
- )
78
- ```
79
-
80
- ## Delivery status and incoming SMS
81
-
82
- ```python
83
- msg = sms.get_message(1873)
84
- print(msg["status"]) # queued -> dispatched -> sent -> delivered (or failed)
85
-
86
- sms.cancel_message(1874) # works while queued or scheduled
87
-
88
- inbox = sms.list_received_sms(since="2026-11-01", limit=50)
89
- phones = sms.list_devices()
90
- account = sms.get_account()
91
- ```
92
-
93
- Anything else in the [API reference](https://tekservix.com/smsgora/docs/) is one call away:
94
-
95
- ```python
96
- batch = sms.request("GET", "/batches/311")
97
- ```
98
-
99
- ## Webhooks
100
-
101
- 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:
102
-
103
- ```python
104
- import json, os
105
- from flask import Flask, request, abort
106
- from smsgora import verify_webhook
107
-
108
- app = Flask(__name__)
109
-
110
- @app.post("/sms/webhook")
111
- def sms_webhook():
112
- if not verify_webhook(request.get_data(), request.headers.get("X-SmsGora-Signature"),
113
- os.environ["SMSGORA_WEBHOOK_SECRET"]):
114
- abort(401)
115
- event = json.loads(request.get_data())
116
- if event["event"] == "sms.received":
117
- print(event["data"]["from"], event["data"]["message"])
118
- return "", 200 # answer within 10 seconds; queue slow work
119
- ```
120
-
121
- In Django use `request.body`; in FastAPI use `await request.body()`. Always pass the raw bytes, not re-encoded JSON.
122
-
123
- ## Errors
124
-
125
- Failed calls raise `SmsGoraError` with `status`, `message`, field `errors` and, on 429, `retry_after` in seconds.
126
-
127
- ```python
128
- from smsgora import SmsGoraError
129
-
130
- try:
131
- sms.send_sms(to="+15551234567", message="Hi")
132
- except SmsGoraError as err:
133
- if err.status == 429:
134
- pass # rate limit (300 requests/minute per key) or plan limit reached
135
- ```
136
-
137
- Never ship the key inside a browser or mobile app: anyone could read it. Call the API from your server.
138
-
139
- ## Migrating from TextBee
140
-
141
- 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/).
142
-
143
- ## Good to know
144
-
145
- 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.
146
-
147
- ## More from Tekservix
148
-
149
- - [WAservix WhatsApp API Gateway](https://tekservix.com/waservix/): send WhatsApp messages from your own number (`pip install waservix`)
150
- - [AI Sales Agent](https://tekservix.com/ai-sales-agent): answers customers on WhatsApp and SMS using your website's content
151
- - [Website to App](https://tekservix.com/mobile-apps): turn your website into Android and iOS apps
152
- - Also on npm: `npm install smsgora`
153
-
154
- ## License
155
-
156
- MIT
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