insiders ¤
insiders package.
Manage your Insiders projects.
Classes:
-
Account
–An account.
-
Backlog
–Backlog of issues.
-
GitHub
–GitHub client.
-
Index
–Index of repositories.
-
Issue
–An issue.
-
Polar
–Polar client.
-
Sponsors
–Wrapper class for sponsorships.
-
Sponsorship
–A sponsorship.
Functions:
-
get_backlog
– -
main
–Run the main program.
-
print_backlog
–Print the backlog.
-
update_numbers_file
–Update the file storing sponsorship numbers.
-
update_sponsors_file
–Update the file storing sponsors info.
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
¤
GitHub ¤
GitHub(token: str)
Bases: Client
GitHub client.
Initialize GitHub API client.
Parameters:
-
token
(str
) –A GitHub token. Recommended scopes:
admin:org
andread:user
.
Methods:
-
consolidate_beneficiaries
– -
create_repo
–Create a repository.
-
get_failed_invites
– -
get_issues
–Get issues from GitHub.
-
get_org_members
–Get organization members (username only).
-
get_sponsors
–Get GitHub sponsors.
-
get_team_invites
–Get pending invitations to a GitHub team.
-
get_team_members
–Get members of a GitHub team.
-
grant_access
–Grant access to a user to a GitHub team.
-
is_org
–Check if an account is an organization.
-
revoke_access
–Revoke access from a user to a GitHub team.
-
sync_team
–Sync sponsors with members of a GitHub team.
consolidate_beneficiaries ¤
create_repo ¤
create_repo(
repository: str,
*,
description: str | None = None,
homepage: str | None = None,
private: bool = False,
has_issues: bool = False,
has_projects: bool = False,
has_wiki: bool = False,
has_discussions: bool = False
) -> None
Create a repository.
Parameters:
-
repository
(str
) –The repository, like
namespace/repo
. -
description
(str | None
, default:None
) –The repository description.
-
homepage
(str | None
, default:None
) –The repository homepage.
-
private
(bool
, default:False
) –Whether the repository is private.
-
has_issues
(bool
, default:False
) –Enable issues.
-
has_projects
(bool
, default:False
) –Enable projects.
-
has_wiki
(bool
, default:False
) –Enable the wiki.
-
has_discussions
(bool
, default:False
) –Enable discussions.
get_failed_invites ¤
get_issues ¤
get_issues(
github_accounts: Iterable[str],
known_github_users: Iterable[Account] | None = None,
*,
allow_labels: set[str] | None = None
) -> IssueDict
Get issues from GitHub.
Parameters:
-
github_accounts
(Iterable[str]
) –A list of GitHub account names.
-
known_github_users
(Iterable[Account] | None
, default:None
) –Known user accounts.
-
allow_labels
(set[str] | None
, default:None
) –A set of labels to keep.
Returns:
-
IssueDict
–A dictionary of issues.
get_org_members ¤
get_sponsors ¤
get_team_invites ¤
get_team_members ¤
grant_access ¤
is_org ¤
revoke_access ¤
sync_team ¤
sync_team(
team: str,
*,
sponsors: Sponsors | None = None,
min_amount: int | None = None,
include_users: set[str] | None = None,
exclude_users: set[str] | None = None,
dry_run: bool = False
) -> None
Sync sponsors with members of a GitHub team.
Parameters:
-
team
(str
) –GitHub team to sync sponsors with.
-
sponsors
(Sponsors | None
, default:None
) –Sponsors data.
-
min_amount
(int | None
, default:None
) –Minimum amount to be considered a sponsor.
-
include_users
(set[str] | None
, default:None
) –Users to always grant access to.
-
exclude_users
(set[str] | None
, default:None
) –Users to never grant access to.
-
dry_run
(bool
, default:False
) –Display changes without applying them.
Index ¤
Index(
url: str = DEFAULT_INDEX_URL,
git_dir: Path = DEFAULT_REPO_DIR,
dist_dir: Path = DEFAULT_DIST_DIR,
)
Index of repositories.
Initialize the index.
Parameters: conf_path: The path to the configuration file.
Parameters:
-
url
(str
, default:DEFAULT_INDEX_URL
) – -
git_dir
(Path
, default:DEFAULT_REPO_DIR
) – -
dist_dir
(Path
, default:DEFAULT_DIST_DIR
) –
Methods:
-
add
– -
exists
–Tell if a package version exists.
-
latest
–Get the latest version of a package.
-
logs
–Return the logs file path.
-
remove
– -
start
–Start the server.
-
status
–Return the server status as a dict of metadata.
-
stop
–Stop the server.
-
update
–Update PyPI packages.
-
upload
–Upload distributions.
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.
Polar ¤
Polar(token: str)
Bases: Client
Polar client.
Initialize Polar API client.
Parameters:
-
token
(str
) –A Polar API token. Recommended scopes:
user:read
,issues:read
,subscriptions:read
.
Methods:
-
get_issues
–Get issues from Polar.
-
get_sponsors
–Get Polar sponsorships.
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:
get_backlog ¤
main ¤
print_backlog ¤
update_numbers_file ¤
update_numbers_file(
sponsorships: list[Sponsorship],
filepath: Path = Path("numbers.json"),
) -> None
Update the file storing sponsorship numbers.
Parameters:
-
sponsorships
(list[Sponsorship]
) –List of sponsorships.
-
filepath
(Path
, default:Path('numbers.json')
) –File-path to update.
update_sponsors_file ¤
update_sponsors_file(
sponsorships: list[Sponsorship],
filepath: Path = Path("sponsors.json"),
*,
exclude_private: bool = True
) -> None
Update the file storing sponsors info.
Parameters:
-
sponsorships
(list[Sponsorship]
) –List of sponsorships.
-
filepath
(Path
, default:Path('sponsors.json')
) –File-path to update.
-
exclude_private
(bool
, default:True
) –Whether to exclude private members.