Skip to content
This repository was archived by the owner on Aug 20, 2023. It is now read-only.

Commit 53eabeb

Browse files
Run stubgen
1 parent ab4e610 commit 53eabeb

File tree

10 files changed

+363
-0
lines changed

10 files changed

+363
-0
lines changed

out/pyrinth/__init__.pyi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from pyrinth.models import *
2+
from pyrinth.modrinth import *
3+
from pyrinth.projects import *
4+
from pyrinth.tags import *
5+
from pyrinth.users import *
6+
from pyrinth.teams import *

out/pyrinth/exceptions.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class NotFoundError(Exception):
2+
def __init__(self, *args: object) -> None: ...
3+
4+
class InvalidRequestError(Exception):
5+
def __init__(self, reason) -> None: ...
6+
7+
class NoAuthorizationError(Exception):
8+
def __init__(self, *args: object) -> None: ...
9+
10+
class InvalidParamError(Exception):
11+
def __init__(self, *args: object) -> None: ...

out/pyrinth/literals.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from _typeshed import Incomplete
2+
3+
index_literal: Incomplete
4+
side_literal: Incomplete
5+
version_status_literal: Incomplete
6+
requested_version_status_literal: Incomplete
7+
project_status_literal: Incomplete
8+
requested_project_status_literal: Incomplete
9+
version_type_literal: Incomplete
10+
project_type_literal: Incomplete
11+
user_role_literal: Incomplete
12+
sha_algorithm_literal: Incomplete

out/pyrinth/models.pyi

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import pyrinth.literals as literals
2+
import pyrinth.projects as projects
3+
from _typeshed import Incomplete
4+
5+
class ProjectModel:
6+
slug: Incomplete
7+
title: Incomplete
8+
description: Incomplete
9+
categories: Incomplete
10+
client_side: Incomplete
11+
server_side: Incomplete
12+
body: Incomplete
13+
license: Incomplete
14+
project_type: Incomplete
15+
additional_categories: Incomplete
16+
issues_url: Incomplete
17+
source_url: Incomplete
18+
wiki_url: Incomplete
19+
discord_url: Incomplete
20+
donation_urls: Incomplete
21+
auth: Incomplete
22+
id: Incomplete
23+
downloads: Incomplete
24+
icon_url: Incomplete
25+
color: Incomplete
26+
team: Incomplete
27+
moderator_message: Incomplete
28+
published: Incomplete
29+
updated: Incomplete
30+
approved: Incomplete
31+
followers: Incomplete
32+
status: Incomplete
33+
version_ids: Incomplete
34+
game_versions: Incomplete
35+
loaders: Incomplete
36+
gallery: Incomplete
37+
def __init__(self, slug: str, title: str, description: str, categories: list[str], client_side: str, server_side: str, body: str, license_: projects.Project.License, project_type: str, additional_categories: list[str] | None = ..., issues_url: str | None = ..., source_url: str | None = ..., wiki_url: str | None = ..., discord_url: str | None = ..., auth: str | None = ...) -> None: ...
38+
39+
class SearchResultModel:
40+
slug: Incomplete
41+
title: Incomplete
42+
description: Incomplete
43+
client_side: Incomplete
44+
server_side: Incomplete
45+
project_type: Incomplete
46+
downloads: Incomplete
47+
project_id: Incomplete
48+
author: Incomplete
49+
versions: Incomplete
50+
follows: Incomplete
51+
date_created: Incomplete
52+
date_modified: Incomplete
53+
license: Incomplete
54+
categories: Incomplete
55+
icon_url: Incomplete
56+
color: Incomplete
57+
display_categories: Incomplete
58+
latest_version: Incomplete
59+
gallery: Incomplete
60+
featured_gallery: Incomplete
61+
def __init__(self) -> None: ...
62+
63+
class VersionModel:
64+
name: Incomplete
65+
version_number: Incomplete
66+
changelog: Incomplete
67+
dependencies: Incomplete
68+
game_versions: Incomplete
69+
version_type: Incomplete
70+
loaders: Incomplete
71+
featured: Incomplete
72+
status: Incomplete
73+
requested_status: Incomplete
74+
files: Incomplete
75+
project_id: Incomplete
76+
id: Incomplete
77+
author_id: Incomplete
78+
date_published: Incomplete
79+
downloads: Incomplete
80+
def __init__(self, name: str, version_number: str, dependencies: list['projects.Project.Dependency'], game_versions: list[str], version_type: literals.version_type_literal, loaders: list[str], featured: bool, file_parts: list[str], changelog: str | None = ..., status: literals.version_status_literal | None = ..., requested_status: literals.requested_version_status_literal | None = ...) -> None: ...
81+
82+
class UserModel:
83+
username: Incomplete
84+
id: Incomplete
85+
avatar_url: Incomplete
86+
created: Incomplete
87+
role: Incomplete
88+
name: Incomplete
89+
email: Incomplete
90+
bio: Incomplete
91+
payout_data: Incomplete
92+
github_id: Incomplete
93+
badges: Incomplete
94+
auth: Incomplete
95+
def __init__(self) -> None: ...

