Bottle VS fastapi

Compare Bottle vs fastapi and see what are their differences.

Bottle

bottle.py is a fast and simple micro-framework for python web-applications. (by bottlepy)
Our great sponsors
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • SaaSHub - Software Alternatives and Reviews
Bottle fastapi
21 453
8,186 65,377
0.9% -
0.0 9.4
11 days ago 7 days ago
Python Python
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Bottle

Posts with mentions or reviews of Bottle. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-02.

fastapi

Posts with mentions or reviews of fastapi. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-10.
  • 🔥14 Excellent Open-source Projects for Developers😎
    5 projects | dev.to | 10 Dec 2023
    2. FastAPI - Turbocharge Your Web APIs with Python ⚡
  • Building a Multi-Tenant App with FastAPI, SQLModel, and PropelAuth
    2 projects | dev.to | 6 Dec 2023
    In this tutorial, we’ll walk you through how to create a multi-tenant link shortening product using FastAPI (a popular Python web framework), SQLModel (a library for interacting with SQL databases in Python) and PropelAuth (a B2B/multi-tenant authentication provider).
  • APIs in Go with Huma 2.0
    6 projects | dev.to | 6 Dec 2023
    When it came time to evaluate replacing the now aging service, I prototyped a new version using the rapidly growing FastAPI framework, which automatically generates OpenAPI from the code for you, eliminating the possibility of the code & OpenAPI being out of sync, with the downstream effect of the docs, CLI, and SDKs also staying in sync properly. You can also still use a design-first approach, it just involves some structures written in code to be reviewed first. Design vs. code first is a false dichotomy by which we needn't be constrained.
  • It's Christmas day. You wake up, run to the tree, tear open the largest package with your name on it... FastAPI has added _____?
    4 projects | /r/Python | 6 Dec 2023
    Getting rid of redoc and replacing it with something that actually has api testing and not predatory pricing (4k a year for "search" for their premium version). There's literally two PR's open for alternatives that I've been following but doubt they'll get approved 1. scalar https://github.com/tiangolo/fastapi/pull/10674 - This is like Redoc on steroids 2. stoplight https://github.com/tiangolo/fastapi/pull/5168 - Has been open for almost 2 years
  • The Blueprint for Trustworthy AI: Constructing Accurate Chatbots with Sophisticated Data Pipelines
    3 projects | dev.to | 9 Nov 2023
    Python (FastAPI web framework)
  • Experience using crow as web server
    11 projects | /r/cpp | 6 Nov 2023
    I'm investigating using C++ to build a REST server, and would love to know of people's experiences with Crow-- or whether they would recommend something else as a "medium-level" abstraction C++ web server. As background, I started off experimenting with Python/FastAPI, which is great, but there is too much friction to translate from pybind11-exported C++ objects to the format that FastAPI expects, and, of course, there are inherent performance limitations using Python, which could impact scaling up if the project were to be successful.
  • Building a Secure API with FastAPI, PostgreSQL, and Hanko Authentication
    5 projects | dev.to | 30 Oct 2023
    In today's fast-paced digital landscape, building robust, secure and user-friendly API is necessity. In this blog post, we'll explore the development of a fastapi application using a powerful tech stack consisting of FastAPI, PostgreSQL, and integrating Hanko authentication for enhanced security.
  • FastAPI Production Setup Guide 🏁⚡️🚀
    6 projects | dev.to | 18 Oct 2023
    import logging import sys import time from datetime import datetime from typing import Any, Callable, TypeVar import uvicorn from bson import ObjectId from fastapi import FastAPI, HTTPException, Path, Request, Response from fastapi.middleware.cors import CORSMiddleware from motor.motor_asyncio import AsyncIOMotorClient from pydantic import BaseModel from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): mongo_uri: str root_path: str = "" logging_level: str = "INFO" model_config = SettingsConfigDict(env_file=".env", extra="ignore") settings = Settings() logging.basicConfig( stream=sys.stdout, level=settings.logging_level, format="[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s", # noqa: E501 datefmt="%d/%b/%Y %H:%M:%S", ) logger = logging.getLogger("my-todos") db_client = AsyncIOMotorClient(settings.mongo_uri) db = db_client.todoDb description = """ This is a fancy API built with [FastAPI🚀](https://fastapi.tiangolo.com/) 📝 [Source Code](https://github.com/dpills/fastapi-prod-guide) 🐞 [Issues](https://github.com/dpills/fastapi-prod-guide/issues) """ app = FastAPI( title="My Todo App", description=description, version="1.0.0", docs_url="/", root_path=settings.root_path, ) app.add_middleware( CORSMiddleware, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], allow_origins=[ "http://localhost:3000", ], ) MONGO_ID_REGEX = r"^[a-f\d]{24}$" F = TypeVar("F", bound=Callable[..., Any]) class Todo(BaseModel): title: str completed: bool = False class TodoId(BaseModel): id: str class TodoRecord(TodoId, Todo): created_date: datetime updated_date: datetime class NotFoundException(BaseModel): detail: str = "Not Found" @app.middleware("http") async def process_time_log_middleware(request: Request, call_next: F) -> Response: """ Add API process time in response headers and log calls """ start_time = time.time() response: Response = await call_next(request) process_time = str(round(time.time() - start_time, 3)) response.headers["X-Process-Time"] = process_time logger.info( "Method=%s Path=%s StatusCode=%s ProcessTime=%s", request.method, request.url.path, response.status_code, process_time, ) return response @app.post("/todos", response_model=TodoId) async def create_todo(payload: Todo) -> TodoId: """ Create a new Todo """ now = datetime.utcnow() insert_result = await db.todos.insert_one( { "title": payload.title, "completed": payload.completed, "created_date": now, "updated_date": now, } ) return TodoId(id=str(insert_result.inserted_id)) @app.get( "/todos/{id}", response_model=TodoRecord, responses={ 404: {"description": "Not Found", "model": NotFoundException}, }, ) async def get_todo( id: str = Path(description="Todo ID", pattern=MONGO_ID_REGEX) ) -> TodoRecord: """ Get a Todo """ doc = await db.todos.find_one({"_id": ObjectId(id)}) if not doc: raise HTTPException(status_code=404, detail="Not Found") return TodoRecord( id=str(doc["_id"]), title=doc["title"], completed=doc["completed"], created_date=doc["created_date"], updated_date=doc["updated_date"], ) @app.get("/todos", response_model=list[TodoRecord]) async def get_todos() -> list[TodoRecord]: """ Get Todos """ todos: list[TodoRecord] = [] async for doc in db.todos.find(): todos.append( TodoRecord( id=str(doc["_id"]), title=doc["title"], completed=doc["completed"], created_date=doc["created_date"], updated_date=doc["updated_date"], ) ) return todos @app.put( "/todos/{id}", response_model=TodoId, responses={ 404: {"description": "Not Found", "model": NotFoundException}, }, ) async def update_todo( payload: Todo, id: str = Path(description="Todo ID", pattern=MONGO_ID_REGEX), ) -> TodoId: """ Update a Todo """ now = datetime.utcnow() update_result = await db.todos.update_one( {"_id": ObjectId(id)}, { "$set": { "title": payload.title, "completed": payload.completed, "updated_date": now, } }, ) if update_result.matched_count == 0: raise HTTPException(status_code=404, detail="Not Found") return TodoId(id=id) @app.delete( "/todos/{id}", response_model=bool, responses={ 404: {"description": "Not Found", "model": NotFoundException}, }, ) async def delete_todo( id: str = Path(description="Todo ID", pattern=MONGO_ID_REGEX), ) -> bool: """ Delete a Todo """ delete_result = await db.todos.delete_one({"_id": ObjectId(id)}) if delete_result.deleted_count == 0: raise HTTPException(status_code=404, detail="Not Found") return True if __name__ == "__main__": uvicorn.run( "main:app", host="0.0.0.0", port=8000, log_level="debug", reload=True, )
  • An Introduction to ⚡FastAPI
    5 projects | dev.to | 17 Oct 2023
    FastAPI documentation
  • DevOps with Fast API & PostgreSQL: How to containerize Fast API Application with Docker
    4 projects | dev.to | 3 Oct 2023
    FastAPI is an open-source modern framework that is used to build APIs in Python.

What are some alternatives?

When comparing Bottle and fastapi you can also consider the following projects:

AIOHTTP - Asynchronous HTTP client/server framework for asyncio and Python

HS-Sanic - Async Python 3.6+ web server/framework | Build fast. Run fast. [Moved to: https://github.com/sanic-org/sanic]

Tornado - Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

django-ninja - 💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

Flask - The Python micro framework for building web applications.

swagger-ui - Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Django - The Web framework for perfectionists with deadlines.

starlite - Light, Flexible and Extensible ASGI API framework | Effortlessly Build Performant APIs [Moved to: https://github.com/litestar-org/litestar]

BentoML - Build Production-Grade AI Applications

django-rest-framework - Web APIs for Django. 🎸

vibora - Fast, asynchronous and elegant Python web framework.

chalice - Python Serverless Microframework for AWS