HACKER Q&A
📣 jonjlee

Is SQLAlchemy the industry standard Python ORM in 2023?


I'm starting a greenfield side project. I've only used Python in smaller projects without reason to hook up an ORM tool. In searching for choices now, the de facto standard seems to be SQLAlchemy, but I also see a number of references to Prisma[0][1] and other projects that claim to be a better, modern choice. What is the right choice for a brand new project at this time?

[0] https://github.com/prisma/prisma

[1] https://eash98.medium.com/why-sqlalchemy-should-no-longer-be-your-orm-of-choice-for-python-projects-b823179fd2fb


  👤 fermigier Accepted Answer ✓
Yes it is. I haven't seen many Python projects using Prisma and I don't believe the arguments in the blog post you've linked to carry much weight.

Note that there are several types of technologies that can help connect an application to an SQL database:

- SQL builders: the best known project seems to be Pypika by Kayak (https://github.com/kayak/pypika) but it seems to be dead of sleeping. - ORMs that follow the active record pattern: Django's ORM is obviously the "standard" here, but you have to use Django. There are a few, alternatives, that are probably worth investigating if you want to use this pattern. - ORMs that follow the unit of work pattern: here I think SLQAlchemy ORM has very little competition.

An interesting discussion can be found here: https://www.youtube.com/watch?v=x1fCJ7sUXCM


👤 margarina72
The short answer is yes, it is.

Aside for Django projects.

I would also point to SQLModel[1] by the same dev who made FastAPI

But it is just wrapper on top of SQLAlchemy.

1: https://sqlmodel.tiangolo.com/