๐Ÿ“ฆ encode / apistar

The Web API toolkit. ๐Ÿ› 

โ˜… 5.6k stars โ‘‚ 409 forks ๐Ÿ‘ 5.6k watching โš–๏ธ BSD 3-Clause "New" or "Revised" License
apipythonrest
๐Ÿ“ฅ Clone https://github.com/encode/apistar.git
HTTPS git clone https://github.com/encode/apistar.git
SSH git clone git@github.com:encode/apistar.git
CLI gh repo clone encode/apistar
Lucidiot Lucidiot Set minimum Python version to 3.6 (#655) 21c2942 6 years ago ๐Ÿ“ History
๐Ÿ“‚ 21c2942a94b38e21f02217c8a3b901a1224fd630 View all commits โ†’
๐Ÿ“ apistar
๐Ÿ“ docs
๐Ÿ“ docs-theme
๐Ÿ“ scripts
๐Ÿ“ testcases
๐Ÿ“ tests
๐Ÿ“„ .codecov.yml
๐Ÿ“„ .coveragerc
๐Ÿ“„ .flake8
๐Ÿ“„ .gitignore
๐Ÿ“„ .isort.cfg
๐Ÿ“„ .travis.yml
๐Ÿ“„ LICENSE.md
๐Ÿ“„ mkdocs.yml
๐Ÿ“„ README.md
๐Ÿ“„ requirements.txt
๐Ÿ“„ setup.py
๐Ÿ“„ README.md

API Star

๐Ÿ›  The Web API toolkit. ๐Ÿ› 

Build Status codecov Package version Python versions


Community: https://discuss.apistar.org ๐Ÿค” ๐Ÿ’ญ ๐Ÿค“ ๐Ÿ’ฌ ๐Ÿ˜Ž

Documentation: https://docs.apistar.com ๐Ÿ“˜


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-agnositic 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.


API Star is BSD licensed code.
Designed & built in Brighton, England.

API Star