gs1-decoder-client 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.
- gs1_decoder_client-1.0.0/PKG-INFO +72 -0
- gs1_decoder_client-1.0.0/README.md +58 -0
- gs1_decoder_client-1.0.0/gs1_decoder_client/__init__.py +79 -0
- gs1_decoder_client-1.0.0/gs1_decoder_client.egg-info/PKG-INFO +72 -0
- gs1_decoder_client-1.0.0/gs1_decoder_client.egg-info/SOURCES.txt +7 -0
- gs1_decoder_client-1.0.0/gs1_decoder_client.egg-info/dependency_links.txt +1 -0
- gs1_decoder_client-1.0.0/gs1_decoder_client.egg-info/top_level.txt +1 -0
- gs1_decoder_client-1.0.0/pyproject.toml +22 -0
- gs1_decoder_client-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gs1-decoder-client
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official zero-dependency Python client for GS1 Barcode & Digital Link Decoder (Sunrise 2027) via RapidAPI
|
|
5
|
+
Author: RapidAPI Microservices Portfolio
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027
|
|
8
|
+
Project-URL: Documentation, https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027
|
|
9
|
+
Project-URL: Source, https://github.com/DrMkdaddy/gs1-decoder-python
|
|
10
|
+
Keywords: gs1-decoder,rapidapi,sdk,api,validation,fintech
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# GS1 Barcode & Digital Link Decoder (Sunrise 2027) — Python Client
|
|
16
|
+
|
|
17
|
+
[](https://pypi.org/project/gs1-decoder-client/)
|
|
18
|
+
[](https://opensource.org/licenses/MIT)
|
|
19
|
+
[](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
20
|
+
|
|
21
|
+
Official zero-dependency Python client for **GS1 Barcode & Digital Link Decoder (Sunrise 2027)**.
|
|
22
|
+
|
|
23
|
+
> Decode GS1 DataMatrix, GS1-128, FNC1 Barcodes and GS1 Digital Link URIs into structured JSON in sub-5ms.
|
|
24
|
+
|
|
25
|
+
> 🔑 **Get your Dedicated API Key:** [Subscribe to GS1 Barcode & Digital Link Decoder (Sunrise 2027) on RapidAPI](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🚀 Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install gs1-decoder-client
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ⚡ Quickstart
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from gs1_decoder_client import Gs1DecoderClient
|
|
41
|
+
|
|
42
|
+
# Zero config for sandbox testing, or pass your RapidAPI key for production
|
|
43
|
+
client = Gs1DecoderClient(api_key="YOUR_RAPIDAPI_KEY")
|
|
44
|
+
|
|
45
|
+
result = client.validate({
|
|
46
|
+
# Enter validation payload
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
print(result)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 📚 API Reference
|
|
55
|
+
|
|
56
|
+
### `Gs1DecoderClient(api_key=..., base_url=...)`
|
|
57
|
+
- `api_key` *(optional)*: RapidAPI Key (`x-rapidapi-key`).
|
|
58
|
+
- `base_url` *(optional)*: Direct edge worker override URL.
|
|
59
|
+
|
|
60
|
+
### `client.validate(payload)`
|
|
61
|
+
Dispatches standard validation / parse request with sub-5ms latency.
|
|
62
|
+
|
|
63
|
+
### `client.get_health()`
|
|
64
|
+
Checks edge isolate health and responsiveness.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 🔗 Links
|
|
69
|
+
- 📖 [RapidAPI Documentation & Key](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
70
|
+
|
|
71
|
+
## 📄 License
|
|
72
|
+
MIT © RapidAPI Microservices Portfolio
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# GS1 Barcode & Digital Link Decoder (Sunrise 2027) — Python Client
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/gs1-decoder-client/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
6
|
+
|
|
7
|
+
Official zero-dependency Python client for **GS1 Barcode & Digital Link Decoder (Sunrise 2027)**.
|
|
8
|
+
|
|
9
|
+
> Decode GS1 DataMatrix, GS1-128, FNC1 Barcodes and GS1 Digital Link URIs into structured JSON in sub-5ms.
|
|
10
|
+
|
|
11
|
+
> 🔑 **Get your Dedicated API Key:** [Subscribe to GS1 Barcode & Digital Link Decoder (Sunrise 2027) on RapidAPI](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🚀 Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install gs1-decoder-client
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ⚡ Quickstart
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from gs1_decoder_client import Gs1DecoderClient
|
|
27
|
+
|
|
28
|
+
# Zero config for sandbox testing, or pass your RapidAPI key for production
|
|
29
|
+
client = Gs1DecoderClient(api_key="YOUR_RAPIDAPI_KEY")
|
|
30
|
+
|
|
31
|
+
result = client.validate({
|
|
32
|
+
# Enter validation payload
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
print(result)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📚 API Reference
|
|
41
|
+
|
|
42
|
+
### `Gs1DecoderClient(api_key=..., base_url=...)`
|
|
43
|
+
- `api_key` *(optional)*: RapidAPI Key (`x-rapidapi-key`).
|
|
44
|
+
- `base_url` *(optional)*: Direct edge worker override URL.
|
|
45
|
+
|
|
46
|
+
### `client.validate(payload)`
|
|
47
|
+
Dispatches standard validation / parse request with sub-5ms latency.
|
|
48
|
+
|
|
49
|
+
### `client.get_health()`
|
|
50
|
+
Checks edge isolate health and responsiveness.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🔗 Links
|
|
55
|
+
- 📖 [RapidAPI Documentation & Key](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
56
|
+
|
|
57
|
+
## 📄 License
|
|
58
|
+
MIT © RapidAPI Microservices Portfolio
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GS1 Barcode & Digital Link Decoder (Sunrise 2027) Python Client SDK (Zero External Dependencies)
|
|
3
|
+
"""
|
|
4
|
+
import os
|
|
5
|
+
import json
|
|
6
|
+
import urllib.request
|
|
7
|
+
import urllib.error
|
|
8
|
+
from typing import Any, Dict, Optional
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Gs1DecoderClient:
|
|
12
|
+
"""
|
|
13
|
+
Client for GS1 Barcode & Digital Link Decoder (Sunrise 2027).
|
|
14
|
+
|
|
15
|
+
:param api_key: RapidAPI key ('x-rapidapi-key').
|
|
16
|
+
Get your key at: https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027
|
|
17
|
+
:param base_url: Custom API endpoint override. Defaults to https://gs1-barcode-digital-link-decoder-sunrise-2027.p.rapidapi.com.
|
|
18
|
+
:param rapidapi_host: RapidAPI host header. Defaults to gs1-barcode-digital-link-decoder-sunrise-2027.p.rapidapi.com.
|
|
19
|
+
"""
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
api_key: Optional[str] = None,
|
|
23
|
+
base_url: Optional[str] = None,
|
|
24
|
+
rapidapi_host: str = "gs1-barcode-digital-link-decoder-sunrise-2027.p.rapidapi.com"
|
|
25
|
+
):
|
|
26
|
+
self.api_key = api_key or os.environ.get("RAPIDAPI_KEY", "")
|
|
27
|
+
self.rapidapi_host = rapidapi_host
|
|
28
|
+
self.base_url = (base_url or f"https://{self.rapidapi_host}").rstrip("/")
|
|
29
|
+
|
|
30
|
+
def request(self, endpoint: str, method: str = "GET", payload: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
|
31
|
+
if not self.api_key:
|
|
32
|
+
return {
|
|
33
|
+
"success": False,
|
|
34
|
+
"error": "RapidAPI API key is required. Subscribe and obtain your key at: https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027",
|
|
35
|
+
"code": "MISSING_API_KEY",
|
|
36
|
+
"subscribe_url": "https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
url = f"{self.base_url}/{endpoint.lstrip('/')}"
|
|
40
|
+
headers = {
|
|
41
|
+
"Content-Type": "application/json",
|
|
42
|
+
"Accept": "application/json",
|
|
43
|
+
"User-Agent": "gs1-decoder-python-client/1.0",
|
|
44
|
+
"x-rapidapi-key": self.api_key,
|
|
45
|
+
"x-rapidapi-host": self.rapidapi_host
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
data = json.dumps(payload).encode("utf-8") if payload else None
|
|
49
|
+
req = urllib.request.Request(url, data=data, headers=headers, method=method)
|
|
50
|
+
|
|
51
|
+
try:
|
|
52
|
+
with urllib.request.urlopen(req, timeout=10) as response:
|
|
53
|
+
res_data = json.loads(response.read().decode("utf-8"))
|
|
54
|
+
return res_data
|
|
55
|
+
except urllib.error.HTTPError as e:
|
|
56
|
+
try:
|
|
57
|
+
return json.loads(e.read().decode("utf-8"))
|
|
58
|
+
except Exception:
|
|
59
|
+
return {
|
|
60
|
+
"success": False,
|
|
61
|
+
"error": f"HTTP {e.code}: {e.reason}",
|
|
62
|
+
"code": f"HTTP_{e.code}",
|
|
63
|
+
"upgrade_url": "https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027"
|
|
64
|
+
}
|
|
65
|
+
except Exception as e:
|
|
66
|
+
return {
|
|
67
|
+
"success": False,
|
|
68
|
+
"error": str(e),
|
|
69
|
+
"code": "NETWORK_ERROR",
|
|
70
|
+
"subscribe_url": "https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
def get_health(self) -> Dict[str, Any]:
|
|
74
|
+
"""Check API health status via RapidAPI."""
|
|
75
|
+
return self.request("/health", method="GET")
|
|
76
|
+
|
|
77
|
+
def validate(self, payload: Dict[str, Any]) -> Dict[str, Any]:
|
|
78
|
+
"""Submit validation/parse request via RapidAPI."""
|
|
79
|
+
return self.request("/api/v1/validate", method="POST", payload=payload)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gs1-decoder-client
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official zero-dependency Python client for GS1 Barcode & Digital Link Decoder (Sunrise 2027) via RapidAPI
|
|
5
|
+
Author: RapidAPI Microservices Portfolio
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027
|
|
8
|
+
Project-URL: Documentation, https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027
|
|
9
|
+
Project-URL: Source, https://github.com/DrMkdaddy/gs1-decoder-python
|
|
10
|
+
Keywords: gs1-decoder,rapidapi,sdk,api,validation,fintech
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# GS1 Barcode & Digital Link Decoder (Sunrise 2027) — Python Client
|
|
16
|
+
|
|
17
|
+
[](https://pypi.org/project/gs1-decoder-client/)
|
|
18
|
+
[](https://opensource.org/licenses/MIT)
|
|
19
|
+
[](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
20
|
+
|
|
21
|
+
Official zero-dependency Python client for **GS1 Barcode & Digital Link Decoder (Sunrise 2027)**.
|
|
22
|
+
|
|
23
|
+
> Decode GS1 DataMatrix, GS1-128, FNC1 Barcodes and GS1 Digital Link URIs into structured JSON in sub-5ms.
|
|
24
|
+
|
|
25
|
+
> 🔑 **Get your Dedicated API Key:** [Subscribe to GS1 Barcode & Digital Link Decoder (Sunrise 2027) on RapidAPI](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🚀 Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install gs1-decoder-client
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ⚡ Quickstart
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from gs1_decoder_client import Gs1DecoderClient
|
|
41
|
+
|
|
42
|
+
# Zero config for sandbox testing, or pass your RapidAPI key for production
|
|
43
|
+
client = Gs1DecoderClient(api_key="YOUR_RAPIDAPI_KEY")
|
|
44
|
+
|
|
45
|
+
result = client.validate({
|
|
46
|
+
# Enter validation payload
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
print(result)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 📚 API Reference
|
|
55
|
+
|
|
56
|
+
### `Gs1DecoderClient(api_key=..., base_url=...)`
|
|
57
|
+
- `api_key` *(optional)*: RapidAPI Key (`x-rapidapi-key`).
|
|
58
|
+
- `base_url` *(optional)*: Direct edge worker override URL.
|
|
59
|
+
|
|
60
|
+
### `client.validate(payload)`
|
|
61
|
+
Dispatches standard validation / parse request with sub-5ms latency.
|
|
62
|
+
|
|
63
|
+
### `client.get_health()`
|
|
64
|
+
Checks edge isolate health and responsiveness.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 🔗 Links
|
|
69
|
+
- 📖 [RapidAPI Documentation & Key](https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027)
|
|
70
|
+
|
|
71
|
+
## 📄 License
|
|
72
|
+
MIT © RapidAPI Microservices Portfolio
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gs1_decoder_client
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "gs1-decoder-client"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Official zero-dependency Python client for GS1 Barcode & Digital Link Decoder (Sunrise 2027) via RapidAPI"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [{ name = "RapidAPI Microservices Portfolio" }]
|
|
11
|
+
license = "MIT"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
]
|
|
16
|
+
keywords = ["gs1-decoder", "rapidapi", "sdk", "api", "validation", "fintech"]
|
|
17
|
+
dependencies = []
|
|
18
|
+
|
|
19
|
+
[project.urls]
|
|
20
|
+
"Homepage" = "https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027"
|
|
21
|
+
"Documentation" = "https://rapidapi.com/noor-mkdad-apis-noor-mkdad-apis-default/api/gs1-barcode-digital-link-decoder-sunrise-2027"
|
|
22
|
+
"Source" = "https://github.com/DrMkdaddy/gs1-decoder-python"
|