Skip to content

models ¤

Sponsors management.

Classes:

Account dataclass ¤

Account(
    *,
    name: str,
    image: str | None = None,
    url: str | None = None,
    platform: SponsorshipPlatform,
    is_org: bool = False,
    sponsorships: list[Sponsorship] = list(),
    included: bool = False,
    excluded: bool = False
)

An account.

Attributes:

  • direct_sponsor (bool) –

    Return whether the account is a direct sponsor.

  • excluded (bool) –

    Indicates if the account is excluded from the sponsors list.

  • highest_tier (int) –

    Return the highest tier amount.

  • image (str | None) –

    The image URL of the account.

  • included (bool) –

    Indicates if the account is included in the sponsors list.

  • is_org (bool) –

    Indicates if the account is an organization.

  • is_user (bool) –

    Return whether the account is a user.

  • name (str) –

    The name of the account.

  • platform (SponsorshipPlatform) –

    The platform of the account.

  • sponsorships (list[Sponsorship]) –

    List of sponsorships associated with the account

  • tier_sum (int) –

    Return the sum of all tier amounts.

  • url (str | None) –

    The URL of the account.

direct_sponsor property ¤

direct_sponsor: bool

Return whether the account is a direct sponsor.

excluded class-attribute instance-attribute ¤

excluded: bool = False

Indicates if the account is excluded from the sponsors list.

highest_tier property ¤

highest_tier: int

Return the highest tier amount.

image class-attribute instance-attribute ¤

image: str | None = None

The image URL of the account.

included class-attribute instance-attribute ¤

included: bool = False

Indicates if the account is included in the sponsors list.

is_org class-attribute instance-attribute ¤

is_org: bool = False

Indicates if the account is an organization.

is_user property ¤

is_user: bool

Return whether the account is a user.

name instance-attribute ¤

name: str

The name of the account.

platform instance-attribute ¤

platform: SponsorshipPlatform

The platform of the account.

sponsorships class-attribute instance-attribute ¤

sponsorships: list[Sponsorship] = field(
    default_factory=list
)

List of sponsorships associated with the account

tier_sum property ¤

tier_sum: int

Return the sum of all tier amounts.

url class-attribute instance-attribute ¤

url: str | None = None

The URL of the account.

Backlog dataclass ¤

Backlog(*, issues: list[Issue] = list())

Backlog of issues.

Classes:

Methods:

  • sort

    Sort the backlog.

Attributes:

issues class-attribute instance-attribute ¤

issues: list[Issue] = field(default_factory=list)

A list of issues.

SortStrategy ¤

Methods:

author_sponsorships staticmethod ¤

author_sponsorships(
    *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • reverse (bool, default: True ) –

created staticmethod ¤

created(*, reverse: bool = False) -> Callable[[Issue], int]

Parameters:

  • reverse (bool, default: False ) –

label staticmethod ¤

label(
    name: str, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • name (str) –
  • reverse (bool, default: True ) –

min_author_sponsorships staticmethod ¤

min_author_sponsorships(
    amount: int, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • amount (int) –
  • reverse (bool, default: True ) –

min_pledge staticmethod ¤

min_pledge(
    amount: int, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • amount (int) –
  • reverse (bool, default: True ) –

min_sponsorships staticmethod ¤

min_sponsorships(
    amount: int, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • amount (int) –
  • reverse (bool, default: True ) –

min_upvoters_sponsorships staticmethod ¤

min_upvoters_sponsorships(
    amount: int, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • amount (int) –
  • reverse (bool, default: True ) –

min_upvotes staticmethod ¤

min_upvotes(
    amount: int, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • amount (int) –
  • reverse (bool, default: True ) –

pledge staticmethod ¤

pledge(*, reverse: bool = True) -> Callable[[Issue], int]

Parameters:

  • reverse (bool, default: True ) –

repository staticmethod ¤

repository(
    name: str, *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • name (str) –
  • reverse (bool, default: True ) –

sponsorships staticmethod ¤

sponsorships(
    *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • reverse (bool, default: True ) –

upvoters_sponsorships staticmethod ¤

upvoters_sponsorships(
    *, reverse: bool = True
) -> Callable[[Issue], int]

Parameters:

  • reverse (bool, default: True ) –

upvotes staticmethod ¤

upvotes(*, reverse: bool = True) -> Callable[[Issue], int]

Parameters:

  • reverse (bool, default: True ) –

sort ¤

sort(*strats: Callable[[Issue], Any]) -> None

Sort the backlog.

Parameters:

Beneficiary dataclass ¤

Beneficiary(
    *,
    user: Account,
    org: Account | None = None,
    grant: bool | None = None
)

A sponsorship beneficiary: a user, grant bit, and optional org.

Attributes:

  • grant (bool | None) –

    Whether the user is granted access to Insiders (in addition to getting voting power).

  • org (Account | None) –

    The organization the user benefits from.

  • user (Account) –

    The user who benefits from the sponsorship.

grant class-attribute instance-attribute ¤

grant: bool | None = None

Whether the user is granted access to Insiders (in addition to getting voting power).

org class-attribute instance-attribute ¤

org: Account | None = None

The organization the user benefits from.

user instance-attribute ¤

user: Account

The user who benefits from the sponsorship.

Issue dataclass ¤

Issue(
    *,
    repository: str,
    number: int,
    title: str,
    created: datetime,
    author: Account,
    upvotes: set[Account] = set(),
    labels: set[str] = set(),
    pledged: int = 0,
    platform: IssuePlatform
)

An issue.

Attributes:

author instance-attribute ¤

author: Account

The issue author.

created instance-attribute ¤

created: datetime

The issue creation date.

labels class-attribute instance-attribute ¤

labels: set[str] = field(default_factory=set)

The issue labels.

number instance-attribute ¤

number: int

The issue number.

platform instance-attribute ¤

platform: IssuePlatform

The issue platform.

pledged class-attribute instance-attribute ¤

pledged: int = 0

The amount pledged.

repository instance-attribute ¤

repository: str

The issue repository.

title instance-attribute ¤

title: str

The issue title.

upvotes class-attribute instance-attribute ¤

upvotes: set[Account] = field(default_factory=set)

The issue upvotes / upvoters.

Sponsors dataclass ¤

Sponsors(*, sponsorships: list[Sponsorship] = list())

Wrapper class for sponsorships.

Methods:

Attributes:

accounts property ¤

accounts: set[Account]

Set of accounts who created sponsorships.

beneficiaries property ¤

beneficiaries: dict[str, Beneficiary]

Beneficiaries of all sponsorships.

sponsorships class-attribute instance-attribute ¤

sponsorships: list[Sponsorship] = field(
    default_factory=list
)

Sponsorships.

merge ¤

merge(other: Sponsors) -> Sponsors

Parameters:

Sponsorship dataclass ¤

Sponsorship(
    *,
    private: bool = True,
    created: datetime,
    amount: int,
    account: Account,
    beneficiaries: dict[str, Beneficiary] = dict()
)

A sponsorship.

Attributes:

account instance-attribute ¤

account: Account

The account who created the sponsorship

amount instance-attribute ¤

amount: int

The amount of the sponsorship

beneficiaries class-attribute instance-attribute ¤

beneficiaries: dict[str, Beneficiary] = field(
    default_factory=dict
)

Beneficiaries of this sponsorship.

created instance-attribute ¤

created: datetime

The creation date of the sponsorship

private class-attribute instance-attribute ¤

private: bool = True

Indicates if the sponsorship is private