Top 23 Python OpenAPI Projects
-
-
full-stack-fastapi-postgresql
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Project mention: Ask HN: I just got my first job and I need to learn faster and better | news.ycombinator.com | 2022-03-08I wouldn't overthink this, no ones expecting a new hire to instantly pick up the codebase. You mentioned you only got generic advice from the other developer, did you ask generic questions? It's difficult to answer vague questions. Most importantly I wouldn't extrapolate your experience at this company to sweeping generalizations about how smart you are - there's close to 0 correlation.
As for FastAPI specifically I'd check out the sample postgresql project tiangalo made, it's incredibly well put together.
[1] https://github.com/tiangolo/full-stack-fastapi-postgresql
-
Scout APM
Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
-
connexion
Swagger/OpenAPI First framework for Python on top of Flask with automatic endpoint validation & OAuth2 support
Project mention: How much front-end knowledge is required to work in Flask? | reddit.com/r/flask | 2022-04-26I do like to use their SQLAlchemy ModelView for CRUD operations and expose a OpenAPI to it using flask based connexion project for front-end or other integration points.
-
Project mention: I wrote okjson - A fast, simple, and pythonic JSON Schema Validator | reddit.com/r/Python | 2022-03-31
I had a requirement to process and validate large payloads of JSON concurrently for a web service, initially I implemented it using jsonschema and fastjsonschema but I found the whole JSON Schema Specification to be confusing at times and on top of that wanted better performance. Albeit there are ways to compile/cache the schema, I wanted to move away from the schema specification so I wrote a validation library inspired by the design of tiangolo/sqlmodel (type hints) to solve this problem easier.
-
Project mention: FastAPI vs. Flask: Comparing the Pros and Cons of Top Microframeworks for Building a REST API in Python | dev.to | 2022-03-26
Flask offers extensions, such as Flask-Swagger or Flasgger, which operate using the specification mentioned above. They require additional installation and knowledge of the format used by these standards.
-
Django Ninja (Django, but minimal like flask + Pydantic)
-
Swagger and OpenAPI capabilities using drf-yasg, where you can only see endpoints and Swagger docs if you have a valid Token
-
SonarQube
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
-
uvicorn-gunicorn-fastapi-docker
Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python 3.6 and above with performance auto-tuning. Optionally with Alpine Linux.
Project mention: Please share or link to a FastApi tutorial with VM or containerized webserver | reddit.com/r/FastAPI | 2021-12-03There is a prepackaged docker image using uvicorn/gunicorn from the same guy who made fastapi. Read me should be enough for you to get going. https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker Also be worth reading offical docs on doing this yourself too. https://fastapi.tiangolo.com/uk/deployment/docker/
-
-
Schemathesis
A modern API testing tool for web applications built with Open API and GraphQL specifications.
Project mention: Generating arbitrary queries for a GraphQL schema | reddit.com/r/graphql | 2022-05-02P.S. There is a higher-level tool that wraps this library (so, one doesn't have to write Python code)
-
datamodel-code-generator
Pydantic model generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
Project mention: PSA: I think this JSON to Pydantic converter is extremely useful for boilerplate model creation | reddit.com/r/FastAPI | 2022-04-23Not sure who owns/hosts the site, but its based on this github repo.
-
apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
-
-
-
APIFlask (Flask with Pydantic and all the other good stuff)
-
-
One feature you could actually contribute to is this: https://github.com/starlite-api/starlite/issues/37
-
pyswagger
An OpenAPI (fka Swagger) client & converter in python, which is type-safe, dynamic, spec-compliant.
-
Thanks for the link, but not necessarily.
How WSDL and the code generation around it worked, was that you'd have a specification of the web API (much like OpenAPI attempts to do), which you could feed into any number of code generators, to get output code which has no coupling to the actual generator at runtime, whereas Pyotr is geared more towards validation and goes into the opposite direction: https://pyotr.readthedocs.io/en/latest/client/
The best analogy that i can think of is how you can also do schema first application development - you do your SQL migrations (ideally in an automated way as well) and then just run a command locally to generate all of the data access classes and/or models for your database tables within your application. That way, you save your time for 80% of the boring and repetitive stuff while minimizing the risks of human error and inconsistencies, while nothing preventing you from altering the generated code if you have specific needs (outside of needing to make it non overrideable, for example, a child class of a generated class). Of course, there's no reason why this can't be applied to server code either - write the spec first and generate stubs for endpoints that you'll just fill out.
Similarly there shouldn't be a need for a special client to generate stubs for OpenAPI, the closest that Python in particular has for now is this https://github.com/openapi-generators/openapi-python-client
However, for some reason, model driven development never really took off, outside of niche frameworks, like JHipster: https://www.jhipster.tech/
Furthermore, for whatever reason formal specs for REST APIs also never really got popular and aren't regarded as the standard, which to me seems silly: every bit of client code that you write will need a specific version to work against, which should be formalized.
-
If you want to expose your database, i created this: https://github.com/thomaxxl/safrs/blob/master/docs/ExposeDB.md
-
-
I did find https://github.com/p1c2u/openapi-spec-validator and https://github.com/p1c2u/openapi-schema-validator, but I'm pretty new to the devops world so I'm not sure if these are exactly what I'm looking for. Any recommendations or advice is appreciated.
-
Flama (Starlette, Marshmallow instead of Pydantic)
Python OpenAPI related posts
- Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs
- Flask vs FastAPI?
- APIFlask is a lightweight Python web API framework
- A lightweight Python web API framework
- How much front-end knowledge is required to work in Flask?
- Django Ninja – Fast Django REST Framework
- PSA: I think this JSON to Pydantic converter is extremely useful for boilerplate model creation
Index
What are some of the best open-source OpenAPI projects in Python? This list will help you:
Project | Stars | |
---|---|---|
1 | fastapi | 45,143 |
2 | full-stack-fastapi-postgresql | 8,876 |
3 | connexion | 3,991 |
4 | jsonschema | 3,659 |
5 | flasgger | 2,969 |
6 | django-ninja | 2,918 |
7 | drf-yasg | 2,728 |
8 | uvicorn-gunicorn-fastapi-docker | 1,787 |
9 | best-of-web-python | 1,526 |
10 | Schemathesis | 1,244 |
11 | datamodel-code-generator | 974 |
12 | apispec | 948 |
13 | fastapi-crudrouter | 725 |
14 | bravado | 582 |
15 | apiflask | 544 |
16 | flask-smorest | 450 |
17 | starlite | 450 |
18 | pyswagger | 356 |
19 | openapi-python-client | 354 |
20 | safrs | 345 |
21 | APIFuzzer | 218 |
22 | openapi-spec-validator | 214 |
23 | flama | 202 |
Are you hiring? Post a new remote job listing for free.