fastapi-whatsapp-api 1.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.
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-whatsapp-api
3
+ Version: 1.0.0
4
+ Summary: FastAPI WhatsApp integration via Official Meta API.
5
+ Home-page: https://5minutesapi.com
6
+ Author: 5MinutesAPI
7
+ Requires-Python: >=3.6
8
+ Description-Content-Type: text/markdown
9
+ Dynamic: author
10
+ Dynamic: description
11
+ Dynamic: description-content-type
12
+ Dynamic: home-page
13
+ Dynamic: requires-python
14
+ Dynamic: summary
15
+
16
+ # FastAPI WhatsApp Integration - 5MinutesAPI ⚡
17
+ Send instant WhatsApp alerts and OTPs from your FastAPI microservices using the Official Meta API. Zero Markup!
18
+
19
+ ## 🛑 Important: API Key Needed
20
+ Generate your API Key at [5minutesapi.com](https://5minutesapi.com).
21
+
22
+ ## Usage
23
+ ```python
24
+ from fastapi_whatsapp import FastAPIWhatsApp
25
+ whatsapp = FastAPIWhatsApp("5m_live_YOUR_KEY")
26
+ whatsapp.send_alert("923001234567", "system_alert", ["Server Down!"])
@@ -0,0 +1,11 @@
1
+ # FastAPI WhatsApp Integration - 5MinutesAPI ⚡
2
+ Send instant WhatsApp alerts and OTPs from your FastAPI microservices using the Official Meta API. Zero Markup!
3
+
4
+ ## 🛑 Important: API Key Needed
5
+ Generate your API Key at [5minutesapi.com](https://5minutesapi.com).
6
+
7
+ ## Usage
8
+ ```python
9
+ from fastapi_whatsapp import FastAPIWhatsApp
10
+ whatsapp = FastAPIWhatsApp("5m_live_YOUR_KEY")
11
+ whatsapp.send_alert("923001234567", "system_alert", ["Server Down!"])
@@ -0,0 +1,24 @@
1
+ import json
2
+ import urllib.request
3
+ import urllib.error
4
+
5
+ class FastAPIWhatsApp:
6
+ def __init__(self, api_key: str):
7
+ if not api_key:
8
+ raise ValueError("🛑 [5MinutesAPI]: API Key required! Register at https://5minutesapi.com")
9
+ self.api_key = api_key
10
+ self.base_url = "https://api.5minutesapi.com/v1/send-message"
11
+
12
+ def send_alert(self, to: str, template: str, variables: list = []):
13
+ clean_phone = ''.join(filter(str.isdigit, str(to)))
14
+ payload = {"to": clean_phone, "whatsapp_template": template, "variables": variables}
15
+
16
+ req = urllib.request.Request(self.base_url, data=json.dumps(payload).encode('utf-8'))
17
+ req.add_header('Authorization', f'Bearer {self.api_key}')
18
+ req.add_header('Content-Type', 'application/json')
19
+
20
+ try:
21
+ with urllib.request.urlopen(req) as res:
22
+ return json.loads(res.read().decode('utf-8'))
23
+ except urllib.error.HTTPError as e:
24
+ raise Exception(f"5MinutesAPI Error: {e.read().decode('utf-8')}")
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-whatsapp-api
3
+ Version: 1.0.0
4
+ Summary: FastAPI WhatsApp integration via Official Meta API.
5
+ Home-page: https://5minutesapi.com
6
+ Author: 5MinutesAPI
7
+ Requires-Python: >=3.6
8
+ Description-Content-Type: text/markdown
9
+ Dynamic: author
10
+ Dynamic: description
11
+ Dynamic: description-content-type
12
+ Dynamic: home-page
13
+ Dynamic: requires-python
14
+ Dynamic: summary
15
+
16
+ # FastAPI WhatsApp Integration - 5MinutesAPI ⚡
17
+ Send instant WhatsApp alerts and OTPs from your FastAPI microservices using the Official Meta API. Zero Markup!
18
+
19
+ ## 🛑 Important: API Key Needed
20
+ Generate your API Key at [5minutesapi.com](https://5minutesapi.com).
21
+
22
+ ## Usage
23
+ ```python
24
+ from fastapi_whatsapp import FastAPIWhatsApp
25
+ whatsapp = FastAPIWhatsApp("5m_live_YOUR_KEY")
26
+ whatsapp.send_alert("923001234567", "system_alert", ["Server Down!"])
@@ -0,0 +1,7 @@
1
+ README.md
2
+ setup.py
3
+ fastapi_whatsapp/__init__.py
4
+ fastapi_whatsapp_api.egg-info/PKG-INFO
5
+ fastapi_whatsapp_api.egg-info/SOURCES.txt
6
+ fastapi_whatsapp_api.egg-info/dependency_links.txt
7
+ fastapi_whatsapp_api.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,16 @@
1
+
2
+ from setuptools import setup, find_packages
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name="fastapi-whatsapp-api",
8
+ version="1.0.0",
9
+ author="5MinutesAPI",
10
+ description="FastAPI WhatsApp integration via Official Meta API.",
11
+ long_description=long_description,
12
+ long_description_content_type="text/markdown",
13
+ url="https://5minutesapi.com",
14
+ packages=find_packages(),
15
+ python_requires='>=3.6',
16
+ )