Reputation: 9256
Is there any asynchronous Python ORM other than Twistar?
I'm looking for lightweight ORM for non-blocking API, built on top of tornado. Of course, I can write raw SQL queries using momoko, but I'd like to work with objects.
Upvotes: 26
Views: 13055
Reputation: 66
Have a look at Tortoise ORM
Its aiming to be a full-featured ORM
inspired by Django syntax
, but asycnio only.
Since Tornado 5.0
runs on asyncio, it should just work.
Upvotes: 5
Reputation: 1444
It's been 5 years, and a lot changed. We wrote GINO to be a lightweight ORM on top of asyncpg and SQLAlchemy core. It is for asyncio and PostgreSQL only. GINO as "GINO Is Not ORM", because it applied almost none usual ORM patterns, in order to be explicit and simple.
Upvotes: 5
Reputation: 43
You may want to have a look at umysqldb(https://github.com/hongqn/umysqldb), A MySQLdb compatible wrapper around ultramysql. ultramysql compatible with gevent through monkey patching.
Upvotes: 0
Reputation: 3805
Sure, it is! Look at peewee and peewee-async extension. Disclaimer: extension is only for PostgreSQL at the moment and I'm an author of extension :)
It's not specifically for Tornado, but Tornado can run on asyncio event loop.
Upvotes: 15
Reputation: 723
You may want to have a look at Monguo, a "full-featured, asynchronous MongoDB ORM with Motor driver for Tornado applications" as it describes itself.
Upvotes: 1
Reputation: 1496
If using mongo you can look into Asyncmongo (not an orm but let's you access your data Async) https://github.com/bitly/asyncmongo
if it is of interest see video and slides from this webminar: "Asynchronous MongoDB with Python and Tornado" http://www.10gen.com/presentations/webinar/Asynchronous-MongoDB-with-Python-and-Tornado
Upvotes: 1
Reputation: 3291
None exist. The only ORM that could even consider coming close to being lightweight is PeeWee, and that isn't async. ORMs are hard to write, and even harder to write well. It needs to have a nice, clean API, expose many features of the underlying DB, and be efficient. A tall order!
There aren't many ORMs for Python, and even fewer async ones. Sorry.
Upvotes: 2