{"id":20237433,"url":"https://github.com/qualisystems/cloudshell-shell-core","last_synced_at":"2025-04-10T19:12:06.023Z","repository":{"id":45294674,"uuid":"51309179","full_name":"QualiSystems/cloudshell-shell-core","owner":"QualiSystems","description":"Basic classes, helpers and interfaces for developing a CloudShell Shell","archived":false,"fork":false,"pushed_at":"2023-10-25T14:12:29.000Z","size":394,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-03T14:12:19.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.quali.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QualiSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-02-08T16:19:48.000Z","updated_at":"2024-08-15T17:35:16.000Z","dependencies_parsed_at":"2024-11-14T08:37:34.655Z","dependency_job_id":null,"html_url":"https://github.com/QualiSystems/cloudshell-shell-core","commit_stats":{"total_commits":242,"total_committers":17,"mean_commits":"14.235294117647058","dds":0.7396694214876033,"last_synced_commit":"0591a8328eed082b1ce9646ebfd7f2f12b3efbf9"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QualiSystems%2Fcloudshell-shell-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QualiSystems%2Fcloudshell-shell-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QualiSystems%2Fcloudshell-shell-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QualiSystems%2Fcloudshell-shell-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QualiSystems","download_url":"https://codeload.github.com/QualiSystems/cloudshell-shell-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248279806,"owners_count":21077408,"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":"2024-11-14T08:26:57.634Z","updated_at":"2025-04-10T19:12:05.996Z","avatar_url":"https://github.com/QualiSystems.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CloudShell Shell Core\n\n[![Build status](https://github.com/QualiSystems/cloudshell-shell-core/workflows/CI/badge.svg?branch=master)](https://github.com/QualiSystems/cloudshell-shell-core/actions?query=branch%3Amaster)\n[![codecov](https://codecov.io/gh/QualiSystems/cloudshell-shell-core/branch/master/graph/badge.svg)](https://codecov.io/gh/QualiSystems/cloudshell-shell-core)\n[![PyPI version](https://badge.fury.io/py/cloudshell-shell-core.svg)](https://badge.fury.io/py/cloudshell-shell-core)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n\n## Overview\n\nThe **cloudshell-shell-core** open source Python package is the base package for all CloudShell shells. It provides basic shell functionality including:\n- Resource driver interface, which enables CloudShell to use the shell. This interface is automatically added to the shell’s driver when creating a shell via shellfoundry.\n- Definitions of the driver’s context objects, which CloudShell sends to the shell’s commands. For details, see the CloudShell Dev Guide's [Getting information from cloudshell](https://devguide.quali.com/shells/9.3.0/getting-information-from-cloudshell.html)\n- [cloudshell-automation-api](https://help.quali.com/Online%20Help/0.0/Python-API/) wrapper. Use of the CloudShell Automation API mostly applies to setting live status and writing messages to output. Other API capabilities are outside the scope of the shell and should be implemented on the sandbox orchestration level,\n- [cloudshell-logging](https://github.com/QualiSystems/cloudshell-logging/blob/dev/README.md) wrapper\n\n## Installation\n```bash\npip install cloudshell-shell-core\n```\n\n**_Python 3 is supported starting with version 5.0.x._**\n\n## Implementation Examples\n\n**Driver’s interface - declaring the driver’s interface for shell 'DataModelExample':**\n```python\nfrom cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface\nclass DataModelExampleDriver (ResourceDriverInterface):\n```\n#### Api wrapper - returning api session:\n```python\nfrom cloudshell.shell.core.session.cloudshell_session import CloudShellSessionContext\nwith CloudShellSessionContext(context) as session:\n    perform_validations(session)\n    do_some_logic(session)\n    do_some_more_logic(session)\n```\n#### Logging wrapper - how to use the logger:\n```python\nfrom cloudshell.shell.core.session.logging_session import LoggingSessionContext \nwith LoggingSessionContext(context) as logger:\n    do_something(logger)\n    do something_else(logger)\n```\nor\n```python\nfrom cloudshell.shell.core.session.logging_session import LoggingSessionContext \nlogger = LoggingSessionContext.get_logger_with_thread_id(context)\ndo_something(logger)\n```\n\n#### Driver Context:\n\nThe driver context objects are extensively documented in the CloudShell Developer Guide's [Getting Information from CloudShell](https://devguide.quali.com/shells/9.3.0/getting-information-from-cloudshell.html) article. We recommend checking the most up to date version as we periodically update the CloudShell Developer Guide.\n\n\nWe use tox and pre-commit for testing. [Services description](https://github.com/QualiSystems/cloudshell-package-repo-template#description-of-services)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqualisystems%2Fcloudshell-shell-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqualisystems%2Fcloudshell-shell-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqualisystems%2Fcloudshell-shell-core/lists"}