:py:mod:`vendor_fabric.github` ============================== .. py:module:: vendor_fabric.github .. autodoc2-docstring:: vendor_fabric.github :parser: myst :allowtitles: Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 vendor_fabric.github.tools Package Contents ---------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`GitHubConnector ` - .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector :parser: myst :summary: Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`get_github_api_error ` - .. autodoc2-docstring:: vendor_fabric.github.get_github_api_error :parser: myst :summary: * - :py:obj:`build_github_actions_workflow ` - .. autodoc2-docstring:: vendor_fabric.github.build_github_actions_workflow :parser: myst :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`Auth ` - .. autodoc2-docstring:: vendor_fabric.github.Auth :parser: myst :summary: * - :py:obj:`Github ` - .. autodoc2-docstring:: vendor_fabric.github.Github :parser: myst :summary: * - :py:obj:`GraphqlClient ` - .. autodoc2-docstring:: vendor_fabric.github.GraphqlClient :parser: myst :summary: * - :py:obj:`GithubException ` - .. autodoc2-docstring:: vendor_fabric.github.GithubException :parser: myst :summary: * - :py:obj:`UnknownObjectException ` - .. autodoc2-docstring:: vendor_fabric.github.UnknownObjectException :parser: myst :summary: * - :py:obj:`FilePath ` - .. autodoc2-docstring:: vendor_fabric.github.FilePath :parser: myst :summary: * - :py:obj:`DEFAULT_PER_PAGE ` - .. autodoc2-docstring:: vendor_fabric.github.DEFAULT_PER_PAGE :parser: myst :summary: API ~~~ .. py:data:: Auth :canonical: vendor_fabric.github.Auth :type: typing.Any :value: None .. autodoc2-docstring:: vendor_fabric.github.Auth :parser: myst .. py:data:: Github :canonical: vendor_fabric.github.Github :type: typing.Any :value: None .. autodoc2-docstring:: vendor_fabric.github.Github :parser: myst .. py:data:: GraphqlClient :canonical: vendor_fabric.github.GraphqlClient :type: typing.Any :value: None .. autodoc2-docstring:: vendor_fabric.github.GraphqlClient :parser: myst .. py:exception:: GitHubFallbackError() :canonical: vendor_fabric.github.GitHubFallbackError Bases: :py:obj:`Exception` .. autodoc2-docstring:: vendor_fabric.github.GitHubFallbackError :parser: myst .. rubric:: Initialization .. autodoc2-docstring:: vendor_fabric.github.GitHubFallbackError.__init__ :parser: myst .. py:method:: add_note() :canonical: vendor_fabric.github.GitHubFallbackError.add_note .. py:class:: args :canonical: vendor_fabric.github.GitHubFallbackError.args .. py:method:: with_traceback() :canonical: vendor_fabric.github.GitHubFallbackError.with_traceback .. py:data:: GithubException :canonical: vendor_fabric.github.GithubException :type: typing.Any :value: None .. autodoc2-docstring:: vendor_fabric.github.GithubException :parser: myst .. py:data:: UnknownObjectException :canonical: vendor_fabric.github.UnknownObjectException :type: typing.Any :value: None .. autodoc2-docstring:: vendor_fabric.github.UnknownObjectException :parser: myst .. py:data:: FilePath :canonical: vendor_fabric.github.FilePath :value: None .. autodoc2-docstring:: vendor_fabric.github.FilePath :parser: myst .. py:function:: get_github_api_error(exc: BaseException) -> str | None :canonical: vendor_fabric.github.get_github_api_error .. autodoc2-docstring:: vendor_fabric.github.get_github_api_error :parser: myst .. py:data:: DEFAULT_PER_PAGE :canonical: vendor_fabric.github.DEFAULT_PER_PAGE :value: 100 .. autodoc2-docstring:: vendor_fabric.github.DEFAULT_PER_PAGE :parser: myst .. py:class:: GitHubConnector(github_owner: str, github_repo: str | None = None, github_branch: str | None = None, github_token: str | None = None, per_page: int = DEFAULT_PER_PAGE, logger: extended_data.logging.Logging | None = None, **kwargs: typing.Any) :canonical: vendor_fabric.github.GitHubConnector Bases: :py:obj:`vendor_fabric.base.ConnectorBase` .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector :parser: myst .. rubric:: Initialization .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.__init__ :parser: myst .. py:method:: get_repository_branch(branch_name: str) -> typing.Any | None :canonical: vendor_fabric.github.GitHubConnector.get_repository_branch .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.get_repository_branch :parser: myst .. py:method:: create_repository_branch(branch_name: str, parent_branch: str | None = None) -> typing.Any | None :canonical: vendor_fabric.github.GitHubConnector.create_repository_branch .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.create_repository_branch :parser: myst .. py:method:: get_repository_file(file_path: vendor_fabric.github.FilePath, decode: bool | None = True, return_sha: bool | None = False, return_path: bool | None = False, charset: str | None = 'utf-8', errors: str | None = 'strict', raise_on_not_found: bool = False) -> extended_data.containers.ExtendedDict | extended_data.containers.ExtendedList[typing.Any] | extended_data.containers.ExtendedString | extended_data.containers.ExtendedTuple[typing.Any] | None :canonical: vendor_fabric.github.GitHubConnector.get_repository_file .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.get_repository_file :parser: myst .. py:method:: update_repository_file(file_path: vendor_fabric.github.FilePath, file_data: typing.Any, file_sha: str | None = None, msg: str | None = None, allow_encoding: bool | str | None = None, allow_empty: bool = False, **format_opts: typing.Any) -> typing.Any | None :canonical: vendor_fabric.github.GitHubConnector.update_repository_file .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.update_repository_file :parser: myst .. py:method:: delete_repository_file(file_path: vendor_fabric.github.FilePath, msg: str | None = None) -> typing.Any | None :canonical: vendor_fabric.github.GitHubConnector.delete_repository_file .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.delete_repository_file :parser: myst .. py:method:: list_org_members(role: str | None = None, include_pending: bool = False) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.list_org_members .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.list_org_members :parser: myst .. py:method:: get_org_member(username: str) -> extended_data.containers.ExtendedDict | None :canonical: vendor_fabric.github.GitHubConnector.get_org_member .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.get_org_member :parser: myst .. py:method:: list_repositories(type_filter: str = 'all', include_branches: bool = False) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.list_repositories .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.list_repositories :parser: myst .. py:method:: get_repository(repo_name: str) -> extended_data.containers.ExtendedDict | None :canonical: vendor_fabric.github.GitHubConnector.get_repository .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.get_repository :parser: myst .. py:method:: list_teams(include_members: bool = False, include_repos: bool = False) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.list_teams .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.list_teams :parser: myst .. py:method:: get_team(team_slug: str) -> extended_data.containers.ExtendedDict | None :canonical: vendor_fabric.github.GitHubConnector.get_team .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.get_team :parser: myst .. py:method:: add_team_member(team_slug: str, username: str, role: str = 'member') -> bool :canonical: vendor_fabric.github.GitHubConnector.add_team_member .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.add_team_member :parser: myst .. py:method:: remove_team_member(team_slug: str, username: str) -> bool :canonical: vendor_fabric.github.GitHubConnector.remove_team_member .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.remove_team_member :parser: myst .. py:method:: execute_graphql(query: str, variables: dict[str, typing.Any] | None = None) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.execute_graphql .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.execute_graphql :parser: myst .. py:method:: get_users_with_verified_emails(members: collections.abc.Mapping[str, collections.abc.Mapping[str, typing.Any]] | None = None, domain_filter: str | None = None) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.get_users_with_verified_emails .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.get_users_with_verified_emails :parser: myst .. py:method:: build_workflow(name: str, on: collections.abc.Mapping[str, typing.Any], jobs: collections.abc.Mapping[str, collections.abc.Mapping[str, typing.Any]], env: collections.abc.Mapping[str, str] | None = None, permissions: collections.abc.Mapping[str, str] | None = None, concurrency: collections.abc.Mapping[str, typing.Any] | None = None, defaults: collections.abc.Mapping[str, typing.Any] | None = None) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.build_workflow .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.build_workflow :parser: myst .. py:method:: build_workflow_job(runs_on: str = 'ubuntu-latest', steps: collections.abc.Sequence[collections.abc.Mapping[str, typing.Any]] | None = None, needs: collections.abc.Sequence[str] | None = None, if_condition: str | None = None, env: collections.abc.Mapping[str, str] | None = None, strategy: collections.abc.Mapping[str, typing.Any] | None = None, timeout_minutes: int | None = None, services: collections.abc.Mapping[str, typing.Any] | None = None, outputs: collections.abc.Mapping[str, str] | None = None) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.build_workflow_job .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.build_workflow_job :parser: myst .. py:method:: build_workflow_step(name: str, uses: str | None = None, run: str | None = None, with_params: collections.abc.Mapping[str, typing.Any] | None = None, env: collections.abc.Mapping[str, str] | None = None, if_condition: str | None = None, working_directory: str | None = None, shell: str | None = None, id: str | None = None) -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.build_workflow_step .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.build_workflow_step :parser: myst .. py:method:: create_python_ci_workflow(python_versions: list[str] | None = None, test_command: str = 'pytest', lint_command: str = 'ruff check', format_command: str | None = 'ruff format --check', install_command: str = 'uv sync --all-packages', working_directory: str = '.') -> extended_data.containers.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.create_python_ci_workflow .. autodoc2-docstring:: vendor_fabric.github.GitHubConnector.create_python_ci_workflow :parser: myst .. py:attribute:: BASE_URL :canonical: vendor_fabric.github.GitHubConnector.BASE_URL :type: typing.ClassVar[str] :value: .. py:attribute:: API_KEY_ENV :canonical: vendor_fabric.github.GitHubConnector.API_KEY_ENV :type: typing.ClassVar[str] :value: .. py:attribute:: CONNECTOR_CATEGORY :canonical: vendor_fabric.github.GitHubConnector.CONNECTOR_CATEGORY :type: typing.ClassVar[str] :value: 'external' .. py:attribute:: CONNECTOR_CAPABILITIES :canonical: vendor_fabric.github.GitHubConnector.CONNECTOR_CAPABILITIES :type: typing.ClassVar[tuple[str, ...]] :value: () .. py:attribute:: TIMEOUT :canonical: vendor_fabric.github.GitHubConnector.TIMEOUT :type: typing.ClassVar[float] :value: 300.0 .. py:attribute:: MIN_REQUEST_INTERVAL :canonical: vendor_fabric.github.GitHubConnector.MIN_REQUEST_INTERVAL :type: typing.ClassVar[float] :value: 0.0 .. py:attribute:: MAX_RETRIES :canonical: vendor_fabric.github.GitHubConnector.MAX_RETRIES :type: typing.ClassVar[int] :value: 5 .. py:property:: api_key :canonical: vendor_fabric.github.GitHubConnector.api_key :type: str .. py:property:: client :canonical: vendor_fabric.github.GitHubConnector.client :type: httpx.Client .. py:method:: close() -> None :canonical: vendor_fabric.github.GitHubConnector.close .. py:method:: request(method: str, endpoint: str, *, headers: dict[str, str] | None = None, **kwargs: typing.Any) -> httpx.Response :canonical: vendor_fabric.github.GitHubConnector.request .. py:method:: decode_response(response: httpx.Response, *, suffix: str | None = None, as_extended: bool = True) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.decode_response .. py:method:: decode_response_file(response: httpx.Response, *, source: str | None = None, suffix: str | None = None, as_extended: bool = True, metadata: collections.abc.Mapping[str, typing.Any] | None = None) -> extended_data.io.DataFile :canonical: vendor_fabric.github.GitHubConnector.decode_response_file .. py:method:: extend_result(value: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.extend_result .. py:method:: request_data(method: str, endpoint: str, *, headers: dict[str, str] | None = None, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.request_data .. py:method:: request_data_file(method: str, endpoint: str, *, headers: dict[str, str] | None = None, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.io.DataFile :canonical: vendor_fabric.github.GitHubConnector.request_data_file .. py:method:: request_workflow(method: str, endpoint: str, *, headers: dict[str, str] | None = None, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.workflows.DataWorkflow :canonical: vendor_fabric.github.GitHubConnector.request_workflow .. py:method:: get(endpoint: str, **kwargs: typing.Any) -> httpx.Response :canonical: vendor_fabric.github.GitHubConnector.get .. py:method:: get_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.get_data .. py:method:: get_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.workflows.DataWorkflow :canonical: vendor_fabric.github.GitHubConnector.get_workflow .. py:method:: post(endpoint: str, **kwargs: typing.Any) -> httpx.Response :canonical: vendor_fabric.github.GitHubConnector.post .. py:method:: post_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.post_data .. py:method:: post_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.workflows.DataWorkflow :canonical: vendor_fabric.github.GitHubConnector.post_workflow .. py:method:: put(endpoint: str, **kwargs: typing.Any) -> httpx.Response :canonical: vendor_fabric.github.GitHubConnector.put .. py:method:: put_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.put_data .. py:method:: put_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.workflows.DataWorkflow :canonical: vendor_fabric.github.GitHubConnector.put_workflow .. py:method:: delete(endpoint: str, **kwargs: typing.Any) -> httpx.Response :canonical: vendor_fabric.github.GitHubConnector.delete .. py:method:: delete_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.delete_data .. py:method:: delete_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.workflows.DataWorkflow :canonical: vendor_fabric.github.GitHubConnector.delete_workflow .. py:method:: patch(endpoint: str, **kwargs: typing.Any) -> httpx.Response :canonical: vendor_fabric.github.GitHubConnector.patch .. py:method:: patch_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.patch_data .. py:method:: patch_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: typing.Any) -> extended_data.workflows.DataWorkflow :canonical: vendor_fabric.github.GitHubConnector.patch_workflow .. py:method:: download(url: str, output_path: str) -> int :canonical: vendor_fabric.github.GitHubConnector.download .. py:attribute:: vendor_capabilities :canonical: vendor_fabric.github.GitHubConnector.vendor_capabilities :type: typing.ClassVar[dict[str, vendor_fabric.capabilities.CapabilitySpec]] :value: None .. py:attribute:: vendor_capability_methods :canonical: vendor_fabric.github.GitHubConnector.vendor_capability_methods :type: typing.ClassVar[dict[str, str]] :value: None .. py:method:: get_input(k: str, default: typing.Any | None = None, required: bool = False, is_bool: bool = False, is_integer: bool = False, is_float: bool = False, is_path: bool = False, is_datetime: bool = False, as_extended: bool = False) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.get_input .. py:method:: decode_input(k: str, default: typing.Any | None = None, required: bool = False, decode_from_json: bool = False, decode_from_yaml: bool = False, decode_from_base64: bool = False, allow_none: bool = True, as_extended: bool = False) -> typing.Any :canonical: vendor_fabric.github.GitHubConnector.decode_input .. py:method:: freeze_inputs() -> extended_data.containers.mappings.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.freeze_inputs .. py:method:: thaw_inputs() -> extended_data.containers.mappings.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.thaw_inputs .. py:method:: snapshot_inputs(*, frozen: bool = False) -> extended_data.containers.mappings.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.snapshot_inputs .. py:method:: replace_inputs(new_inputs: collections.abc.Mapping[str, typing.Any] | None, *, clear_frozen: bool = True) -> extended_data.containers.mappings.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.replace_inputs .. py:method:: merge_inputs(new_inputs: collections.abc.Mapping[str, typing.Any] | None) -> extended_data.containers.mappings.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.merge_inputs .. py:method:: shift_inputs() -> extended_data.containers.mappings.ExtendedDict :canonical: vendor_fabric.github.GitHubConnector.shift_inputs .. py:function:: build_github_actions_workflow(workflow_name: str, jobs: dict[str, typing.Any], concurrency_group: str | None = None, environment_variables: dict[str, str] | None = None, secrets: dict[str, str] | None = None, use_oidc_auth: bool = True, events: dict[str, typing.Any] | None = None, triggers: dict[str, typing.Any] | None = None, inputs: dict[str, typing.Any] | None = None, pull_requests: dict[str, typing.Any] | None = None) -> str :canonical: vendor_fabric.github.build_github_actions_workflow .. autodoc2-docstring:: vendor_fabric.github.build_github_actions_workflow :parser: myst