Paten

code status

https://github.com/gsy0911/paten/workflows/pytest/badge.svg codecov lgtm Documentation Status

package status

https://img.shields.io/badge/python-3.7|3.8-blue.svg https://img.shields.io/badge/pypi-0.1.3-blue.svg https://pepy.tech/badge/paten

Paten is a framework for azure functions written in Python.

Paten provides:

  • A command line tool for creating, building, deploying azure functions.
  • A decorator based API integrated with in/out bindings.

Installation

Paten can be installed from pip.

pip install paten

In addition, Azure CLI and Azure Functions Core Tools are required. See below to install the libraries.

Usage

In your project directory, type below.

$ paten new-app {function_app_name}

Directory {function_app_name} and example python scripts like below are created.

import azure.functions as func
from paten import Paten

app = Paten('{function_app_name}')


@app.http_trigger('req', methods=['GET'], route='/')
@app.out_http()
def example_http_function(req: func.HttpRequest) -> func.HttpResponse:
    name = req.params.get('name')

    # response
    return func.HttpResponse(name)

Before deploying to azure functions, you can test your functions on local with the command below.

$ paten local

Finally, to deploy to azure functions, type below in the directory {function_app_name}. The files are generated in ./{function_app_name}/.paten and your function app is deployed to azure.

$ paten deploy

The User Guid

Tutorial

To get started, it is recommended to follow the document below.

GitHub

Paten repository is here.

Indices and tables