Skip to main content

description

Project description

: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()

Project details


Download files

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

Source Distribution

iapp-0.0.1565237411.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

iapp-0.0.1565237411-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file iapp-0.0.1565237411.tar.gz.

File metadata

  • Download URL: iapp-0.0.1565237411.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for iapp-0.0.1565237411.tar.gz
Algorithm Hash digest
SHA256 87bce13bcc40b780734396b27576cd25968cfd667f88357b708ccb75ba401702
MD5 1c208c2757cd909da775ecc2f178ab6e
BLAKE2b-256 c76629f190734b4b9c9164b1acbf77d3cf8d5529cdba8e15d6ae365614ec136d

See more details on using hashes here.

File details

Details for the file iapp-0.0.1565237411-py3-none-any.whl.

File metadata

  • Download URL: iapp-0.0.1565237411-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for iapp-0.0.1565237411-py3-none-any.whl
Algorithm Hash digest
SHA256 97a6d355d0035308c92bc85f5da090f5f106f7c3b4f5a1504aa68d185a4998a5
MD5 577ca41c53d28af508b7e77d2a0ecd6e
BLAKE2b-256 9581d1e4290da7bd1345777231f9973c8fab92404b4e23be30ceb73bf40dbf57

See more details on using hashes here.

Supported by

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