This topic provides instructions for installing the Polypheny Connector for Python. The connector can currently be installed in Linux, macOS, and Windows environments.
The developer notes are hosted on GitHub, along with the source code.
- Install the Connector
- Verify Your Installation
The following software packages are required to install the Polypheny Connector for Python.
The Polypheny Connector for Python requires Python 3.6 or higher.
To verify your version of Python:
Python Package Installer and Setup Tools
The Polypheny Connector for Python is installed by pip, a standard Python package installer and manager.
Use pip version 19.0 or later. Execute the following command to ensure the required version is installed:
python -m pip install --upgrade pip
Install the Connector
The Polypheny Connector for Python is available in PyPI. A change log is available on the site, so you can determine the changes that have been implemented in each release.
- Determine the version of the Polypheny Connector for Python that you plan to install.
- To install the connector, run the following command:
pip install poylpheny==<version>
where version is the version of the connector that you want to install.
If you want the latest version of the Connector, simply execute:
pip install poylpheny
Verify Your Installation
Create a file (e.g. validate.py) containing the following Python sample code, which connects to Polypheny and fetches some dummy information:
#!/usr/bin/env python import polypheny # Connect to Polypheny connection = polypheny.connect('<polypheny_host>', 20591, user='pa', password='') # Get a cursor cursor = connection.cursor() # Execute a query cursor.execute("SELECT * FROM emps") result = cursor.fetchall() print("Result Set: ", result) # Close the connection connection.close()
Before running the example:
with the DNS entry of your Polypheny-DB installation.
- If you’ve installed Polypheny-DB locally, use `localhost.
passwordwith the user name and password that you use to connect to Polypheny-DB.
Next, execute the sample code. For example, if you created a file named
You should receive an output similar to this:
Result Set: [[100, 10, 'Bill', 10000, 1000], [110, 10, 'Theodore', 11500, 250], [150, 20, 'Sebastian', 7000, 400], [200, 30, 'Eric', 8000, 500]]
Congratulations you have connected your application to Polypheny-DB!