apistar

The Web API toolkit. ?

  • 所有者: encode/apistar
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图


Community: https://discuss.apistar.org ? ? ? ? ?

Documentation: https://docs.apistar.com ?

Requirements: Python 3.6+


API Star is a toolkit for working with OpenAPI or Swagger schemas. It allows you to:

  • Build API documentation, with a selection of available themes.
  • Validate API schema documents, and provide contextual errors.
  • Make API requests using the dynamic client library.

You can use it to build static documentation, integrate it within a Web framework,
or use it as the client library for interacting with other APIs.

Quickstart

Install API Star:

$ pip3 install apistar

Let's take a look at some of the functionality the toolkit provides...

We'll start by creating an OpenAPI schema, schema.yaml:

openapi: 3.0.0
info:
  title: Widget API
  version: '1.0'
  description: An example API for widgets
servers:
  - url: https://www.example.org/
paths:
  /widgets:
    get:
      summary: List all the widgets.
      operationId: listWidgets
      parameters:
      - in: query
        name: search
        description: Filter widgets by this search term.
        schema:
          type: string

Let's also create a configuration file apistar.yml:

schema:
  path: schema.yaml
  format: openapi

We're now ready to start using the apistar command line tool.

We can validate our OpenAPI schema:

$ apistar validate
✓ Valid OpenAPI schema.

Or build developer documentation for our API:

$ apistar docs --serve
✓ Documentation available at "http://127.0.0.1:8000/" (Ctrl+C to quit)

We can also make API requests to the server referenced in the schema:

$ apistar request listWidgets search=cogwheel

Where did the server go?

With version 0.6 onwards the API Star project is being focused as a
framework-agnostic suite of API tooling. The plan is to build out this
functionality in a way that makes it appropriate for use either as a stand-alone
tool, or together with a large range of frameworks.

The 0.5 branch remains available on GitHub, and can be installed from PyPI
with pip install apistar==0.5.41. Any further development of the API Star
server would likely need to be against a fork of that, under a new maintainer.

If you're looking for a high-performance Python-based async framework, then
I would instead recommend Starlette.


主要指标

概览
名称与所有者encode/apistar
主编程语言Python
编程语言Python (语言数: 5)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2017-03-17 15:42:12
推送于2022-02-24 05:00:58
最后一次提交2021-08-31 05:48:33
发布数94
最新版本名称0.7.2 (发布于 2019-04-03 09:12:19)
第一版名称0.1.1 (发布于 2017-03-29 13:19:12)
用户参与
星数5.6k
关注者数165
派生数410
提交数768
已启用问题?
问题数303
打开的问题数22
拉请求数216
打开的拉请求数10
关闭的拉请求数142
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?