[![Build Status](https://app.travis-ci.com/IBM/python-sdk-core.svg?branch=main)](https://app.travis-ci.com/IBM/python-sdk-core)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-cloud-sdk-core)](https://pypi.org/project/ibm-cloud-sdk-core/)
[![Latest Stable Version](https://img.shields.io/pypi/v/ibm-cloud-sdk-core.svg)](https://pypi.python.org/pypi/ibm-cloud-sdk-core)
[![CLA assistant](https://cla-assistant.io/readme/badge/ibm/python-sdk-core)](https://cla-assistant.io/ibm/python-sdk-core)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
# IBM Python SDK Core Version 3.22.0
This project contains core functionality required by Python code generated by the IBM Cloud OpenAPI SDK Generator
(openapi-sdkgen).
# Python Version
The current minimum Python version supported is 3.8.
## Installation
To install, use `pip`:
```bash
python -m pip install --upgrade ibm-cloud-sdk-core
```
## Authentication
The python-sdk-core project supports the following types of authentication:
- Basic Authentication
- Bearer Token Authentication
- Identity and Access Management (IAM) Authentication (grant type: apikey)
- Identity and Access Management (IAM) Authentication (grant type: assume)
- Container Authentication
- VPC Instance Authentication
- Cloud Pak for Data Authentication
- No Authentication (for testing)
For more information about the various authentication types and how to use them with your services, click [here](Authentication.md).
## Issues
If you encounter an issue with this project, you are welcome to submit a [bug report](https://github.com/IBM/python-sdk-core/issues).
Before opening a new issue, please search for similar issues. It's possible that someone has already reported it.
## Logging
This library uses Python's built-in `logging` module to perform logging of error,
warning, informational and debug messages.
The components within the SDK Core library use a single logger named `ibm-cloud-sdk-core`.
For complete information on the logging facility, please see: [Logging facility for Python](https://docs.python.org/3/library/logging.html).
### Enable logging
There are various ways to configure and enable the logging facility.
The code example below demonstrates a simple way to enable debug logging by invoking
the `logging.basicConfig()` function.
Note that, as a convenience, if you set the logging level to `DEBUG`, then HTTP request/response message logging
is also enabled.
The following code example shows how debug logging can be enabled:
```python
import logging
# Create a basic logging configuration that:
# 1. Defines a handler to display messages on the console.
# 2. Sets the root logger's logging level to DEBUG.
# 3. Sets the 'format' string used to display messages.
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(name)s:%(levelname)s] %(message)s', force=True)
```
When running your application, you should see output like this if debug logging is enabled:
```
2024-09-16 15:44:45,174 [ibm-cloud-sdk-core:DEBUG] Get authenticator from environment, key=global_search
2024-09-16 15:44:45,175 [ibm-cloud-sdk-core:DEBUG] Set service URL: https://api.global-search-tagging.cloud.ibm.com
2024-09-16 15:44:45,175 [ibm-cloud-sdk-core:DEBUG] Set User-Agent: ibm-python-sdk-core-3.22.0 os.name=Linux os.version=6.10.9-100.fc39.x86_64 python.version=3.12.5
2024-09-16 15:44:45,181 [ibm-cloud-sdk-core:DEBUG] Configuring BaseService instance with service name: global_search
2024-09-16 15:44:45,181 [ibm-cloud-sdk-core:DEBUG] Performing synchronous token fetch
2024-09-16 15:44:45,182 [ibm-cloud-sdk-core:DEBUG] Invoking IAM get_token operation: https://iam.cloud.ibm.com/identity/token
2024-09-16 15:44:45,182 [urllib3.connectionpool:DEBUG] Starting new HTTPS connection (1): iam.cloud.ibm.com:443
send: b'POST /identity/token HTTP/1.1\r\nHost: iam.cloud.ibm.com\r\nUser-Agent: ibm-python-sdk-core/iam-authenticator-3.22.0 os.name=Linux os.version=6.10.9-100.fc39.x86_64 python.version=3.12.5\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json\r\nConnection: keep-alive\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 135\r\n\r\n'
send: b'grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey&apikey=[redacted]&response_type=cloud_iam'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json
header: Content-Language: en-US
header: Content-Encoding: gzip
header: Date: Mon, 16 Sep 2024 20:44:45 GMT
header: Content-Length: 983
header: Connection: keep-alive
2024-09-16 15:44:45,670 [urllib3.connectionpool:DEBUG] https://iam.cloud.ibm.com:443 "POST /identity/token HTTP/11" 200 983
2024-09-16 15:44:45,672 [ibm-cloud-sdk-core:DEBUG] Returned from IAM get_token operation
2024-09-16 15:44:45,673 [ibm-cloud-sdk-core:DEBUG] Authenticated outbound request (type=iam)
2024-09-16 15:44:45,673 [ibm-cloud-sdk-core:DEBUG] Prepared request [POST https://api.global-search-tagging.cloud.ibm.com/v3/resources/search]
2024-09-16 15:44:45,673 [ibm-cloud-sdk-core:DEBUG] Sending HTTP request message
2024-09-16 15:44:45,674 [urllib3.connectionpool:DEBUG] Starting new HTTPS connection (1): api.global-search-tagging.cloud.ibm.com:443
send: b'POST /v3/resources/search?limit=1 HTTP/1.1\r\nHost: api.global-search-tagging.cloud.ibm.com\r\nUser-Agent: platform-services-python-sdk/0.57.0 (lang=python; os.name=Linux; os.version=6.10.9-100.fc39.x86_64; python.version=3.12.5)\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json\r\nConnection: keep-alive\r\ncontent-type: application/json\r\nAuthorization: [redacted]\r\nContent-Length: 39\r\n\r\n'
send: b'{"query": "GST-sdk-*", "fields": ["*"]}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json
header: Content-Length: 22
header: Date: Mon, 16 Sep 2024 20:44:46 GMT
header: Connection: keep-alive
2024-09-16 15:44:46,079 [urllib3.connectionpool:DEBUG] https://api.global-search-tagging.cloud.ibm.com:443 "POST /v3/resources/search?limit=1 HTTP/11" 200 22
2024-09-16 15:44:46,080 [ibm-cloud-sdk-core:DEBUG] Received HTTP response message, status code 200
```
## Open source @ IBM
Find more open source projects on the [IBM Github Page](http://github.com/IBM)
## License
This library is licensed under Apache 2.0. Full license text is
available in [LICENSE](LICENSE).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
Raw data
{
"_id": null,
"home_page": null,
"name": "ibm-cloud-sdk-core",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ibm, cloud, ibm cloud services",
"author": null,
"author_email": "IBM <devxsdk@us.ibm.com>",
"download_url": "https://files.pythonhosted.org/packages/4e/2d/730b09fdf054b31f37d5514ec0c5c9c521acad72cd25c7dbcd72998bf3f6/ibm_cloud_sdk_core-3.22.0.tar.gz",
"platform": null,
"description": "[![Build Status](https://app.travis-ci.com/IBM/python-sdk-core.svg?branch=main)](https://app.travis-ci.com/IBM/python-sdk-core)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-cloud-sdk-core)](https://pypi.org/project/ibm-cloud-sdk-core/)\n[![Latest Stable Version](https://img.shields.io/pypi/v/ibm-cloud-sdk-core.svg)](https://pypi.python.org/pypi/ibm-cloud-sdk-core)\n[![CLA assistant](https://cla-assistant.io/readme/badge/ibm/python-sdk-core)](https://cla-assistant.io/ibm/python-sdk-core)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n# IBM Python SDK Core Version 3.22.0\nThis project contains core functionality required by Python code generated by the IBM Cloud OpenAPI SDK Generator\n(openapi-sdkgen).\n\n# Python Version\nThe current minimum Python version supported is 3.8.\n\n## Installation\n\nTo install, use `pip`:\n\n```bash\npython -m pip install --upgrade ibm-cloud-sdk-core\n```\n\n## Authentication\nThe python-sdk-core project supports the following types of authentication:\n- Basic Authentication\n- Bearer Token Authentication\n- Identity and Access Management (IAM) Authentication (grant type: apikey)\n- Identity and Access Management (IAM) Authentication (grant type: assume)\n- Container Authentication\n- VPC Instance Authentication\n- Cloud Pak for Data Authentication\n- No Authentication (for testing)\n\nFor more information about the various authentication types and how to use them with your services, click [here](Authentication.md).\n\n## Issues\n\nIf you encounter an issue with this project, you are welcome to submit a [bug report](https://github.com/IBM/python-sdk-core/issues).\nBefore opening a new issue, please search for similar issues. It's possible that someone has already reported it.\n\n## Logging\n\nThis library uses Python's built-in `logging` module to perform logging of error,\nwarning, informational and debug messages.\nThe components within the SDK Core library use a single logger named `ibm-cloud-sdk-core`.\n\nFor complete information on the logging facility, please see: [Logging facility for Python](https://docs.python.org/3/library/logging.html).\n\n### Enable logging\n\nThere are various ways to configure and enable the logging facility.\n\nThe code example below demonstrates a simple way to enable debug logging by invoking\nthe `logging.basicConfig()` function.\n\nNote that, as a convenience, if you set the logging level to `DEBUG`, then HTTP request/response message logging\nis also enabled.\n\nThe following code example shows how debug logging can be enabled:\n```python\nimport logging\n\n# Create a basic logging configuration that:\n# 1. Defines a handler to display messages on the console.\n# 2. Sets the root logger's logging level to DEBUG.\n# 3. Sets the 'format' string used to display messages.\nlogging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(name)s:%(levelname)s] %(message)s', force=True)\n```\n\nWhen running your application, you should see output like this if debug logging is enabled:\n```\n2024-09-16 15:44:45,174 [ibm-cloud-sdk-core:DEBUG] Get authenticator from environment, key=global_search\n2024-09-16 15:44:45,175 [ibm-cloud-sdk-core:DEBUG] Set service URL: https://api.global-search-tagging.cloud.ibm.com\n2024-09-16 15:44:45,175 [ibm-cloud-sdk-core:DEBUG] Set User-Agent: ibm-python-sdk-core-3.22.0 os.name=Linux os.version=6.10.9-100.fc39.x86_64 python.version=3.12.5\n2024-09-16 15:44:45,181 [ibm-cloud-sdk-core:DEBUG] Configuring BaseService instance with service name: global_search\n2024-09-16 15:44:45,181 [ibm-cloud-sdk-core:DEBUG] Performing synchronous token fetch\n2024-09-16 15:44:45,182 [ibm-cloud-sdk-core:DEBUG] Invoking IAM get_token operation: https://iam.cloud.ibm.com/identity/token\n2024-09-16 15:44:45,182 [urllib3.connectionpool:DEBUG] Starting new HTTPS connection (1): iam.cloud.ibm.com:443\nsend: b'POST /identity/token HTTP/1.1\\r\\nHost: iam.cloud.ibm.com\\r\\nUser-Agent: ibm-python-sdk-core/iam-authenticator-3.22.0 os.name=Linux os.version=6.10.9-100.fc39.x86_64 python.version=3.12.5\\r\\nAccept-Encoding: gzip, deflate\\r\\nAccept: application/json\\r\\nConnection: keep-alive\\r\\nContent-Type: application/x-www-form-urlencoded\\r\\nContent-Length: 135\\r\\n\\r\\n'\nsend: b'grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey&apikey=[redacted]&response_type=cloud_iam'\nreply: 'HTTP/1.1 200 OK\\r\\n'\nheader: Content-Type: application/json\nheader: Content-Language: en-US\nheader: Content-Encoding: gzip\nheader: Date: Mon, 16 Sep 2024 20:44:45 GMT\nheader: Content-Length: 983\nheader: Connection: keep-alive\n2024-09-16 15:44:45,670 [urllib3.connectionpool:DEBUG] https://iam.cloud.ibm.com:443 \"POST /identity/token HTTP/11\" 200 983\n2024-09-16 15:44:45,672 [ibm-cloud-sdk-core:DEBUG] Returned from IAM get_token operation\n2024-09-16 15:44:45,673 [ibm-cloud-sdk-core:DEBUG] Authenticated outbound request (type=iam)\n2024-09-16 15:44:45,673 [ibm-cloud-sdk-core:DEBUG] Prepared request [POST https://api.global-search-tagging.cloud.ibm.com/v3/resources/search]\n2024-09-16 15:44:45,673 [ibm-cloud-sdk-core:DEBUG] Sending HTTP request message\n2024-09-16 15:44:45,674 [urllib3.connectionpool:DEBUG] Starting new HTTPS connection (1): api.global-search-tagging.cloud.ibm.com:443\nsend: b'POST /v3/resources/search?limit=1 HTTP/1.1\\r\\nHost: api.global-search-tagging.cloud.ibm.com\\r\\nUser-Agent: platform-services-python-sdk/0.57.0 (lang=python; os.name=Linux; os.version=6.10.9-100.fc39.x86_64; python.version=3.12.5)\\r\\nAccept-Encoding: gzip, deflate\\r\\nAccept: application/json\\r\\nConnection: keep-alive\\r\\ncontent-type: application/json\\r\\nAuthorization: [redacted]\\r\\nContent-Length: 39\\r\\n\\r\\n'\nsend: b'{\"query\": \"GST-sdk-*\", \"fields\": [\"*\"]}'\nreply: 'HTTP/1.1 200 OK\\r\\n'\nheader: Content-Type: application/json\nheader: Content-Length: 22\nheader: Date: Mon, 16 Sep 2024 20:44:46 GMT\nheader: Connection: keep-alive\n2024-09-16 15:44:46,079 [urllib3.connectionpool:DEBUG] https://api.global-search-tagging.cloud.ibm.com:443 \"POST /v3/resources/search?limit=1 HTTP/11\" 200 22\n2024-09-16 15:44:46,080 [ibm-cloud-sdk-core:DEBUG] Received HTTP response message, status code 200\n```\n\n## Open source @ IBM\n\nFind more open source projects on the [IBM Github Page](http://github.com/IBM)\n\n## License\n\nThis library is licensed under Apache 2.0. Full license text is\navailable in [LICENSE](LICENSE).\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n",
"bugtrack_url": null,
"license": null,
"summary": "Core library used by SDKs for IBM Cloud Services",
"version": "3.22.0",
"project_urls": {
"Changelog": "https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md",
"Contributing": "https://github.com/IBM/python-sdk-core/blob/main/CONTRIBUTING.md",
"Documentation": "https://github.com/IBM/python-sdk-core/blob/main/README.md",
"Issues": "https://github.com/IBM/python-sdk-core/issues",
"License": "https://github.com/IBM/python-sdk-core/blob/main/LICENSE",
"Repository": "https://github.com/IBM/python-sdk-core"
},
"split_keywords": [
"ibm",
" cloud",
" ibm cloud services"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "384258a3de2e87d0a6b81278dc600d06a74f8542ad86114ad6cc61555cf00352",
"md5": "e0f08a5378b86648f3aba3265ead1d94",
"sha256": "a86e9006d98f32510d47d4751d8ba04b64514e3c94b851511fd55d7b094c87b1"
},
"downloads": -1,
"filename": "ibm_cloud_sdk_core-3.22.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e0f08a5378b86648f3aba3265ead1d94",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 69432,
"upload_time": "2024-10-15T14:20:03",
"upload_time_iso_8601": "2024-10-15T14:20:03.158472Z",
"url": "https://files.pythonhosted.org/packages/38/42/58a3de2e87d0a6b81278dc600d06a74f8542ad86114ad6cc61555cf00352/ibm_cloud_sdk_core-3.22.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4e2d730b09fdf054b31f37d5514ec0c5c9c521acad72cd25c7dbcd72998bf3f6",
"md5": "035d7b1eabccf8028bacb9e0ec304ea5",
"sha256": "0aa5abc972b7d70ee4c39e3ad69c82c9717be847e5672928b416b8ea7d57a297"
},
"downloads": -1,
"filename": "ibm_cloud_sdk_core-3.22.0.tar.gz",
"has_sig": false,
"md5_digest": "035d7b1eabccf8028bacb9e0ec304ea5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 70647,
"upload_time": "2024-10-15T14:20:05",
"upload_time_iso_8601": "2024-10-15T14:20:05.013826Z",
"url": "https://files.pythonhosted.org/packages/4e/2d/730b09fdf054b31f37d5514ec0c5c9c521acad72cd25c7dbcd72998bf3f6/ibm_cloud_sdk_core-3.22.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-15 14:20:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "IBM",
"github_project": "python-sdk-core",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "ibm-cloud-sdk-core"
}