# Peasys Python Library
The Peasys Python library provides convenient tools for interacting with the Peasys service.
## Documentation
See the [Python API docs](https://dips400.com/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:
```sh
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](https://dips400.com) 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](https://dips400.com/account).
```python
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.
```python
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.
```python
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](https://dips400.com/docs) 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/dips400/peasys-python",
"name": "peasys",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "ibm db2 peasys",
"author": "DIPS",
"author_email": "dips@dips400.com",
"download_url": "https://files.pythonhosted.org/packages/98/1f/290dad61060a27d14d3c54c73f26f049f5d398f8ca3c49e0b1e63a8cb9f6/peasys-1.0.2.tar.gz",
"platform": null,
"description": "# Peasys Python Library\r\n\r\nThe Peasys Python library provides convenient tools for interacting with the Peasys service.\r\n\r\n## Documentation\r\n\r\nSee the [Python API docs](https://dips400.com/docs).\r\n\r\n## Installation\r\n\r\nYou don't need this source code unless you want to modify the package. If you just\r\nwant to use the package, just run:\r\n\r\n```sh\r\npip install --upgrade peasys\r\n```\r\n\r\n### Requirements\r\n\r\n- Python 3.6+ (PyPy supported)\r\n\r\n## Usage\r\n\r\n### License key\r\nPeasys is a tool used along a license that should be found on the [dips400](https://dips400.com) website. This license key is required for the use of the service Peasys.\r\n\r\n### Connexion to the server\r\nPeasys authenticates API requests using your license key, which you can find in the [dashboard](https://dips400.com/account).\r\n\r\n```python\r\nfrom peasys import pea_client\r\n\r\nconn = pea_client.PeaClient(\"DNS_NAME\", \"PARTITION_NAME\", PORT, \"USERNAME\", \"PASSWORD\", \"ID_CLIENT\", True, False)\r\n```\r\n\r\n### Query the DB2\r\nFor example, use the ExecuteCreate method of the PeaClient class in order to create a a new table in the database.\r\n\r\n```python\r\ncreate_response = conn.execute_create(\"CREATE TABLE schema_table/table_name (name CHAR(10), age INT)\")\r\nprint(create_response.returnedSQLMessage)\r\nprint(create_response.returnedSQLState)\r\n```\r\n\r\n### Deconnexion\r\n\r\nIt is important to always disconnect from the server after you used the connexion.\r\n\r\n```python\r\nconn.disconnect()\r\n```\r\n\r\n### Handling exceptions\r\n\r\nUnsuccessful requests raise exceptions. The class of the exception will reflect\r\nthe sort of error that occurred. Please see the [documentation](https://dips400.com/docs) for a description of\r\nthe error classes you should handle, and for information on how to inspect\r\nthese errors.\r\n\r\n## Support\r\n\r\nNew features and bug fixes are released on the latest major version of the Peasys Python library. If you are on an older major version, \r\nwe recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. \r\nOlder major versions of the package will continue to be available for use, but will not be receiving any updates.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A clear and concise python client for IBM Db2 and peasys service",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/dips400/peasys-python"
},
"split_keywords": [
"ibm",
"db2",
"peasys"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "981f290dad61060a27d14d3c54c73f26f049f5d398f8ca3c49e0b1e63a8cb9f6",
"md5": "50350b9da8e526bea6988ea5718f8f3a",
"sha256": "dddc45a300437cbed0d1e5664e33dd9f6d037411342745058654c5e3f5850112"
},
"downloads": -1,
"filename": "peasys-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "50350b9da8e526bea6988ea5718f8f3a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10473,
"upload_time": "2024-07-15T12:41:36",
"upload_time_iso_8601": "2024-07-15T12:41:36.502513Z",
"url": "https://files.pythonhosted.org/packages/98/1f/290dad61060a27d14d3c54c73f26f049f5d398f8ca3c49e0b1e63a8cb9f6/peasys-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-15 12:41:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dips400",
"github_project": "peasys-python",
"github_not_found": true,
"lcname": "peasys"
}