Skip to main content

GS1 Barcode & Digital Link Decoder — Python SDK

PyPI version Python Versions License: MIT Stanza API

Decode GS1 DataMatrix, GS1-128, FNC1 barcodes, and GS1 Digital Link URIs into structured JSON in sub-5ms.

Official, zero-dependency Python 3.8+ client library for GS1 Barcode & Digital Link Decoder, built on the Stanza Micro-API Network. Intended for enterprise data pipelines, backend verification, and sub-5ms edge compute.


📦 Installation

pip install stanzaapi-gs1-decoder

🚀 Quickstart

import os
from stanzaapi_gs1_decoder import Gs1DecoderClient

# Initialize client (api_key optional for local evaluation)
client = Gs1DecoderClient(
    api_key=os.getenv("STANZA_API_KEY")
)

# Execute deterministic validation
response = client.parse("(01)00123456789012(21)12345")

if response.get("success"):
    print("Verification Success:", response["data"])
else:
    print("Validation Error:", response.get("error"), response.get("code"))

📄 Example Response

{
  "success": true,
  "data": {
    "gtin": "00123456789012",
    "serial_number": "12345",
    "ai_elements": [
      {
        "ai": "01",
        "label": "GTIN",
        "value": "00123456789012"
      },
      {
        "ai": "21",
        "label": "SERIAL",
        "value": "12345"
      }
    ]
  }
}

⚙️ Client Options

Parameter Type Default Description
api_key Optional[str] os.getenv("STANZA_API_KEY") Your Stanza API Key. Required for production quotas.
base_url Optional[str] "https://api.stanzaapi.com/gs1-decoder" Public edge API base URL.
timeout int 15 Request timeout in seconds.

📄 License

MIT © Stanza — Powered by Stanza.

Release files for stanzaapi-gs1-decoder 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stanzaapi-gs1-decoder 1.0.0
File Size Uploaded
stanzaapi_gs1_decoder-1.0.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stanzaapi-gs1-decoder 1.0.0
File Interpreter ABI Platform
stanzaapi_gs1_decoder-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / stanzaapi_gs1_decoder-1.0.0.tar.gz

Download URL stanzaapi_gs1_decoder-1.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
95002740b7d961afd94c22176e22d9d921a5d248b3de1641d4adb6ee2a4b2028
BLAKE2b-256 checksum
How to use checksums
3b228c594c7b7e43278bc3dfa3ad5bb1a3c65d6f1531611cf3c0c54a14d7c653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / stanzaapi_gs1_decoder-1.0.0-py3-none-any.whl

Download URL stanzaapi_gs1_decoder-1.0.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc0a78c0148200226f7f30e67304f72d3c154fbaa94f203fe9bec3deaff29016
BLAKE2b-256 checksum
How to use checksums
d76d62edccf5c45b81fdf0ca6a1f03a6ba2abbd279e6ccd3106d27466e4846b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page