The Peasys Python library provides convenient tools for interacting with the Peasys service.
See the Python API docs.
You don't need this source code unless you want to modify the package. If you just want to use the package, just run:
pip install --upgrade peasys
- Python 3.6+ (PyPy supported)
Peasys is a tool used along a license that should be found on the dips400 website. This license key is required for the use of the service Peasys.
Peasys authenticates API requests using your license key, which you can find in the dashboard.
from peasys import pea_client
conn = pea_client.PeaClient("DNS_NAME", "PARTITION_NAME", PORT, "USERNAME", "PASSWORD", "ID_CLIENT", True, False)
For example, use the ExecuteCreate method of the PeaClient class in order to create a a new table in the database.
create_response = conn.execute_create("CREATE TABLE schema_table/table_name (name CHAR(10), age INT)")
print(create_response.returnedSQLMessage)
print(create_response.returnedSQLState)
It is important to always disconnect from the server after you used the connexion.
conn.disconnect()
Unsuccessful requests raise exceptions. The class of the exception will reflect the sort of error that occurred. Please see the documentation for a description of the error classes you should handle, and for information on how to inspect these errors.
New features and bug fixes are released on the latest major version of the Peasys Python library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.