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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file shopifywebhookparser-0.1.2.tar.gz
.
File metadata
- Download URL: shopifywebhookparser-0.1.2.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.6 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c39209803f8113184e3244cf21fd54e67c7f1f85adf16fa64b707009086c5b |
|
MD5 | c9595f4dc47d7bca9cec25a29b3451ea |
|
BLAKE2b-256 | d29dcabeed7351cc36d976b3b1203782cb18ffe5fb6813d4df414c2ab6155725 |
File details
Details for the file shopifywebhookparser-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: shopifywebhookparser-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.6 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 824c36e0f0a4a49319f46c324e2e61efe5984e4a5ed80cbd0733854b9e8a2b2a |
|
MD5 | 1182ec850d478dc561a5fb4a49e2dce6 |
|
BLAKE2b-256 | b4e884c5cb0c23cd8a521da288feb790d9597ce4d9a869a3131f9cb3612f04b3 |