Skip to main content

aligi

Aliyun Gateway Interface

为无服务函数计算作为阿里云 API 后端运行提供转析,并且允许同一个无服务函数既支持 HTTP 触发器,也支持作为 API 网关的后端服务。

为什么会有这个库?

使用 Flask,Django 等支持标准 WSGI 协议的 Web 框架创建无服务函数时,使用HTTP触发器才能让它们正常运行。

但如果想使用无服务函数作为阿里云 API 网关的后端时,则无法直接使用这些函数,只能通过网络调用,这显然是不够高效、并且费钱的。

如何安装

在项目根目录下执行

pip install -t . aligi

如何使用

以下为一个最小的 Flask 样例

from flask import Flask
from aligi import WSGI

app = Flask(__name__)


@app.route("/")
def hello_world():
    return "Hello, World!"


# 阿里云无服务函数的入口
handler = WSGI(app)

其中app可以是任意一个标准 WSGI Application。

在 Django 项目中,它一般在项目的wsgi.py里。

参考文档

阿里云文档:

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aligi-1.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aligi-1.1.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file aligi-1.1.0.tar.gz.

File metadata

  • Download URL: aligi-1.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for aligi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 48ea0fc33f836f576ac9e79702e660c43a959df0eefd5802a8c04b258c26a1f7
MD5 91168b6e66a599d8f74781ac90a654d4
BLAKE2b-256 09033855a2a24327b4b4d84fd8f3581f22ae5907bee3c269d833752c19ac113e

See more details on using hashes here.

File details

Details for the file aligi-1.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: aligi-1.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for aligi-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 507a1436b112a9772d51c4efe140ddc71e94f597dd4e917d39d5af0090f6186a
MD5 16d8c030461094a77617aafb36f7d9ac
BLAKE2b-256 0278559f6ca91d9b40b80b273b9c3090654cf4d2bb5efcc8304e256ec4a67c24

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.1

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

0.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page