GitHub

GitHub is a github resource plugin for pydolphinscheduler.

When using a github resource plugin, you only need to add the resource_plugin parameter in the task subclass or workflow definition, such as resource_plugin=GitHub(prefix=”https://github.com/xxx”, access_token=”ghpxx”). The token parameter is optional. You need to add it when your repository is a private repository.

You can view this document when creating a token.

For the specific use of resource plugins, you can see How to use in ResourcePlugin

Dive Into

DolphinScheduler github resource plugin.

class pydolphinscheduler.resources_plugin.github.GitHub(prefix: str, access_token: str | None = None, *args, **kwargs)[source]

Bases: ResourcePlugin, Git

GitHub resource plugin, a plugin for task and workflow to dolphinscheduler to read resource.

Parameters:
  • prefix – A string representing the prefix of GitHub.

  • access_token – A string used for identity authentication of GitHub private repository.

build_req_api(user: str, repo_name: str, file_path: str, api: str)[source]

Build request file content API.

get_git_file_info(path: str)[source]

Get file information from the file url, like repository name, user, branch, and file path.

get_req_url()[source]

Build request URL according to file information.

read_file(suf: str)[source]

Get the content of the file.

The address of the file is the prefix of the resource plugin plus the parameter suf.

req(path: str)[source]

Send HTTP request, parse response data, and get file content.

_abc_impl = <_abc._abc_data object>
_git_file_info: GitHubFileInfo | None = None