call-serverless
is a Python library designed to remotely invoke AWS Lambda functions that have API Gateway integration. It simplifies the process of invoking Lambda functions with HTTP-like requests, providing easy-to-use methods to send requests and handle responses.
Call Lambda functions via their ARN using HTTP methods such as GET, POST, PUT, DELETE.
Send requests with customizable paths, headers, stages, and body payloads.
Built on top of boto3, the library manages AWS Lambda client connections and simplifies API invocation.
To install the library, use pip:
pip install call-serverless
- Python 3.6 or higher
boto3
for AWS SDK integration
Basic Lambda Invocation
from call_serverless.apis import call_lambda
response = call_lambda(
lambda_arn="arn:aws:lambda:us-west-2:123456789012:function:MyFunction",
path="/users",
method="POST",
stage="prod",
region="us-west-2",
body={"username": "new_user"},
headers={"Authorization": "Bearer token123"}
)
print(response)
# {'statusCode': 200, 'message': 'User created successfully'}
If you want to contribute to this project, please submit a pull request or open an issue on GitHub.
This project is licensed under the MIT License. See the LICENSE file for more details.