The Polypheny Python connector lets Python applications execute queries through the Prism Query Interface. It follows the Python DB-API 2.0 connection and cursor conventions and adds executeany() for MongoQL and Cypher. Prism Query Interface · Python DB-API 2.0 · Cursor reference
Installation
Use Python 3.9 or later. Install connector 2.1.0 from PyPI for SQL, MongoQL, and Cypher.
python -m pip install polypheny==2.1.0
polypheny is both the package name and the name to import. Connector 2.1.0 installs polypheny-prism-api==2.3 as a dependency. Release files and requirements
Server compatibility
Enable the Prism Query Interface on the server. The connector uses the server’s compatibility response during the Prism handshake. SQL and MongoQL also work with compatible earlier Prism 2.x servers. Document collection metadata requires server support introduced with Prism 2.2. Prism Query Interface
Cypher requires a server with Prism graph support and the Cypher language enabled. Mixed graph and scalar projections require Prism 2.3. Cypher and Graph Results
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.
- Run the Cypher example to read graph elements and typed graph values in tabular rows. Python integration guide