Skip to content

Organisation

NOTE: Intended instantiation via GitHubClient get_organisation method, rather than direct initialisation.

This class represents an Organisation within GitHub.

It may be used to perform actions within the context of the organisation.

Attributes:

Name Type Description
identifier int

Unique identifier of the organisation within GitHub

company str

The company associated with the organisation

repos_url str

RESTAPI endpoint for retrieval of repos in the organisation

client Session

Session used to make requests to the RESTAPI, intended to be passed in when instance is created via Client

base_url str

Base URL we should use for querying the RESTAPI within the context of the organisation

__eq__(other)

Parameters:

Name Type Description Default
other object

Object to compare against

required

Returns:

Type Description
bool

True if instances are equal, False otherwise.

__hash__()

Returns:

Type Description
int

Unique int representation of instance.

__str__()

Returns:

Type Description
str

Information string representation

get_repositories()

Examples:

get_repositories()

Returns:

Type Description
List[Repository]

All repositories within the organisation, empty if none found or instance otherwise doesn't have access to, or fails to query, the RESTAPI.

get_repository(name)

Parameters:

Name Type Description Default
name str

The name of the repository we are querying for

required

Examples:

get_repository('sudoblark.python.core')

Returns:

Type Description
Union[Repository, None]

Repository instance if found, else None