{"id":43798913,"url":"https://github.com/cfchou/serverless-python-individually","last_synced_at":"2026-02-05T21:30:53.263Z","repository":{"id":49564446,"uuid":"75386294","full_name":"cfchou/serverless-python-individually","owner":"cfchou","description":"A serverless framework plugin to install multiple lambda functions written in python.","archived":false,"fork":false,"pushed_at":"2024-03-29T16:39:05.000Z","size":49,"stargazers_count":25,"open_issues_count":7,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-01T00:30:34.623Z","etag":null,"topics":["aws-lambda","serverless","serverless-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfchou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-02T10:35:25.000Z","updated_at":"2019-11-11T18:49:26.000Z","dependencies_parsed_at":"2023-01-23T11:46:02.172Z","dependency_job_id":"4f04407f-cf59-4575-9484-363f64845618","html_url":"https://github.com/cfchou/serverless-python-individually","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cfchou/serverless-python-individually","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfchou%2Fserverless-python-individually","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfchou%2Fserverless-python-individually/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfchou%2Fserverless-python-individually/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfchou%2Fserverless-python-individually/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfchou","download_url":"https://codeload.github.com/cfchou/serverless-python-individually/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfchou%2Fserverless-python-individually/sbom","scorecard":{"id":271851,"data":{"date":"2025-08-11","repo":{"name":"github.com/cfchou/serverless-python-individually","commit":"5c8092ec38e520b37d1194701e5d30bd1bb4f2da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 9/23 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T13:35:57.217Z","repository_id":49564446,"created_at":"2025-08-17T13:35:57.217Z","updated_at":"2025-08-17T13:35:57.217Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29135047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T20:50:26.975Z","status":"ssl_error","status_checked_at":"2026-02-05T20:49:26.082Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws-lambda","serverless","serverless-plugin"],"created_at":"2026-02-05T21:30:53.155Z","updated_at":"2026-02-05T21:30:53.245Z","avatar_url":"https://github.com/cfchou.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-python-individually\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n\n- [What's it?](#whats-it)\n- [What's new?](#whats-new)\n- [Why do I need it?](#why-do-i-need-it)\n- [How?](#how)\n- [How to install platform-dependent packages?](#how-to-install-platform-dependent-packages)\n- [Advanced configuration](#advanced-configuration)\n- [Demo](#demo)\n- [Credit](#credit)\n- [Note](#note)\n\n\n# What's it?\nIt's a simple plugin for serverless **1.3+** that makes it easier to package multiple lambda functions written in python.\n\n# What's new?\n- Since **0.1.6** python3.6  is supported.\n- Since **0.1.5** lambda functions placed under subdirectories are supported.\n\n# Why do I need it?\nSay you have multiple lambda functions and each of them has fairly different package requirements. It's not economical to pack all dependencies in one big fat zip. Instead, this plugin can help to pack lambda functions with their own dependencies if you create **requirements.txt** for every function:\n\n```\nproject\n├── hello\n│   ├── handler.py\n│   └── requirements.txt\n├── world\n│   ├── handler.py\n│   └── requirements.txt\n└── serverless.yml\n```\n\nThat way, this plugin can help to pack lambda functions with their own dependencies.\n\nMoreover, if you are on a Mac, thanks to [@docker-lambda](https://github.com/lambci/docker-lambda), it can pull packages for Linux x86_64 too. More on that please read [How to install platform-dependent packages](#how-to-install-platform-dependent-packages).\n\n# How?\nBe sure that [virtualenv](https://pypi.python.org/pypi/virtualenv/) is installed. Otherwise,\n\n`pip install virtualenv`\n\nThen,\n\n`npm install serverless-python-individually`\n\nYour original **serverless.yml** may look like:\n\n```\nfunctions:\n  helloFunc:\n    handler: hello/handler.hello\n  worldFunc:\n    handler: world/handler.world\n```\n\nThe plugin works by replacing the **real handlers**(e.g. `hello/handler.hello`) with a wrapper generated on the fly(e.g. `hello/wrap.handler`). The real handlers are instead set in **custom.pyIndividually** section.\n\nA modification to **serverless.yml** is needed:\n\n```\npackage:\n  individually: True\n  exclude:\n    # Exclude everything first.\n    - '**/*'\nfunctions:\n  helloFunc:\n    handler: hello/wrap.handler\n    package:\n      include:\n        - hello/**\n  worldFunc:\n    handler: world/wrap.handler\n    package:\n      include:\n        - world/**\ncustom:\n  pyIndividually:\n    wrap:helloFunc: hello/handler.hello     # mapping to the real handler\n    wrap:worldFunnc: world/handler.world    # mapping to the real handler\n\nplugins:\n  - serverless-python-individually\n```\n\nAfter **sls deploy**, you end up having many .zip in **.serverless/**. They are the actual artifacts that got uploaded to AWS Lambda by serverless. You can examine their content like:\n\n```\n\u003e tar tvzf .serverless/aws-python-dev-helloFunc.zip\n\nhello/handler.py\nhello/requirements.txt\nhello/wrap.py\nhello/lib/pkg_resources/...\nhello/lib/requests-2.12.3.dist-info/...\nhello/lib/requests/...\nhello/lib/...\n\n```\n\nNotice that **wrap.py** and **lib/** are created for you. All dependencies should have been pulled and installed in **lib/**.\nThis plugin also works for **sls deploy function -f**.\n\n\n# How to install platform-dependent packages\nIf you are on a Mac, there're platform-dependent dependencies like *subprocess32*, *bcrypt*, etc., cannot simply be pip installed. One way to get around is to launch a aws-lambda architecture identical EC2 or a VM to do the job. That's inconvenient to say the least. Thanks to [@docker-lambda](https://github.com/lambci/docker-lambda), we can launch a container for the same purpose at our disposal. All you need to do is:\n\n- Make sure [docker](https://docs.docker.com/engine/installation/mac/) is installed and properly set up. I.e. when running `docker version` you should see information about client and server.\n- For python2.7, `docker pull lambci/lambda:build-python2.7` to pull the image in advance.\n- For python3.6, `docker pull lambci/lambda:build-python3.6` to pull the image in advance.\n- Turn on **dockerizedPip** in **serverless.yml**:\n    ```\n    custom:\n        pyIndividually:\n            # ...\n\n            # Launches a container for installing packages.\n            # The default is False.\n            dockerizedPip: True\n    ```\n\n# Advanced configuration\nThere are a couple of configurations that can be handy for you.\n\n### severless.yml\n* **wrap.py** and **lib/** are created during packaging in the same directory where the real handler is. If you are not happy about the naming, you can change `wrapName` and `libSubDir`.\n* **wrap.py** and **lib/** by default will be deleted after packaging. They can be preserved by setting `cleanup` to False.\n\n```\ncustom:\n  pyIndividually:\n    # A ${wrapName}.py will be generated for every function.\n    # The default filename is 'wrap.py', but you can change it to avoid name clashes.\n    wrapName: wrapFoo\n\n    # pip install packages to ${libSubDir} along with ${wrapNam}.py\n    # The default dir is 'lib'.\n    # libSubDir: lib\n\n    # Cleanup ${libSubDir} and ${wrapName}.py created by the plugin.\n    # The default is True.\n    # cleanup: True\n\n    # Mapping to the real handler of every function. In the format:\n    # ${wrapName}:function_name: real_handler\n    # If there's no mapping for a function, then that function will not be touced by this plugin.\n    wrapFoo:helloFunc: hello/handler.hello\n    wrapFoo:worldFunnc: world/handler.world\n\n    # See [How to install platform-dependent package]\n    # The default is False.\n    # dockerizedPip: False\n\n```\n\n\n### Command line options\nYou can also overwrite some configurations through extra options when `sls deploy`.\n\n* `--pi-cleanup`/`--pi-no-cleanup` overwrite `cleanup` in serverless.yml.\n\n* `--pi-dockerizedPip`/`--pi-no-dockerizedPip` overwrite `dockerizedPip` in serverless.yml.\n\n* `--pi-disable` skips this plugin.\n\n* Handy but **USE WITH CAUTION**: If `--pi-no-cleanup` was specified previously and you don't want to pull dependencies again, then you can disable this plugin temporarily with `--pi-disable`. sls would pack what's left over in the directory:\n\n```\n$\u003e sls deploy --pi-no-cleanup\nNow wrap.py and lib/* are not cleaned. You can do some work. Make sure requirements.txt not being changed anyhow.\n$\u003e sls deploy --pi-disable\nThe plugin is disabled for this time. sls should then directly pack wrap.py and lib/* left last time.\n```\n\n# Demo\nA [demo](https://github.com/cfchou/serverless-python-individually-demo) is there for you to get started.\n\n\n# Credit\nThis plugin is heavily influenced by [serverless-wsgi](https://github.com/logandk/serverless-wsgi) from [@logandk](https://github.com/logandk). In fact, the [requirement installer](https://github.com/cfchou/serverless-python-individually/blob/master/requirements.py) is directly borrowed from his repo. If your lambda is a wsgi app, then must check out his work.\n\nAlso thanks to [@docker-lambda](https://github.com/lambci/docker-lambda) to provide aws lambda runtime equivalent docker image.\n\n\n# Note\nAs of this writing, I just start using serverless **1.3+**. This plugin may or may\nnot work with other 1.x versions but I haven't tried.\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfchou%2Fserverless-python-individually","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfchou%2Fserverless-python-individually","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfchou%2Fserverless-python-individually/lists"}