{"id":15009472,"url":"https://github.com/pedrohdz/py-lambda-packer","last_synced_at":"2025-04-09T17:25:00.569Z","repository":{"id":62581283,"uuid":"92590048","full_name":"pedrohdz/py-lambda-packer","owner":"pedrohdz","description":"Tool for generating Python AWS Lambda zip files","archived":false,"fork":false,"pushed_at":"2019-07-08T17:43:41.000Z","size":50,"stargazers_count":10,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T12:22:56.438Z","etag":null,"topics":["aws-lambda","python-2-7","python-3-6"],"latest_commit_sha":null,"homepage":"","language":"Python","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/pedrohdz.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2017-05-27T09:57:17.000Z","updated_at":"2024-07-02T13:25:08.000Z","dependencies_parsed_at":"2022-11-03T21:31:37.444Z","dependency_job_id":null,"html_url":"https://github.com/pedrohdz/py-lambda-packer","commit_stats":null,"previous_names":["digitalrounin/py-lambda-packer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohdz%2Fpy-lambda-packer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohdz%2Fpy-lambda-packer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohdz%2Fpy-lambda-packer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohdz%2Fpy-lambda-packer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrohdz","download_url":"https://codeload.github.com/pedrohdz/py-lambda-packer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248075757,"owners_count":21043645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","python-2-7","python-3-6"],"created_at":"2024-09-24T19:25:28.683Z","updated_at":"2025-04-09T17:25:00.547Z","avatar_url":"https://github.com/pedrohdz.png","language":"Python","readme":"|Code Climate| |Build Status| |codecov| |PyPI version|\n\n================\npy-lambda-packer\n================\n\nA Python AWS Lambda packager. This projects is very loosely based on the\nwork in\n`serverless-wsgi \u003chttps://github.com/logandk/serverless-wsgi\u003e`__.\n\n**NOTICE**: *This project is a work in progress and should be considered\nunstable.*\n\nFeatures:\n\n-  Written to run under both *Python 3.6* and *2.7*.\n-  Generates *Python 3.6* and *2.7* *AWS Lambda Deployment Packages*,\n   user configurable.\n-  *AWS Lambda Deployment Packages* are generated in isolated, temporary\n   *virtualenvs*.\n-  Per project configuration files to cut down on typing.\n-  Can be easily be included and integrated into other projects as a\n   library.\n\n-----\nUsage\n-----\n\nInstallation\n~~~~~~~~~~~~\n\nLatest stable\n^^^^^^^^^^^^^\n\n::\n\n    $ pip install py-lambda-packer\n\nBleeding edge\n^^^^^^^^^^^^^\n\nTo install directly the bleeding edge version from *GitHub*:\n\n::\n\n    $ pip install git+https://github.com/pedrohdz/py-lambda-packer.git@master#egg=py-lambda-packer\n\nTo install a specific tag or branch, replace ``master`` in the URL of\nthe previous command with the desired name.\n\nQuick start\n~~~~~~~~~~~\n\nQuick example command to generate ``py-lambda-package.zip`` for upload\nto *AWS* as a *Lambda Function*\n\n::\n\n    $ py-lambda-packer --requirement requirements.txt --package . \\\n        --python python3.6 --include LICENSE\n\nCommand help\n~~~~~~~~~~~~\n\nCommand help information:\n\n::\n\n    $ py-lambda-packer --help\n\n    usage: py-lambda-packer [-h] [--config-file CONFIG_FILE] [--include INCLUDES]\n                            [--exclude EXCLUDES] [--followlinks]\n                            [--virtualenv-dir VIRTUALENV_DIR] [--keep-virtualenv]\n                            [--python PYTHON] [--requirement REQUIREMENTS]\n                            [--package PACKAGES] [--output OUTPUT]\n                            [--archive-dir ARCHIVE_DIR] [--keep-archive]\n                            [--generate-config]\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --config-file CONFIG_FILE\n                            location of configuration file (default: ./py-lambda-\n                            packer.yaml)\n      --include INCLUDES    glob pattern of what to include, multiple allowed\n                            (default is empty)\n      --exclude EXCLUDES    glob pattern of what to exclude, multiple allowed\n                            (default is empty)\n      --followlinks         follows symbolic links (default=False)\n      --virtualenv-dir VIRTUALENV_DIR\n                            directory to build the virtualenv in (default is a tmp\n                            dir)\n      --keep-virtualenv     do not delete virtualenv build directory when set\n                            (default=False)\n      --python PYTHON       version of python to build virtualenv with (default is\n                            python2.7)\n      --requirement REQUIREMENTS, -r REQUIREMENTS\n                            pip requirements file to read, multiple allowed\n                            (default is empty)\n      --package PACKAGES, -p PACKAGES\n                            pip package index options, multiple allowed (default\n                            is empty)\n      --output OUTPUT, -o OUTPUT\n                            name of output zip file (default is py-lambda-\n                            packer.zip)\n      --archive-dir ARCHIVE_DIR\n                            directory to build the archive in (default is a tmp\n                            dir)\n      --keep-archive        do not delete archive build directory when set\n                            (default=False)\n      --generate-config     prints thedefault configuration to help create one\n\nProject configuration\n~~~~~~~~~~~~~~~~~~~~~\n\nProject configuration file are named ``py-lambda-packer.yaml`` in the\nbase directory of your project. Here is an example:\n\n::\n\n    virtualenv:\n      python: python2.7\n      pip:\n        requirements:\n          - requirements.txt\n        packages:\n          - .\n          - Flask\n\n    packager:\n      target: py-lambda-package.zip\n      followlinks: true\n      includes:\n        - LICENSE\n        - static/**\n        - templates/**/*.html\n      excludes:\n        - static/**/*.tmp\n\nTo generate a configuration file, try the\n``py-lambda-packer --generate-config`` command.\n\n---------\nTodo list\n---------\n\n-  Bump up code coverage limit back up to 80% and fix failing source\n   files.\n-  Add comments to configuration file created by\n   ``py-lambda-packer   --generate-config``.\n-  Document the *py-lambda-packer* API so that it can be imported as a\n   library into other projects.\n-  Make the ``colorlog`` Python package optional to allow\n   *py-lambda-packer* to be imported into other projects as a library\n   more cleanly.\n-  Plugin support.\n-  Support building packages with C and C++ Python extensions. Thinking\n   out loud... Spin up an EC2 instance on the fly via something\n   like `HashiCorp Packer \u003chttps://www.packer.io/\u003e`__, build, package,\n   destroy instance.\n-  Clean up *Windows* compatibility. (I do not have access to a\n   *Windows* based system, so any contributions here would be greatly\n   appreciated.)\n-  Support packaging for other Function as a Service (FaaS) platforms\n   provided by : *Azure*, *Google Cloud*, etc.\n\n----------\nReferences\n----------\n\nFor more information\n~~~~~~~~~~~~~~~~~~~~\n\n-  `AWS Documentation - Creating a Deployment Package\n   (Python) \u003chttp://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html\u003e`__\n-  `Stackoverflow\n   answer \u003chttps://stackoverflow.com/a/38877273/2721824\u003e`__ - The\n   question pertains to AWS lambda function for Alexa, but the answer is\n   generally relevant to packaging Python AWS Lambdas.\n\nRelated projects\n~~~~~~~~~~~~~~~~\n\nIf you are working with the `Serverless\nFramework \u003chttps://serverless.com/\u003e`__ the following plugins might be of\ninterest to you:\n\n-  `serverless-wsgi \u003chttps://github.com/logandk/serverless-wsgi\u003e`__ -\n   \"Serverless plugin to deploy WSGI applications (Flask/Django/Pyramid\n   etc.) and bundle Python packages\". This *py-lambda-packer* is loosely\n   based on this project. Many thanks to the contributors of that\n   project.\n-  `serverless-python-requirements \u003chttps://github.com/UnitedIncome/serverless-python-requirements\u003e`__\n   - \"Serverless plugin to bundle Python packages\".\n\nFor a full list of *Serverless Framework* plugins, refer to\n`serverless/plugins \u003chttps://github.com/serverless/plugins\u003e`__.\n\nOther frameworks that are worth investigating are:\n\n-  `AWS Labs Chalice \u003chttps://github.com/awslabs/chalice\u003e`__ - \"Python\n   Serverless Microframework for AWS\".\n-  `Zappa \u003chttps://github.com/Miserlou/Zappa\u003e`__ - \"Serverless Python\n   Web Services\".\n\nPlease keep in mind that this list is not intended to be extensive. It\nis only here to help folks branch out their investigations.\n\n.. |Code Climate| image:: https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg\n   :target: https://codeclimate.com/github/pedrohdz/py-lambda-packer\n.. |Build Status| image:: https://travis-ci.org/pedrohdz/py-lambda-packer.svg?branch=master\n   :target: https://travis-ci.org/pedrohdz/py-lambda-packer\n.. |codecov| image:: https://codecov.io/gh/pedrohdz/py-lambda-packer/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/pedrohdz/py-lambda-packer\n.. |PyPI version| image:: https://badge.fury.io/py/py-lambda-packer.svg\n   :target: https://badge.fury.io/py/py-lambda-packer\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrohdz%2Fpy-lambda-packer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrohdz%2Fpy-lambda-packer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrohdz%2Fpy-lambda-packer/lists"}