Skip to content

Python implementation of the client side in the Peasys technology

License

Notifications You must be signed in to change notification settings

dips400/peasys-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peasys Python Library

The Peasys Python library provides convenient tools for interacting with the Peasys service.

Documentation

See the Python API docs.

Installation

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

Requirements

  • Python 3.6+ (PyPy supported)

Usage

License key

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.

Connexion to the server

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)

Query the DB2

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)

Deconnexion

It is important to always disconnect from the server after you used the connexion.

conn.disconnect()

Handling exceptions

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.

Support

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.

About

Python implementation of the client side in the Peasys technology

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages