Pony is a Python ORM with beautiful query syntax
Write your database queries using Python generators & lambdas
Try PonyORM now
Free software
Now licensed under Apache 2.0 License
Easy to use and powerful
database query syntax

Using Pony object-relational mapper you can concentrate on writing business logic of your application and use Python syntax for interacting with the database. Pony translates such queries into SQL and executes them in the database in a most efficient way.

Learn more

Here is Pony query example:

Customer.select(lambda c:sum(c.orders.price) > 1000)

which is being translated into the following SQL:

SELECT "c"."id"
FROM "customer" "c"
  LEFT JOIN "order" "order-1"
    ON "c"."id" = "order-1"."customer"
GROUP BY "c"."id"
HAVING coalesce(SUM("order-1"."total_price"), 0) > 1000

Online tool
for database design

You can start modeling your application right now. Once your data diagram is ready, you can start using it with Pony ORM or get SQL statements for creating tables.

Learn more

Easy to start with, quick to learn

If you know Python you already know how to write queries with Pony.

Scalable and powerful

Pony is good for beginners due to it pythonic syntax. But besides this it also provides great performance due to smart caching.

Up-to-date with the latest database features

Pony now supports a native database JSON data type that enables efficient access to data in JSON format.

  • Licensed under Apache 2.0
  • Great for start-ups and researchers
  • Easy to do aggregations
  • Reliability and safety - no SQL injections possible
  • Supports major relational databases: SQLite, PostgreSQL, MySQL, Oracle
  • Stable API
  • Many years of development
  • Join us on Telegram. Meet the PonyORM team, chat with the community members, and get your questions answered on our community Telegram group.
  • Post your PonyORM questions on Stack Overflow.
  • Report an issue. Submit bug reports, suggest new features, or follow development on our GitHub repo.
  • Reach us on Twitter.
Join the newsletter