{"id":51186148,"url":"https://github.com/jkhaui/serverless-python-boilerplate","last_synced_at":"2026-06-27T10:02:50.600Z","repository":{"id":49725657,"uuid":"209023237","full_name":"jkhaui/serverless-python-boilerplate","owner":"jkhaui","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-09T22:27:24.000Z","size":11095,"stargazers_count":3,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-15T16:07:54.794Z","etag":null,"topics":["boilerplate","lambda","layers","machine-learning","python","python3","serverless","serverless-framework","spacy"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkhaui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-17T10:18:24.000Z","updated_at":"2024-01-12T19:26:41.000Z","dependencies_parsed_at":"2023-02-08T15:01:44.323Z","dependency_job_id":null,"html_url":"https://github.com/jkhaui/serverless-python-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/jkhaui/serverless-python-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkhaui%2Fserverless-python-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkhaui%2Fserverless-python-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkhaui%2Fserverless-python-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkhaui%2Fserverless-python-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkhaui","download_url":"https://codeload.github.com/jkhaui/serverless-python-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkhaui%2Fserverless-python-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34848932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","lambda","layers","machine-learning","python","python3","serverless","serverless-framework","spacy"],"created_at":"2026-06-27T10:02:50.023Z","updated_at":"2026-06-27T10:02:50.544Z","avatar_url":"https://github.com/jkhaui.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Python Serverless Boilerplate**\n\u003cimg src=\"https://misc-ddocs.s3-ap-southeast-2.amazonaws.com/py-lambda.png\" /\u003e\n\nRecently, I've found myself building a backend entirely out of serverless\nfunctions. Using the Serverless framework to bootstrap my workflow, I found \nthis starter kit by Postlight which provides quick and simple scaffolding: \nhttps://github.com/postlight/serverless-babel-starter\n\nNow I'm switching from Node.js to Python which has its own challenges, such as \nlarge dependencies for data science or machine learning. This boilerplate uses the \nspaCy NLP library to demonstrate how **Lambda layers** can be leveraged to improve \nthe development process.\n\nAfter setting up the repo, send a GET or POST request to the endpoint with the key \n'text' and the value as any body of text, e.g. 'Manchester United have been linked \nwith Harry Kane over the years amid the England international's stunning form at \nTottenham'. The function will extract the names of any people it detects (such as \n'Harry Kane' in the example provided) and return the result in JSON. 🚀\n\n**Instructions**\n\nEnsure that you have Node.js, NPM, and the Serverless Framework installed. \nAlso ensure that your **AWS credentials are configured**. If in doubt, follow \nthese steps: https://serverless.com/framework/docs/providers/aws/guide/quick-start/\n\n\u003e git clone https://github.com/jkhaui/serverless-python-boilerplate\n\n\u003e cd serverless-python-boilerplate\n\n\u003e npm install\n\nThen, to run and test locally at http://localhost:4000\n\u003e serverless offline\n\nTo deploy the entire function as part of a CloudFormation stack:\n\u003e serverless deploy\n\nTry this sample GET request: \nlocalhost:4000?text=Manchester%20United%20have%20been%20linked%20with%20Harry%20Kane%20over%20the%20years%20amid%20the%20England%20international%27s%20stunning%20form%20at%20Tottenham\n\nEnjoy!\n\n**Other Notes**\n- To demonstrate how layers can be used to offload large dependencies when deploying, \nthis example uses the spaCy library and its en_core_web_sm-2.1.0 model.\n- Be aware that layers still count towards the 50mb zipped deployment limit; the size \nof the function including the layers is ~40mb).\n- The Lambda function is given access to CloudWatch in its IAM role statements. This \nlets it write to CloudWatch logs for easier debugging. Serverless claims that all \nfunctions have access to CloudWatch logs by default, but for some reason, I didn't observe \nthis.\n- It also uses the serverless-plugin-warmup to overcome the cold start problem. After \ndeployment, the function is automatically invoked once every 5 minutes to reduce any \nnoticable latency for the end-user.\n- Be wary using Pip on non-Linux systems for packages that contain compiled binary. \nSee https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-package-compatible/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkhaui%2Fserverless-python-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkhaui%2Fserverless-python-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkhaui%2Fserverless-python-boilerplate/lists"}