out/pyrinth/modrinth.pyi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pyrinth.projects as projects
2+
from _typeshed import Incomplete
3+
4+
class Modrinth:
5+
@staticmethod
6+
def project_exists(id_: str) -> bool: ...
7+
@staticmethod
8+
def get_random_projects(count: int = ...) -> list['projects.Project']: ...
9+
class Statistics:
10+
authors: Incomplete
11+
files: Incomplete
12+
projects: Incomplete
13+
versions: Incomplete
14+
def __init__(self) -> None: ...

out/pyrinth/projects.pyi

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
import datetime as dt
2+
import pyrinth.literals as literals
3+
import pyrinth.models as models
4+
import pyrinth.teams as teams
5+
import typing
6+
import pyrinth.users as users
7+
from _typeshed import Incomplete
8+
9+
class Project:
10+
model: Incomplete
11+
def __init__(self, project_model: models.ProjectModel) -> None: ...
12+
def get_donations(self) -> list['Project.Donation']: ...
13+
@staticmethod
14+
def get(id_: str, auth: object = ...) -> Project: ...
15+
@staticmethod
16+
def get_multiple(ids: list[str]) -> list['Project']: ...
17+
def get_latest_version(self, loaders: list[str] | None = ..., game_versions: list[str] | None = ..., featured: bool | None = ..., types: literals.version_type_literal | None = ..., auth: str | None = ...) -> Project.Version: ...
18+
def get_gallery(self) -> list['Project.GalleryImage']: ...
19+
def is_client_side(self) -> bool: ...
20+
def is_server_side(self) -> bool: ...
21+
def get_downloads(self) -> int: ...
22+
def get_categories(self) -> list[str]: ...
23+
def get_additional_categories(self) -> list[str]: ...
24+
def get_all_categories(self) -> list[str]: ...
25+
def get_license(self) -> Project.License: ...
26+
def get_specific_version(self, semantic_version: str) -> typing.Optional['Project.Version']: ...
27+
def download(self, recursive: bool = ...) -> None: ...
28+
def get_versions(self, loaders: list[str] | None = ..., game_versions: list[str] | None = ..., featured: bool | None = ..., types: literals.version_type_literal | None = ..., auth: str | None = ...) -> list['Project.Version']: ...
29+
def get_oldest_version(self, loaders: list[str] | None = ..., game_versions: list[str] | None = ..., featured: bool | None = ..., types: literals.version_type_literal | None = ..., auth: str | None = ...) -> Project.Version: ...
30+
def get_id(self) -> str: ...
31+
def get_slug(self) -> str: ...
32+
def get_name(self) -> str: ...
33+
@staticmethod
34+
def get_version(id_: str) -> Project.Version: ...
35+
def create_version(self, version_model, auth: str | None = ...) -> int: ...
36+
def change_icon(self, file_path: str, auth: str | None = ...) -> bool: ...
37+
def delete_icon(self, auth: str | None = ...) -> bool: ...
38+
def add_gallery_image(self, image: Project.GalleryImage, auth: str | None = ...) -> bool: ...
39+
def modify_gallery_image(self, url: str, featured: bool | None = ..., title: str | None = ..., description: str | None = ..., ordering: int | None = ..., auth: str | None = ...) -> bool: ...
40+
def delete_gallery_image(self, url: str, auth: str | None = ...) -> bool: ...
41+
def modify(self, slug: str | None = ..., title: str | None = ..., description: str | None = ..., categories: list[str] | None = ..., client_side: str | None = ..., server_side: str | None = ..., body: str | None = ..., additional_categories: list[str] | None = ..., issues_url: str | None = ..., source_url: str | None = ..., wiki_url: str | None = ..., discord_url: str | None = ..., license_id: str | None = ..., license_url: str | None = ..., status: literals.project_status_literal | None = ..., requested_status: literals.requested_project_status_literal | None = ..., moderation_message: str | None = ..., moderation_message_body: str | None = ..., auth: str | None = ...) -> bool: ...
42+
def delete(self, auth: str | None = ...) -> typing.Literal[True]: ...
43+
def get_dependencies(self) -> list['Project']: ...
44+
@staticmethod
45+
def search(query: str = ..., facets: list[list[str]] | None = ..., index: literals.index_literal = ..., offset: int = ..., limit: int = ..., filters: list[str] | None = ...) -> list['Project.SearchResult']: ...
46+
def get_team_members(self) -> list[teams.Team.TeamMember]: ...
47+
def get_team(self) -> teams.Team: ...
48+
class Version:
49+
model: Incomplete
50+
def __init__(self, version_model: models.VersionModel) -> None: ...
51+
def get_type(self) -> str: ...
52+
def get_dependencies(self) -> list['Project.Dependency']: ...
53+
@staticmethod
54+
def get(id_: str) -> Project.Version: ...
55+
@staticmethod
56+
def get_from_hash(hash_: str, algorithm: literals.sha_algorithm_literal = ..., multiple: bool = ...) -> typing.Union['Project.Version', list['Project.Version']]: ...
57+
@staticmethod
58+
def delete_file_from_hash(auth: str, hash_: str, version_id: str, algorithm: literals.sha_algorithm_literal = ...) -> typing.Literal[True]: ...
59+
def get_files(self) -> list['Project.File']: ...
60+
def download(self, recursive: bool = ...) -> None: ...
61+
def get_project(self) -> Project: ...
62+
def get_primary_files(self) -> list['Project.File']: ...
63+
def get_author(self) -> users.User: ...
64+
def is_featured(self) -> bool: ...
65+
def get_date_published(self) -> dt.datetime: ...
66+
def get_downloads(self) -> int: ...
67+
def get_name(self) -> str: ...
68+
def get_version_number(self) -> str: ...
69+
class GalleryImage:
70+
file_path: Incomplete
71+
ext: Incomplete
72+
featured: Incomplete
73+
title: Incomplete
74+
description: Incomplete
75+
ordering: Incomplete
76+
def __init__(self, file_path: str, featured: bool, title: str, description: str, ordering: int = ...) -> None: ...
77+
class File:
78+
hashes: Incomplete
79+
url: Incomplete
80+
name: Incomplete
81+
primary: Incomplete
82+
size: Incomplete
83+
file_type: Incomplete
84+
extension: Incomplete
85+
def __init__(self, hashes: dict[str, str], url: str, filename: str, primary: str, size: int, file_type: str) -> None: ...
86+
def is_resourcepack(self) -> bool: ...
87+
class License:
88+
id: Incomplete
89+
name: Incomplete
90+
url: Incomplete
91+
def __init__(self, id_: str, name: str, url: str | None = ...) -> None: ...
92+
class Donation:
93+
id: Incomplete
94+
platform: Incomplete
95+
url: Incomplete
96+
def __init__(self, id_: str, platform: str, url: str) -> None: ...
97+
class Dependency:
98+
dependency_option: Incomplete
99+
file_name: Incomplete
100+
version_id: Incomplete
101+
project_id: Incomplete
102+
def __init__(self) -> None: ...
103+
def get_version(self) -> Project.Version: ...
104+
def is_required(self) -> bool: ...
105+
def is_optional(self) -> bool: ...
106+
def is_incompatible(self) -> bool: ...
107+
class SearchResult:
108+
model: Incomplete
109+
def __init__(self, search_result_model: models.SearchResultModel) -> None: ...

