Skip to main content

Downloads

Downloads Downloads Downloads

Pony Object-Relational Mapper

Pony is an advanced object-relational mapper. The most interesting feature of Pony is its ability to write queries to the database using Python generator expressions and lambdas. Pony analyzes the abstract syntax tree of the expression and translates it into a SQL query.

Here is an example query in Pony:

select(p for p in Product if p.name.startswith('A') and p.cost <= 1000)

Pony translates queries to SQL using a specific database dialect. Currently Pony works with SQLite, MySQL, PostgreSQL and Oracle databases.

By providing a Pythonic API, Pony facilitates fast app development. Pony is an easy-to-learn and easy-to-use library. It makes your work more productive and helps to save resources. Pony achieves this ease of use through the following:

  • Compact entity definitions
  • The concise query language
  • Ability to work with Pony interactively in a Python interpreter
  • Comprehensive error messages, showing the exact part where an error occurred in the query
  • Displaying of the generated SQL in a readable format with indentation

All this helps the developer to focus on implementing the business logic of an application, instead of struggling with a mapper trying to understand how to get the data from the database.

See the example here

Support Pony ORM Development

Pony ORM is Apache 2.0 licensed open source project. If you would like to support Pony ORM development, please consider:

Become a backer or sponsor

Online tool for database design

Pony ORM also has the Entity-Relationship Diagram Editor which is a great tool for prototyping. You can create your database diagram online at https://editor.ponyorm.com, generate the database schema based on the diagram and start working with the database using declarative queries in seconds.

Documentation

Documentation is available at https://docs.ponyorm.org The documentation source is available at https://github.com/ponyorm/pony-doc. Please create new documentation related issues here or make a pull request with your improvements.

Development

Install the development tools:

python -m pip install -r requirements-dev.txt

Format the Python code and apply safe lint fixes:

python -m ruff check --fix .
python -m ruff format .

Check the code without changing any files:

python -m ruff check .
python -m ruff format --check .

License

Pony ORM is released under the Apache 2.0 license.

PonyORM community

Please post your questions on Stack Overflow. Meet the PonyORM team, chat with the community members, and get your questions answered on our community Telegram group. Join our newsletter at ponyorm.org. Reach us on Twitter.

Copyright (c) 2013-2026 Pony ORM. All rights reserved. info (at) ponyorm.org

Release files for pony 0.7.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pony 0.7.20
File Size Uploaded
pony-0.7.20.tar.gz 278.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pony 0.7.20
File Interpreter ABI Platform
pony-0.7.20-py3-none-any.whl Python 3 none any Details

Total release size: 598.7 kB

Release files / pony-0.7.20.tar.gz

Download URL pony-0.7.20.tar.gz
Size 278.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27a48dffd1d1005956ffa96873fb2de5eada639ca266c43db480cadabc860ccd
BLAKE2b-256 checksum
How to use checksums
8b0ec76b175a7422816520552e2afc69303a171f434dc494354376d9d24ad2d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / pony-0.7.20-py3-none-any.whl

Download URL pony-0.7.20-py3-none-any.whl
Size 319.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88eb65c940c6efebdc56d2181dc4e5c89650f993f0b27037bbfb3e07b60696ba
BLAKE2b-256 checksum
How to use checksums
b681edd1014ef987dae03a30ccde3d30e317130d19dfe5317650a35cfba0151f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.7.20 This release

2 release files

0.7.19

2 release files

0.7.18

2 release files

0.7.17

2 release files

0.7.16

2 release files

0.7.15

2 release files

0.7.14

1 release file

0.7.13

1 release file

0.7.12

1 release file

0.7.11

1 release file

0.7.10

1 release file

0.7.9

1 release file

0.7.8

1 release file

0.7.7

1 release file

0.7.6

3 release files

0.7.5

2 release files

0.7.4

1 release file

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.9

1 release file

0.4.8

1 release file

0.4.7

1 release file

0.4.6

1 release file

0.4.5

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

0.0.1a1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page