models ¤
Sponsors management.
Classes:
-
Account
–An account.
-
Backlog
–Backlog of issues.
-
Beneficiary
–A sponsorship beneficiary: a user, grant bit, and optional org.
-
Issue
–An issue.
-
Sponsors
–Wrapper class for sponsorships.
-
Sponsorship
–A sponsorship.
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.
excluded class-attribute
instance-attribute
¤
excluded: bool = False
Indicates if the account is excluded from the sponsors list.
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.
sponsorships class-attribute
instance-attribute
¤
sponsorships: list[Sponsorship] = field(
default_factory=list
)
List of sponsorships associated with the account
Backlog dataclass
¤
Backlog of issues.
Classes:
Methods:
-
sort
–Sort the backlog.
Attributes:
issues class-attribute
instance-attribute
¤
A list of issues.
SortStrategy ¤
Methods:
-
author_sponsorships
– -
created
– -
label
– -
min_author_sponsorships
– -
min_pledge
– -
min_sponsorships
– -
min_upvoters_sponsorships
– -
min_upvotes
– -
pledge
– -
repository
– -
sponsorships
– -
upvoters_sponsorships
– -
upvotes
–
label staticmethod
¤
min_author_sponsorships staticmethod
¤
min_pledge staticmethod
¤
min_sponsorships staticmethod
¤
min_upvoters_sponsorships staticmethod
¤
min_upvotes staticmethod
¤
repository staticmethod
¤
Beneficiary dataclass
¤
A sponsorship beneficiary: a user, grant bit, and optional org.
Attributes:
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
(Account
) –The issue author.
-
created
(datetime
) –The issue creation date.
-
labels
(set[str]
) –The issue labels.
-
number
(int
) –The issue number.
-
platform
(IssuePlatform
) –The issue platform.
-
pledged
(int
) –The amount pledged.
-
repository
(str
) –The issue repository.
-
title
(str
) –The issue title.
-
upvotes
(set[Account]
) –The issue upvotes / upvoters.
labels class-attribute
instance-attribute
¤
The issue labels.
Sponsors dataclass
¤
Sponsors(*, sponsorships: list[Sponsorship] = list())
Wrapper class for sponsorships.
Methods:
-
merge
–
Attributes:
-
accounts
(set[Account]
) –Set of accounts who created sponsorships.
-
beneficiaries
(dict[str, Beneficiary]
) –Beneficiaries of all sponsorships.
-
sponsorships
(list[Sponsorship]
) –Sponsorships.
sponsorships class-attribute
instance-attribute
¤
sponsorships: list[Sponsorship] = field(
default_factory=list
)
Sponsorships.
Sponsorship dataclass
¤
Sponsorship(
*,
private: bool = True,
created: datetime,
amount: int,
account: Account,
beneficiaries: dict[str, Beneficiary] = dict()
)
A sponsorship.
Attributes: