Created
September 21, 2023 13:37
-
-
Save nktstudios/e0b5f62f1e730384237d248af797f3a2 to your computer and use it in GitHub Desktop.
AWS Lambda Function demonstrating packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import pandas as pd | |
import numpy as np | |
import requests | |
def lambda_handler(event, context): | |
pandas_version = pd.__version__ | |
numpy_version = np.__version__ | |
# Ping nktstudios.com and get the status code | |
response = requests.get("https://nktstudios.com/") | |
nktstudios_status = response.status_code | |
# Construct the return statement | |
return_statement = f"Pandas Version: {pandas_version}, Numpy Version: {numpy_version}, \ | |
NKT Studios Request Status: {nktstudios_status}" | |
# Set the return statement expected by AWS Lambda | |
return { | |
'statusCode': 200, | |
'body': json.dumps(return_statement) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment