Skip to main content

A clear and concise python client for IBM Db2 and peasys service

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peasys-1.0.2.tar.gz (10.5 kB view details)

Uploaded Source

File details

Details for the file peasys-1.0.2.tar.gz.

File metadata

  • Download URL: peasys-1.0.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for peasys-1.0.2.tar.gz
Algorithm Hash digest
SHA256 dddc45a300437cbed0d1e5664e33dd9f6d037411342745058654c5e3f5850112
MD5 50350b9da8e526bea6988ea5718f8f3a
BLAKE2b-256 981f290dad61060a27d14d3c54c73f26f049f5d398f8ca3c49e0b1e63a8cb9f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page