Skip to content

noahgift/Python-Functions-from-Zero

Repository files navigation

Python application test with Github Actions

Python-Functions-from-Zero

this is a repo for building Python functions from Zero

Getting Started

  • Create scaffold: Makefile, requirements.txt, hello.py

  • Create a virtualenv: virtualenv ~/.python-functions-zero

  • Source it: source ~/.python-functions-zero/bin/activate

Run CLI

./cli.py --color "red"

Test project

make lint && make test

Containerize this project

You can read this sample project

Build

docker build --tag=cli-aws .

Run

docker run -it cli-aws python cli.py --color "Red"

Pull it

docker pull noahgift/cli-aws

Serverless

def lambda_handler(event, context):
    print(f"This is the event {event}")
    if event["name"] == "Marco":
        return "Polo"
    return "No!"

aws lambda invoke --function-name <MyFunction> \ --payload '{"name": "Bob" }' out.txt

Deploy to A Container as a Service

https://github.com/noahgift/cloudrun-flask

About

this is a repo for building Python functions from Zero

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published