Live data from Hacker News

Litestar is worth a look

b-list.org

81–86 of 86 posts

Re: Litestar is worth a look

#81
post #25
post #8

Thanks for writing this. I have similar gripes about FastAPI having developed an application over the past few years; I'm also continually surprised at how prevalent the attitude is that FastAPI has excellent docs, given how divorced the tutorial / toy examples in the docs are from real-world development and measurement of an API.

I am really disappointed at the new generation of Python frameworks' documentation, which seem to have the same "docs are tutorials + chatty blog posts which imprecisely describe the APIs" attitude of Javascript libs. Two words: API Reference. Have the clinical explanation of methods exposed, with actual breakdowns of what method parameters do. List them all, don't surround it by prose. List out the options! Don't ma…

[deleted]

Re: Litestar is worth a look

#82
post #74

Earlier quoted context omitted.

SQLAlchemy is just a totally different beast to Django, it has a much higher learning curve but gives you so much more power and flexibility. It's a true data mapper ORM rather than the sad Active Record pattern which starts off well and quickly gets annoying.

I'm curious about your experience, I like SQLAlchemy granularity and expressiveness, but after a while I found django fits the "good enough" niche very well, it's quick and not too dirty (the name wrangling for joins is funky but it's ok). What kind of queries or logic did SQLAlchemy allowed you to write that Django would make hell to reach ?

Tell me how to extend Django's default JOIN clause with custom AND, eg:

    SELECT \* FROM t1 LEFT JOIN t2 ON t1.id = t2.key AND t2.used_id = 213

Re: Litestar is worth a look

#84
post #25
post #8

Thanks for writing this. I have similar gripes about FastAPI having developed an application over the past few years; I'm also continually surprised at how prevalent the attitude is that FastAPI has excellent docs, given how divorced the tutorial / toy examples in the docs are from real-world development and measurement of an API.

I am really disappointed at the new generation of Python frameworks' documentation, which seem to have the same "docs are tutorials + chatty blog posts which imprecisely describe the APIs" attitude of Javascript libs. Two words: API Reference. Have the clinical explanation of methods exposed, with actual breakdowns of what method parameters do. List them all, don't surround it by prose. List out the options! Don't ma…

I’ll second this, and add that docstrings are becoming ever more useful as modern editors learn how to show them inline when I hover over a symbol. Starlette lacks docstrings entirely and it’s a real miss in my opinion.

Re: Litestar is worth a look

#85
post #78
post #76

I agree that FastAPI is not the best but I would not jump to another framework just because of an article. For FastAPI I know that I can go to [1] and see what a good FastAPI code base looks like. These days even Airflow is on FastAPI but haven't looked at the codebase. For me to jump on Litestar, I would like to see a reference codebase to learn best practices. Otherwise its one more framework whose quirks I have to…

Ready, set... jump! There's a reference application [0] [0] https://github.com/litestar-org/litestar-fullstack

Does it have tooling to help keep Python [0] and TypeScript [1] DTOs in sync?

[0] https://github.com/litestar-org/litestar-fullstack/blob/0996...

[1] https://github.com/litestar-org/litestar-fullstack/blob/0996...

Re: Litestar is worth a look

#86

Pretty cool post! I'm not sure how I feel about SQLAlchemy (not the star of the post but mentioned quite a bit); it's such a big ball of state that has so many surprises, I wonder if some people build entirely without it.

I recently built a personal project using peewee and it doesn't have a ton of bells and whistles but it works well for what it does do.

Do you use type hints? I was quite excited by peewee until I discovered the author's stance on type hints in python:

> I think type hints are misguided and unpythonic, and it's my stance that they will never be supported by peewee. Python is a high-level dynamic language, peewee plays to these strengths. You couldn't implement peewee in go, it'd look completely different.

There are thirdparty stubs available though, so I wonder how well these work.

PS: I do get that Python's type system might lack the expressiveness to fully support all ORM-like functionality, but I don't think that's a reason to not even provide hints for the super simple cases like `Person.select()`.

Post reply on HN