PyGithub Programming Model: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=
* [[Python_Package_PyGithub#Subjects|PyGithub]]
* [[Python_Package_PyGithub#Subjects|PyGithub]]
=Authentication=
=Turn on Debugging=
Various authentication mechanism are invoked by appropriately configuring the main <code>[[PyGithub_Concepts#Github|Github]]</code> class.
==Authentication with Personal Access Token (PAT)==
<syntaxhighlight lang='py'>
<syntaxhighlight lang='py'>
github_pat = os.environ.get('GITHUB_PAT')
from github import enable_console_debug_logging
if not github_pat:
 
    raise ValueError("'GITHUB_PAT' not found in environment")
enable_console_debug_logging()
host_url = 'https://github.pie.apple.com'
api_endpoint = 'api/v3'
base_url = f'{host_url}/{api_endpoint}'
github = Github(base_url=f'{base_url}', login_or_token=github_pat)
</syntaxhighlight>
</syntaxhighlight>
==Authentication with Username and Password==
==Authentication with JWT==
=Configuring Retry=

Latest revision as of 01:50, 16 May 2023

Internal

Turn on Debugging

from github import enable_console_debug_logging

enable_console_debug_logging()