Pony ORM is a Python Object-Relational Mapper that allows developers to work with databases using Python objects and queries written in plain Python. It translates Python queries into optimized SQL, supporting SQLite, PostgreSQL, MySQL, and Oracle. The current version is 0.7.19. Releases occur periodically, often driven by new Python version support or significant bugfixes, indicating an active but not rapid development cadence with several months to a year between minor releases.
pip install ponyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates defining a database connection, creating entity models, generating the database schema, and performing basic CRUD operations within a `db_session` context. It uses an in-memory SQLite database for simplicity.
Upgrade Python to 3.8+ or pin Pony ORM to a compatible version.
Upgrade Pony ORM to version 0.7.15 or newer for Python 3.10 and above.
Always wrap database interactions within a `db_session`.
Familiarize yourself with Pony's Pythonic query syntax as described in the official documentation.
Wrap your database operations within a `with db_session():` block or decorate functions with `@db_session`.
Upgrade Pony ORM to version 0.7.16 or newer. This bug was resolved in that release.
While Pony ORM includes some reconnection logic, ensure each logical unit of work is encapsulated within a `db_session`. For very long-running applications, consider explicit connection management or shorter `wait_timeout` on the database.
Upgrade Pony ORM to version 0.7.15 or newer, which transitioned to using Python's standard `ast` module.
No dependency data recorded yet.