Skip to main content

API Gateway & DynamoDB Utility Library

Overview

This library provides utility functions to interact with AWS API Gateway and DynamoDB. It enables secure API communication for fetching and upserting data via API Gateway, ensuring robust error handling, logging, and authentication using an API Key.

Features

  • ✅ Fetch Data from DynamoDB via API Gateway
  • ✅ Upsert Data (Insert/Update) into DynamoDB
  • ✅ Secure API Access using API Key
  • ✅ Robust Logging & Error Handling
  • ✅ Optimized JSON Response Handling
  • ✅ Support for Private Repository Deployment

Installation

Prerequisites

Ensure you have Python 3.8+ installed.

Install the required dependencies:

pip install requests
pip install api_gateway_dynamodb 

Usage - Read Data

 from api_gateway_dynamodb import get_data_from_api_gateway_dynamodb

# API Gateway Endpoint URL
api_url = "https://your-api-gateway-url.com/get-data"

# Example Parameters
database_table_name = "customer"
partition_key = "customer_id"
partition_key_value = "123456"
api_key = "your-api-key-here"

# Fetch data
response = get_data_from_api_gateway_dynamodb(api_url, 
                                              database_table_name, 
                                              partition_key, 
                                              partition_key_value, 
                                              api_key)

print(response)  # Output: JSON response with data from DynamoDB

Usage - Insert / Update data

from api_gateway_dynamodb import upsert_data_via_api_gateway_dynamodb

# API Gateway Endpoint URL
api_url = "https://your-api-gateway-url.com/upsert-data"

# Example Data Payload
payload = {
    "id_number": "123456",
    "name": "John",
    "surname": "Doe",
    "title": "Mr"
}

# Upsert Parameters
method_name = "insert"
table_name = "customer"
partition_key = "id_number"
api_key = "your-api-key-here"

# Insert or Update Data
response = upsert_data_via_api_gateway_dynamodb(payload, method_name, table_name, partition_key, api_key, api_url)

print(response)  # Output: JSON response confirming the operation

Metadata

Release files for api-gateway-dynamodb 0.1.2

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

Source distribution (sdist)

Source distribution for api-gateway-dynamodb 0.1.2
File Size Uploaded Provenance
api_gateway_dynamodb-0.1.2.tar.gz 3.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for api-gateway-dynamodb 0.1.2
File Interpreter ABI Platform
api_gateway_dynamodb-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / api_gateway_dynamodb-0.1.2.tar.gz

Download URL api_gateway_dynamodb-0.1.2.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4a46473d6b430ebf288fe45612e13eeb068511d9d0972ad084d936c2381341b7
BLAKE2b-256 checksum
How to use checksums
eca0b3f5a51bbb00f9509c79f3083091fd5a3382e7b906b96f7b5d8c8837578e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / api_gateway_dynamodb-0.1.2-py3-none-any.whl

Download URL api_gateway_dynamodb-0.1.2-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3ae28cedb1e9e425585c3d7796e4e45d0cd7e31833894911f21f253a3ebd07a
BLAKE2b-256 checksum
How to use checksums
4aaf3e5f6edfef20596ca7448267841ea97e070744a73f7230c3f3773730cc83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for api-gateway-dynamodb 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

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