Skip to main content

:rocket: RestfulApi :facepunch:


模型部署

Install

pip install restful_api -U

Usage

import jieba
from restful_api import Api


pred1 = lambda **kwargs: kwargs['x'] + kwargs['y']
pred2 = lambda x=1, y=1: x + y
pred3 = lambda text='小米是家不错的公司': jieba.lcut(text)

# 多服务堆叠
api = Api('/post1', pred1)
api = Api('/post2', pred2, app=api.app)
api = Api('/post3', pred3, app=api.app)
api.app.run()

Test

import requests
json = {'x': 1, 'y': 10}
requests.post('http://127.0.0.1:5000/post1', json=json).json()
requests.post('http://127.0.0.1:5000/post2', json=json).json()
requests.post('http://127.0.0.1:5000/post3', json=json).json()

Download files

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

Source Distribution

restful_api-0.0.4.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

restful_api-0.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file restful_api-0.0.4.tar.gz.

File metadata

  • Download URL: restful_api-0.0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for restful_api-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8d737546edbfc6cfd785e83c5dfae7ad01fb786c8f5b260fd8dffc409d3d7812
MD5 45cbe668b6fc9cb00c196ddf9adad0d7
BLAKE2b-256 6ebfe8ae5bdc5076c265ee143c365963253e2bf8ff3530727f9e9cec2d2e7e06

See more details on using hashes here.

File details

Details for the file restful_api-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: restful_api-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for restful_api-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 00675dd6ffb6708694ec35bd0c7098379e0d43218973c2f0d67bfe724f9527ee
MD5 7a47de7bccad91c9df90d814fcfd0171
BLAKE2b-256 360a2039b07db068f1557b5917068ca4de83baff5ce7ddb5ccfe1521b678d45c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

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