10 votes

How to choose a Python API framework

12 comments

  1. [6]
    Adys
    Link
    "Just use FastAPI" is my answer nowadays, but this guide looks pretty fair and unbiased. That said, I don't think Bottle is worth considering, and imo Flask is strictly worse than FastAPI. The...

    "Just use FastAPI" is my answer nowadays, but this guide looks pretty fair and unbiased.

    That said, I don't think Bottle is worth considering, and imo Flask is strictly worse than FastAPI. The choice is only between DRF and FastAPI.

    5 votes
    1. [3]
      Deimos
      Link Parent
      This just came up today but is worrisome: https://github.com/samuelcolvin/pydantic/issues/2678 Some upcoming changes to type annotations in Python 3.10 make it more difficult for FastAPI. We're...

      This just came up today but is worrisome: https://github.com/samuelcolvin/pydantic/issues/2678

      Some upcoming changes to type annotations in Python 3.10 make it more difficult for FastAPI. We're extremely close to the cutoff for planned changes in 3.10, but it looks like the Steering Council is well aware of the problem now, it's just unfortunate that it's happening so last-minute.

      4 votes
      1. [2]
        Adys
        Link Parent
        I'm not super worried; it's actively looked into yeah. Just now: https://mail.python.org/archives/list/python-dev@python.org/thread/ZBJ7MD6CSGM6LZAOTET7GXAVBZB7O77O/

        I'm not super worried; it's actively looked into yeah.

        Just now: https://mail.python.org/archives/list/python-dev@python.org/thread/ZBJ7MD6CSGM6LZAOTET7GXAVBZB7O77O/

        2 votes
    2. ali
      (edited )
      Link Parent
      I built a whole webapp in a day this week with fastapi. I was amazed by how easy it was The only problem I faced was the deployment (since I’ve never done any deployment myself). I feel like there...

      I built a whole webapp in a day this week with fastapi. I was amazed by how easy it was

      The only problem I faced was the deployment (since I’ve never done any deployment myself). I feel like there were tons more guides how to deploy stuff with flask

      4 votes
    3. keb
      Link Parent
      What's wrong with Bottle? Only reason I asked is because I deployed a simple site with it recently and found it a joy.

      What's wrong with Bottle?

      Only reason I asked is because I deployed a simple site with it recently and found it a joy.

      2 votes
  2. [6]
    teaearlgraycold
    Link
    I’d like to have a post like this for typescript

    I’d like to have a post like this for typescript

    3 votes
    1. [5]
      Adys
      Link Parent
      "Just use NextJS" :)

      "Just use NextJS" :)

      1 vote
      1. [4]
        buzziebee
        Link Parent
        NextJS is for more full stack web apps where you're generating the front-end as well right? I'm not sold on using it as just an api, but maybe I've missed some developments in the next world. For...

        NextJS is for more full stack web apps where you're generating the front-end as well right? I'm not sold on using it as just an api, but maybe I've missed some developments in the next world.

        For just an api something like NestJS is very nice. Typescript first and very opinionated with sensible defaults and plenty of prebuilt tools which makes working on it a lot nicer than using bare express imo.

        1. [2]
          Beenrak
          Link Parent
          Pretty serious necro, especially for tech. What made you reply to this 2-year old comment? I was so weirded out the way they were talking about Python 3.10/11 was not out yet

          Pretty serious necro, especially for tech. What made you reply to this 2-year old comment? I was so weirded out the way they were talking about Python 3.10/11 was not out yet

          4 votes
          1. buzziebee
            (edited )
            Link Parent
            Oh wow I didn't spot the date on the thread! Sorry! I think yesterday I did a search for framework to see what people thought about the new 16" model. I must have left tildes and come back to the...

            Oh wow I didn't spot the date on the thread! Sorry!

            I think yesterday I did a search for framework to see what people thought about the new 16" model. I must have left tildes and come back to the tab thinking it was the activity feed. I assume there isn't a way to un necro a topic?

            Edit: Oh no... It's on the activity feed again. I made it worse.

            1 vote
        2. Adys
          Link Parent
          Yeah I wouldn't use NextJS just to do an API. But if I only wanted to do an API, I would not use JS/TS in the first place honestly, Python is still a better fit, unless you give up on SQL altogether.

          Yeah I wouldn't use NextJS just to do an API. But if I only wanted to do an API, I would not use JS/TS in the first place honestly, Python is still a better fit, unless you give up on SQL altogether.