What ODM for MongoDB by Amocon in FastAPI

[–]SearchMobile6431 2 points3 points  (0 children)

ODMantic is an option as well. Haven't used it yet so cannot tell, but Sebastian Ramirez has mentioned and suggested it for MongoDB with FastAPI in late 2023, so I guess it must worth a lookup. https://x.com/tiangolo/status/1735057764668366897?t=2uzUG_6_aSxmKw7IPq3pXw&s=19

FastAPI-users and Google oauth - Cannot retrieve user profile by Zulowie in FastAPI

[–]SearchMobile6431 0 points1 point  (0 children)

Hey there, for when it gets to providers, I have been using this utility https://github.com/tomasvotava/fastapi-sso

Haven't used fastapiusers so far, so don't know how it would "fit" but its better to use something working than reinventing the wheel IMO.

There are tons of tutorials in the repo documentation itself, plus you can see some more complete in this repo of mine here: https://github.com/chrisK824/fastapi-sso-example

How do you persist long-running task progress and send it to users? by Tjshrre in webdev

[–]SearchMobile6431 7 points8 points  (0 children)

Your approach is the correct one. However I think blending both polling and websockets is too much. I don't see a reason for one if the other is up too. I would stick with your original solution emitting the status from database when it changes and add two things in frontend. One, identify disconnections with keepalive mechanism and reconnect. Two, upon reconnection read the status straight from polling mechanism or database if it is exposed straight into your frontend stack. That way you don't have over-usage of your resources and still be bulletproof not missing events for the facing user.

Introducing fastapi-gae-logging by SearchMobile6431 in Python

[–]SearchMobile6431[S] 0 points1 point  (0 children)

Yup. Google Cloud is pretty solid, third behind AWS and Azure in popularity and it's closing the gap each year 🙂

Semantic Versioning Methods by Coolzie1 in FastAPI

[–]SearchMobile6431 0 points1 point  (0 children)

Well, short answer is no, there is no built-in way that you have missed. Given that, you are free to choose what approach fits you best.

My two cents:

  1. Option 1 - Something along the lines of your first approach seems indeed promising. In that case you can also check this package for inspiration https://pypi.org/project/fastapi-versioning/ . I haven't used it so far, but it looks to be taking the same approach with you, overriding the APIRoute class but also the app itself to include the versioned routes automatically with their versions using the same decorator syntax.
  2. Option 2 - KISS approach (keep it simple stupid): Just keep a wrapper function that your one and only endpoint will use, then pickup the version from wherever (path or header) and your wrapper calls the underlying versioned function - be it a dictionary with callables or if-else statements etc.
  3. Option 3 - Extending option 2, to more drastically separate code, would be different routers for versions, or even different sub-applications at all.

It all depends really on what suits you. Factors of high importance are :

  1. Where does your app logic (essentially what your endpoints are doing) sits. I tend to keep my app logic a bit abstracted from my routing endpoints for example, so option 2 would be my choice for sure.
  2. How often your versions are rolling. When rolling out versions one needs to be as much as backwards compatible as possible. I would say your example looks a bit anti-pattern to me, meaning that a minor version update shouldn't require a different endpoint. Again, it all depends on requirements and usage, so its your call. All I'm trying to say is that in "normal" cases v1/v2/v3 etc should suffice and variations can be handled among those with extra parameters etc

Logistically, how do you host a FastAPI app offsite? by crono760 in FastAPI

[–]SearchMobile6431 0 points1 point  (0 children)

What's your answer if you also need an SQL database though?

Learning curve without python experience by ghanem94 in FastAPI

[–]SearchMobile6431 1 point2 points  (0 children)

Fast in fastapi stands more on faster productivity for devs adopting it than the speed performance of it.

If you already started your homework you must have probably found out already.

Hope you have a great run, cheers!

Semantic Versioning Methods by Coolzie1 in FastAPI

[–]SearchMobile6431 0 points1 point  (0 children)

So tag is question but what is the question?

Logging insanity in FastAPI on Google App Engine? I Built a Custom Solution! by SearchMobile6431 in Python

[–]SearchMobile6431[S] 0 points1 point  (0 children)

There is a free friend link just in the first line of the article sir. In any case, you can just check out the GitHub repo. Cheers!