This enables Python programs to access Polypheny databases, using an API that is compliant with the Python Database API Specification v2.0 (PEP 249).
The recommended way to install the Python Connector for Polypheny is via pip:
pip install polypheny
Alternatively, if you prefer to install the package manually you can also download the latest release, extract the archive and install it manually:
cd /path/to/polyphney-connector-python-x.y.z/
python setup.py install
A few examples of the most common functionalities provided by the adapter:
import polypheny
# Connect to Polypheny
connection = polypheny.connect('localhost', 20591, user='pa', password='')
# Get a cursor
cursor = connection.cursor()
# Create a new table
cursor.execute("CREATE TABLE dummy (id INT NOT NULL, text VARCHAR(2), num INT, PRIMARY KEY(id))")
# Insert values into table
cursor.execute("INSERT INTO dummy VALUES (407 , 'de', 93)")
connection.commit()
# Execute a query
cursor.execute("SELECT * from dummy")
result = cursor.fetchall()
# Close the connection
connection.close()
An in-depth and more detailed documentation can be found here.
See the open issues for a list of proposed features (and known issues).
We highly welcome your contributions to the Polypheny Connector for Python. If you would like to contribute, please fork the repository and submit your changes as a pull request. Please consult our Admin Repository and our Website for guidelines and additional information.
Please note that we have a code of conduct. Please follow it in all your interactions with the project.
This work was influenced by the following projects:
The Apache 2.0 License