# serverless-pydeps

> Serverless Python Dependencies Plugin

Latest version **0.1.0** (published 2022-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install serverless-pydeps
pnpm add serverless-pydeps
yarn add serverless-pydeps
bun add serverless-pydeps
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-10-15 |
| First published | 2020-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 0 |
| Unpacked size | 18.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | CloudSnorkel |
| Maintainers | cloudsnorkel |
| Keywords | serverless, python, requirements, pip, pipenv, serverless framework plugin, serverless applications, serverless plugins, lambda, aws, aws lambda, amazon, amazon web services, serverless.com |

## Links

- npm: https://www.npmjs.com/package/serverless-pydeps
- Repository: https://github.com/CloudSnorkel/serverless-pydeps
- Homepage: https://github.com/CloudSnorkel/serverless-pydeps#readme
- Issues: https://github.com/CloudSnorkel/serverless-pydeps/issues
- npm.io page: https://npm.io/package/serverless-pydeps

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2022-10-15
- 0.0.2 — 2020-10-01
- 0.0.1 — 2020-09-07

## README

# Serverless Python Dependencies

[![serverless](assets/serverless.svg?raw=true)](https://www.serverless.com)
[![Github Actions](https://github.com/CloudSnorkel/serverless-pydeps/workflows/Build%20and%20Publish/badge.svg)](https://github.com/CloudSnorkel/serverless-pydeps/actions)
[![npm](https://img.shields.io/npm/v/serverless-pydeps.svg)](https://www.npmjs.com/package/serverless-pydeps)

[Serverless Framework](https://www.serverless.com/) plugin to automatically add Python dependencies as layers to your functions. 

Based on [Lovage](https://github.com/CloudSnorkel/lovage) - a Python-only serverless library that's more RPC-like and
less HTTP service oriented.

## Install

```shell
sls plugin install -n serverless-pydeps
```

This will automatically add the plugin to your project's `package.json` and the plugins section of its
`serverless.yml`. That's all you need. There is no need to install or configure anything else, not even Python.

The plugin will automatically create a layer from the dependencies listed in `Pipfile` or `requirements.txt` and attach
it to all functions with Python runtime when you run `sls deploy`.

## How Does It Work?

Dependencies are collected and packaged in a special Lambda function. This means you won't have to wait on dependencies
to download to your local computer, get zipped up, and uploaded back to S3. This makes deployment, and especially
updates, really fast. Dependencies will only be built and uploaded when they change. Your code packages will contain
your code and nothing else.

Dependencies will be installed by the same system that runs them, so you never have to worry about running the right
Python version on the right OS.

## Known Limitations

* Only AWS is supported since we use Lambda Layers
* [serverless-prune-plugin](https://github.com/claygregory/serverless-prune-plugin) will not clean-up old layers 

## Other Options

|   | serverless-pydeps | [serverless-python-requirements](https://github.com/UnitedIncome/serverless-python-requirements/) |
| ------------- | ------------- | ------------- |
| **Setup** | Install plugin | Install plugin, Python, and potentially Docker for consistent requirements |
| **Package speed** | Fast as dependencies are not packaged locally | Slow as every code change repackages all dependencies |
| **Upload Speed** | Never uploads anything locally | Uploads all dependencies on every code change |
| **Supported providers** | AWS | All providers supported by Serverless (AWS, GCP, Azure, etc.) |
| **Private repositories** | Not supported as dependencies are downloaded in a Lambda function | Supported |
| **Native code dependencies (`*.so` files)** | Only supported if dependency has proper binary wheel | Supported with custom `Dockerfile`, `dockerExtraFiles`, etc. |
| **Local disk usage** | Zero | All dependencies are cached and also stored in `.serverless` |

---
_Source: https://npm.io/package/serverless-pydeps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
