The Polypheny Python connector lets Python applications execute queries through the Prism Query Interface. It follows the connection and cursor conventions of Python DB-API 2.0 (PEP 249) and adds executeany() for languages such as MQL. SQL rows are returned as Python lists and document results as dictionaries. See the cursor reference for supported operations and result limitations.
Installation
Use Python 3.9 or later. Install the connector and its Prism 2.2 bindings from PyPI.
python -m pip install polypheny==2.0.0
polypheny is both the package name and the name to import. The package installs polypheny-prism-api==2.2 as a dependency. Release files and requirements
Server compatibility
Enable the Prism Query Interface on the server. Connector 2.0.0 connects when the server reports that its Prism API is compatible. A Prism 2.1 server can accept a 2.2 client. Document collection metadata requires server support introduced with Prism 2.2.
A server using Prism 1.x requires a connector built for Prism 1.x, such as polypheny==1.0.0 for Prism 1.9. Upgrade the server and client together when moving between Prism major versions. Prism protocol
Next steps
- Follow Getting Started to connect, execute parameterized SQL and manage a transaction.
- Use the module reference to choose a transport.
- Consult Types and Error Handling when processing results.
- See Document Collection Metadata for the Prism request used to inspect a collection.