{"id":25257243,"url":"https://github.com/zowe/zowe-client-python-sdk","last_synced_at":"2025-04-05T11:08:06.856Z","repository":{"id":37084237,"uuid":"248779346","full_name":"zowe/zowe-client-python-sdk","owner":"zowe","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-28T19:29:46.000Z","size":2210,"stargazers_count":40,"open_issues_count":17,"forks_count":28,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-11-06T09:08:37.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zowe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-20T14:45:12.000Z","updated_at":"2024-10-28T19:39:48.000Z","dependencies_parsed_at":"2023-10-02T17:21:49.721Z","dependency_job_id":"958f1e78-1101-4f38-b817-6e4fb1002eca","html_url":"https://github.com/zowe/zowe-client-python-sdk","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fzowe-client-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fzowe-client-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fzowe-client-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zowe%2Fzowe-client-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zowe","download_url":"https://codeload.github.com/zowe/zowe-client-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-12T06:38:26.154Z","updated_at":"2025-04-05T11:08:06.826Z","avatar_url":"https://github.com/zowe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zowe Client Python SDK\n\n![](https://img.shields.io/badge/license-EPL--2.0-blue) [![Latest Release](https://img.shields.io/github/v/release/zowe/zowe-client-python-sdk)](https://github.com/zowe/zowe-client-python-sdk/releases/latest) [![Documentation Status](https://readthedocs.org/projects/zowe-client-python-sdk/badge/?version=latest)](https://zowe-client-python-sdk.readthedocs.io/en/latest/index.html)\n\nThe Zowe Client Python SDK, is a set of Python packages designed to allow programmatic\ninteractions with z/OS REST API interfaces with minimal effort.\n\nPython developers can leverage the Zowe SDK in order to create powerful scripts/applications\nthat can interact with z/OS components.\n\n![](./img/zowesdk.gif)\n\n## Installation\n\nWhen installing the Zowe Client Python SDK, you have two options:\n\n- Install all the Zowe packages\n- Install a single sub-package\n\nThe choice depends on your intentions. If you choose to install all Zowe SDK packages,\nthis means that you will install everything under the `zowe` namespace in PyPi.\n\nAlternatively, you can choose to install only a single subpackage for a smaller installation.\n\nTo install all Zowe SDK packages using pip:\n\n```\npip install -U --pre zowe-python-sdk-bundle\n```\n\nOr, to install a subpackage using pip:\n\n```\npip install -U --pre zowe.\u003csubpackage\u003e_for_zowe_sdk\n```\n\nFor more information on the available sub-packages click [HERE](https://zowe-client-python-sdk.readthedocs.io/en/latest/packages/packages.html)\n\n\u003c!--\n    **Note**: If you want to stay on the bleeding edge, install the Zowe SDK from the `main` branch with the following command:\n    ```\n    pip install zowe@git+https://github.com/zowe/zowe-client-python-sdk@main#subdirectory=src\n    ```\n--\u003e\n\n## Requirements\n\nThe Zowe core package has dependencies on the packages listed below:\n\n```\ncommentjson\ndeepmerge\njsonschema\npyyaml\nrequests\u003e=2.22\nurllib3\n```\n\nIt also has an optional dependency on the Zowe Secrets SDK for storing client secrets which can be installed with the `secrets` extra:\n\n```\npip install -U --pre zowe.core-for-zowe-sdk[secrets]\n```\n\n### Developer setup\n\nEnsure the following prerequisites are installed and on your PATH:\n\n- Python \u003e= 3.9 and `pip`\n- Cargo \u003e= 1.72 (to build Rust bindings for Secrets SDK)\n- Visual Studio Build Tools \u003e= 2015 (Windows only)\n\nClone the repository using `git`:\n\n```\ngit clone https://github.com/zowe/zowe-client-python-sdk.git\n```\n\nNavigate to the root of the repository and checkout the desired branch. Currently, active development is on the `main` branch:\n\n```\ncd zowe-client-python-sdk/\ngit checkout main\n```\n\nWe recommend that developers make a virtual environment to install all required dependencies.\n\nCreate a virtual environment in the root of the repository folder using the `venv` module.\nThe command below assumes that `python` is a version of Python3:\n\n```\npython -m venv venv\n```\n\n_(If this isn't the case for your environment, use the appropriate command alias for Python3)_\n\nActivate your virtual environment so that Python uses it to manage dependencies.\nAssuming that you are using Bash shell, reference the command below:\n\n```\nsource venv/bin/activate\n```\n\nOtherwise, check the table titled \"Command to activate virtual environment\" [here](https://docs.python.org/3/library/venv.html#how-venvs-work) to find the command that works for your shell.\n\nInstall the dependencies listed in `requirements.txt` using `pip`:\n\n```\npip install -r requirements.txt\n```\n\nYou can now develop the Python SDK with the installed dependencies.\nWhen you are finished with your development session, deactivate your virtual environment:\n\n```\ndeactivate\n```\n\n## Quickstart\n\nAfter you install the package in your project, import the class for the required sub-package (i.e `Console` class for z/OS Console commands).\nCreate a dictionary to handle communication with the plug-in:\n\n```python\n    from zowe.zos_console_for_zowe_sdk import Console\n    profile = {\n        \"host\": \"example.com\",\n        \"port\": 443,\n        \"user\": \"\u003cuser\u003e\",\n        \"password\": \"\u003cpassword\u003e\"\n    }\n\n    my_console = Console(profile)\n```\n\nAlternatively, you can use an existing Zowe CLI profile instead:\n\n```python\n    from zowe.core_for_zowe_sdk import ProfileManager\n    from zowe.zos_console_for_zowe_sdk import Console\n\n    profile = ProfileManager().load(profile_type=\"zosmf\")\n    my_console = Console(profile)\n```\n\n**Important**: If your z/OSMF profile uses a credentials manager, this approach may not work depending on your operating system. Support for loading secure profiles has only been tested on Windows and Ubuntu so far.\n\n# Available options\n\nCurrently, the Zowe Python SDK supports the following interfaces:\n\n- Console commands\n- z/OSMF Information retrieval\n- Submit job from a dataset\n- Submit job from local file\n- Submit job as plain text JCL\n- Retrieve job status\n- Retrieve job list from JES spool\n- Start/End TSO address space\n- Ping TSO address space\n- Issue TSO command\n\n**Important**: Notice that the below examples assume that you have already created\nan object for the sub-package of your preference just like in the quickstart example.\n\n## Console\n\nUsage of the console api:\n\n```python\nresult = my_console.issue_command(\"\u003ccommand\u003e\")\n```\n\nThe result will be a JSON object containing the result from the console command.\n\n## Job\n\nTo retrieve the status of a job on JES\n\n```python\nresult = my_jobs.get_job_status(\"\u003cjobname\u003e\", \"\u003cjobid\u003e\")\n```\n\nTo retrieve list of jobs in JES spool\n\n```python\nresult = my_jobs.list_jobs(owner=\"\u003cuser\u003e\", prefix=\"\u003cjob-prefix\u003e\")\n```\n\nAdditional parameters available are:\n\n- max_jobs\n- user_correlator\n\nTo submit a job from a dataset:\n\n```python\nresult = my_jobs.submit_from_mainframe(\"\u003cdataset-name\u003e\")\n```\n\nTo submit a job from a local file:\n\n```python\nresult = my_jobs.submit_from_local_file(\"\u003cfile-path\u003e\")\n```\n\nTo submit from plain text:\n\n```python\njcl = '''\n//IEFBR14Q JOB (AUTOMATION),CLASS=A,MSGCLASS=0,\n//             MSGLEVEL=(1,1),REGION=0M,NOTIFY=\u0026SYSUID\n//STEP1    EXEC PGM=IEFBR14\n'''\n\nresult = my_jobs.submit_from_plaintext(jcl)\n\n```\n\n## TSO\n\nStarting a TSO address space\n\n```python\n\nsession_parameters = {\n     'proc': 'IZUFPROC',\n     'chset': '697',\n     'cpage': '1047',\n     'rows': '204',\n     'cols': '160',\n     'rsize': '4096',\n     'acct': 'DEFAULT'\n}\n\nsession_key = my_tso.start_tso_session(**session_parameters)\n```\n\nIf you don't provide any session parameter ZoweSDK will attempt to start a session with default parameters.\n\nTo end a TSO address space\n\n```python\nmy_tso.end_tso_session(\"\u003csession-key\u003e\")\n```\n\nIn order to issue a TSO command\n\n```python\ntso_output  =  my_tso.issue_command(\"\u003ctso-command\u003e\")\n```\n\n## z/OSMF\n\nUsage of the z/OSMF api\n\n```python\nresult = my_zosmf.get_info()\n```\n\nThe result will be a JSON object containing z/OSMF information\n\n# Acknowledgments\n\n- Make sure to check out the [Zowe project](https://github.com/zowe)!\n- For further information on z/OSMF REST API, click [HERE](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.izua700/IZUHPINFO_RESTServices.htm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzowe%2Fzowe-client-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzowe%2Fzowe-client-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzowe%2Fzowe-client-python-sdk/lists"}