Giter VIP home page Giter VIP logo

serverless-python-starter's Introduction

Serverless Python Starter

A Python starter project for Serverless Framework with support for dependencies (using virtualenv & serverless-python-requirements) and tests (using unittest).

Demo

A demo version of this service is hosted on AWS - https://udshnoxw3k.execute-api.us-east-1.amazonaws.com/dev

Requirements

Installation

Create a new project

$ serverless install --url https://github.com/AnomalyInnovations/serverless-python-starter --name my-project

Create a virtual environment for your project

$ cd my-project
$ virtualenv -p /usr/bin/python3.6 venv

Activate the virtual environment

$ source venv/bin/activate

Install Serverless plugin: serverless-python-requirements

$ npm install

Usage

Install a Python dependency (for example, Requests)

$ pip install requests

Store a reference to your dependencies

$ pip freeze > requirements.txt

Re-install your dependencies from your requirements

$ pip install -r requirements.txt

Invoke a function locally

$ serverless invoke local -f hello

Run your tests

$ python -m unittest discover -s tests

Deactivate your virtual environment

$ deactivate

Deploying

Deploy your project

$ serverless deploy

Deploy a single function

$ serverless deploy function --function hello

To compile non-pure Python modules, install Docker and the Lambda Docker Image. Enable dockerizePip in serverless.yml and serverless deploy again.

# enable dockerize Pip
custom:
  pythonRequirements:
    dockerizePip: true

Note, if you are deploying using SEED, you don't need to enable dockerizePip or install Docker. SEED does it automatically.

Support

  • Send us an email if you have any questions
  • Open a new issue if you've found a bug or have some suggestions.
  • Or submit a pull request!

Maintainers

Maintained by Frank Wang (@fanjiewang) & Jay V (@jayair). Subscribe to our newsletter for updates. Send us an email if you have any questions.

serverless-python-starter's People

Contributors

jayair avatar seed-run-1 avatar fwang avatar

Watchers

James Cloos avatar Sebastian Pereyro avatar Sebastian Pereyro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.