out/pyrinth/tags.pyi

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from _typeshed import Incomplete
2+
3+
class Tag:
4+
@staticmethod
5+
def get_categories() -> list['Tag.Category']: ...
6+
@staticmethod
7+
def get_loaders() -> list['Tag.Loader']: ...
8+
@staticmethod
9+
def get_game_versions() -> list['Tag.GameVersion']: ...
10+
@staticmethod
11+
def get_licenses() -> list['Tag.License']: ...
12+
@staticmethod
13+
def get_donation_platforms() -> list['Tag.DonationPlatform']: ...
14+
@staticmethod
15+
def get_report_types() -> list[str]: ...
16+
class Category:
17+
icon: Incomplete
18+
name: Incomplete
19+
project_type: Incomplete
20+
header: Incomplete
21+
def __init__(self, icon: str, name: str, project_type: str, header: str) -> None: ...
22+
class Loader:
23+
icon: Incomplete
24+
name: Incomplete
25+
supported_project_types: Incomplete
26+
def __init__(self, icon: str, name: str, supported_project_types: list[str]) -> None: ...
27+
class GameVersion:
28+
version: Incomplete
29+
version_type: Incomplete
30+
date: Incomplete
31+
major: Incomplete
32+
def __init__(self, version: str, version_type: str, date: str, major: bool) -> None: ...
33+
class License:
34+
short: Incomplete
35+
name: Incomplete
36+
def __init__(self, short: str, name: str) -> None: ...
37+
class DonationPlatform:
38+
short: Incomplete
39+
name: Incomplete
40+
def __init__(self, short: str, name: str) -> None: ...

