Skip to main content

A Python module to parse Shopify webhook requests, tailored for Azure Functions.

Project description

Shopify Webhook Parser for Azure Functions

This Python module provides functionality to parse Shopify webhook requests within Azure Functions. It is designed to handle the intricacies of Shopify's webhook data format, making it easier to extract and verify critical information from these requests.

Features

  • Customizable parsing strategies to handle Shopify webhook requests.
  • Extracts essential data such as the online store name, request body, headers, and HMAC SHA256 signature.
  • Robust error handling and logging for efficient debugging.

Installation

This module is designed to be part of a larger Azure Functions application. Include it in your Azure Function project's source directory.

Usage

To use this module in an Azure Function, import and call the parse_shopify_webhook_request function with the appropriate parsing strategy.

Example

import azure.functions as func
from shopify_webhook_parser import parse_shopify_webhook_request, azure_func_request_parse_strategy

def main(req: func.HttpRequest) -> func.HttpResponse:
    try:
        onlinestore_name, data_bytes, headers, hmac_sha256 = parse_shopify_webhook_request(
            req, azure_func_request_parse_strategy
        )
        # Further processing of the parsed data
        return func.HttpResponse(f"Processed webhook for store: {onlinestore_name}", status_code=200)
    except ValueError as e:
        return func.HttpResponse(f"Error: {e}", status_code=400)

Development and Contributions

Feel free to contribute to the improvement of this module by submitting pull requests or reporting issues.

Logging

The module uses Python's built-in logging to provide insights into its operations and error conditions.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shopifywebhookparser-0.1.5.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shopifywebhookparser-0.1.5-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file shopifywebhookparser-0.1.5.tar.gz.

File metadata

  • Download URL: shopifywebhookparser-0.1.5.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for shopifywebhookparser-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d91c931de03f6409fd972d45326965ba582149c9ad5a62fc77b812fe596f34b4
MD5 f9b6593201b24417f1b84aa50300be97
BLAKE2b-256 9dc39a442dfc8a7e02c664aa0a9f0ae00df42f27170bf7c69652f0eb25872da1

See more details on using hashes here.

File details

Details for the file shopifywebhookparser-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for shopifywebhookparser-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 48e1dcedbd2bccebb74e771e3fbdd53ca6152e3f9733b5f2f862fa41a4f8b50d
MD5 05f680541a39f27f07f277a44764ae5b
BLAKE2b-256 89041ba0c29eb40482cef7fa4ae681a548b42dd9c8061fffd9dd3aef6dfc27bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page