Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gsy0911/paten
Paten is a framework for azure functions written in Python
https://github.com/gsy0911/paten
Last synced: 24 days ago
JSON representation
Paten is a framework for azure functions written in Python
- Host: GitHub
- URL: https://github.com/gsy0911/paten
- Owner: gsy0911
- Created: 2020-05-31T01:37:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-19T21:18:15.000Z (about 1 year ago)
- Last Synced: 2025-01-07T03:13:14.955Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 155 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Paten
[![pytest](https://github.com/gsy0911/paten/workflows/pytest/badge.svg)](https://github.com/gsy0911/paten/actions?query=workflow%3Apytest)
[![codecov](https://codecov.io/gh/gsy0911/paten/branch/master/graph/badge.svg)](https://codecov.io/gh/gsy0911/paten)
[![PythonVersion](https://img.shields.io/badge/python-3.7|3.8-blue.svg)](https://www.python.org/downloads/release/python-377/)
[![PiPY](https://img.shields.io/badge/pypi-0.1.3-blue.svg)](https://pypi.org/project/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.## install
install `paten` package.
```shell script
$ pip install paten
```In addition, `Azure CLI` and `Azure Functions Core Tools` are required.
See below to install the libraries.* [Azure CLI](https://docs.microsoft.com/ja-jp/cli/azure/install-azure-cli?view=azure-cli-latest)
* [Azure Functions Core Tools](https://docs.microsoft.com/ja-jp/azure/azure-functions/functions-run-local?tabs=macos%2Cpython%2Cbash)## preparation
Before deploying to Azure, `az login` is required.
```shell script
$ az loginYou have logged in. Now let us find all the subscriptions to which you have access...
```## Quickstart
In your project directory, type below.
Directory {function_app_name} and example python scripts are created.```shell script
$ paten new-app {function_app_name}
```Then, modify `app.py`, like below.
```python
import azure.functions as func
from paten import Patenapp = 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.
```shell script
$ 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.```shell script
$ paten deploy
```## support bindings
| services | trigger | in | out |
|:--:|:--:|:--:|:--:|
| http | O | - | O |
| blob | O | X | X |
| queue | O | X | 0 |
| timer | O | - | - |
* O: supported
* X: not supported yet
* -: officially not supported