out/pyrinth/teams.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pyrinth.users as users
2+
from _typeshed import Incomplete
3+
4+
class Team:
5+
members: Incomplete
6+
id: Incomplete
7+
def __init__(self) -> None: ...
8+
def get_members(self) -> list['Team.TeamMember']: ...
9+
class TeamMember:
10+
team_id: Incomplete
11+
user: Incomplete
12+
role: Incomplete
13+
permissions: Incomplete
14+
accepted: Incomplete
15+
payouts_split: Incomplete
16+
ordering: Incomplete
17+
def __init__(self, team_id: str, user: dict, role: str, permissions, accepted: bool, payouts_split, ordering: bool) -> None: ...
18+
def get_user(self) -> users.User: ...

out/pyrinth/users.pyi

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import datetime as dt
2+
import pyrinth.models as models
3+
import pyrinth.projects as projects
4+
import typing
5+
from _typeshed import Incomplete
6+
7+
class User:
8+
model: Incomplete
9+
def __init__(self, user_model: models.UserModel) -> None: ...
10+
def get_auth(self) -> str | None: ...
11+
def get_payout_history(self) -> User.PayoutHistory: ...
12+
def withdraw_balance(self, amount: int) -> typing.Literal[True]: ...
13+
def change_avatar(self, file_path) -> typing.Literal[True]: ...
14+
@staticmethod
15+
def get(id_: str, auth: Incomplete | None = ...) -> User: ...
16+
def get_date_created(self) -> dt.datetime: ...
17+
def get_followed_projects(self) -> list['projects.Project']: ...
18+
def get_notifications(self) -> list['User.Notification']: ...
19+
def get_amount_of_projects(self) -> int: ...
20+
def create_project(self, project_model, icon: str | None = ...) -> int: ...
21+
def get_projects(self) -> list['projects.Project']: ...
22+
def follow_project(self, id_: str) -> int: ...
23+
def unfollow_project(self, id_: str) -> int: ...
24+
@staticmethod
25+
def get_from_auth(auth: str) -> User: ...
26+
@staticmethod
27+
def from_id(id_: str) -> User: ...
28+
@staticmethod
29+
def from_ids(ids: list[str]) -> list['User']: ...
30+
class Notification:
31+
id: Incomplete
32+
user_id: Incomplete
33+
type: Incomplete
34+
title: Incomplete
35+
text: Incomplete
36+
link: Incomplete
37+
read: Incomplete
38+
created: Incomplete
39+
actions: Incomplete
40+
project_title: Incomplete
41+
def __init__(self, notification_json: dict) -> None: ...
42+
class PayoutHistory:
43+
all_time: Incomplete
44+
last_month: Incomplete
45+
payouts: Incomplete
46+
def __init__(self, all_time: float, last_month: float, payouts: list) -> None: ...

out/pyrinth/util.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import datetime as dt
2+
import typing
3+
4+
def to_sentence_case(sentence) -> typing.Any: ...
5+
def remove_null_values(json_: dict) -> dict: ...
6+
def to_image_from_json(json_: dict) -> list: ...
7+
def json_to_query_params(json_: dict) -> str: ...
8+
def remove_file_path(file) -> str: ...
9+
def list_to_json(lst: list) -> list[dict]: ...
10+
def list_to_object(type_, lst) -> list: ...
11+
def format_time(time) -> dt.datetime: ...
12+
def args_to_dict(**kwargs) -> str: ...

0 commit comments

Comments
 (0)