ghtrack package

Submodules

ghtrack.CommandLineUtil module

class ghtrack.CommandLineUtil.CommandLineUtil

Bases: object

static main()

Starting point for the program execution.

ghtrack.EmailHandler module

class ghtrack.EmailHandler.EmailHandler(filename: Optional[str] = None, emailConf: ghtrack.GhTrackObject.EmailConf = EmailConf(to='zinalacina@gmail.com', subject='Pull request Test', sendGridApi='', fromEmail='zlacina@gmail.com'), repoConf: ghtrack.GhTrackObject.Repo = Repo(user='kubernetes', repo='kubernetes'), authToken: ghtrack.GhTrackObject.Auth = Auth(token=''))

Bases: ghtrack.GhTrackObject.GhTrackObject

EmailHandler is use to send email through twilio.

sendEmail(content: str) tuple

ghtrack.GhTrack module

class ghtrack.GhTrack.GhTrack(file_name=None, token=None, email=None, user=None, repo=None)

Bases: ghtrack.GhTrackObject.GhTrackObject

Class to pull down the pull request of a github public repositories for a user.

getPull(number)
getPulls()
getPullsByStatus(status: str)
getRepo()
sendEmailOrPrintConsole(emailNotConsole: bool = False) str
setAge(age: int)

ghtrack.GhTrackException module

exception ghtrack.GhTrackException.BadUserException(status, data, headers)

Bases: ghtrack.GhTrackException.GhTrackException

BadUserException is raised when request the user which repos you try to pull does not exist.

exception ghtrack.GhTrackException.GhTrackException(status, data, headers)

Bases: Exception

This class contains all the possible exceptions that you can encounter during the execution of this project.

property data

The data returned by the Github API

property headers

The headers returned by the Github API

property status

The status returned by the Github API

exception ghtrack.GhTrackException.NotFoundException(status, data, headers)

Bases: ghtrack.GhTrackException.GhTrackException

NotFoundException is raised when Github API return 404 status

exception ghtrack.GhTrackException.RateLimitExceededException(status, data, headers)

Bases: ghtrack.GhTrackException.GhTrackException

RateLimitExceededException is raised when the rate limit is exceeded github replies with 403

exception ghtrack.GhTrackException.RepoNotFoundException(status, data, headers)

Bases: ghtrack.GhTrackException.GhTrackException

RepoNotFoundException is raised when Github can not find the public repo

exception ghtrack.GhTrackException.UnknownApiQueryException(status, data, headers)

Bases: ghtrack.GhTrackException.GhTrackException

UnknownApiQueryException is raised when Github can not find the public repo

ghtrack.GhTrackObject module

class ghtrack.GhTrackObject.Auth(token: str = '')

Bases: object

Auth class. Github token configurations.

token: str = ''
class ghtrack.GhTrackObject.EmailConf(to: str = 'zinalacina@gmail.com', subject: str = 'Pull request Test', sendGridApi: str = '', fromEmail: str = 'zlacina@gmail.com')

Bases: object

EmailConf class. Email configurations.

fromEmail: str = 'zlacina@gmail.com'
sendGridApi: str = ''
subject: str = 'Pull request Test'
to: str = 'zinalacina@gmail.com'
class ghtrack.GhTrackObject.GhTrackObject(filename: Optional[str] = None, emailConf: ghtrack.GhTrackObject.EmailConf = EmailConf(to='zinalacina@gmail.com', subject='Pull request Test', sendGridApi='', fromEmail='zlacina@gmail.com'), repoConf: ghtrack.GhTrackObject.Repo = Repo(user='kubernetes', repo='kubernetes'), authToken: ghtrack.GhTrackObject.Auth = Auth(token=''))

Bases: object

GhTrackObject class. Contents the configuration information coming from data/config.yml and also default value.

authToken: ghtrack.GhTrackObject.Auth = Auth(token='')
emailConf: ghtrack.GhTrackObject.EmailConf = EmailConf(to='zinalacina@gmail.com', subject='Pull request Test', sendGridApi='', fromEmail='zlacina@gmail.com')
filename: str = None
getConf(file_name: str) -> (<class 'ghtrack.GhTrackObject.EmailConf'>, <class 'ghtrack.GhTrackObject.Repo'>, <class 'ghtrack.GhTrackObject.Auth'>)
repoConf: ghtrack.GhTrackObject.Repo = Repo(user='kubernetes', repo='kubernetes')
class ghtrack.GhTrackObject.Repo(user: str = 'kubernetes', repo: str = 'kubernetes')

Bases: object

Repo class. Public repo setting.

repo: str = 'kubernetes'
user: str = 'kubernetes'

ghtrack.RequestInit module

class ghtrack.RequestInit.RequestInit(token, apiUrl='https://api.github.com/repos/')

Bases: object

This class initialize the requests object with default and required values

dataRequest(url, parameters=None, body='', old: int = 7)
getCompleteUrl(url, parameters=None)
getToken()
statusRequest(url, parameters, input)

ghtrack.Util module

class ghtrack.Util.Util

Bases: object

static isOpenOrClose(state: str) bool
static is_not_blank(s) bool
static oneWeekOld(postDate: str, old: int = 7) bool

Module contents