Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
refactor: update docstrings and rename some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondThundeR committed May 2, 2023
1 parent 7c826a9 commit 3c86f7f
Show file tree
Hide file tree
Showing 109 changed files with 174 additions and 173 deletions.
4 changes: 2 additions & 2 deletions shikithon/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Shikithon API Module.
This is main module with a class
for interacting with the Shikimori API.
for interacting with the Shikimori API
"""
import sys
from typing import Optional, TypeVar
Expand All @@ -23,7 +23,7 @@ class ShikimoriAPI(Client):
"""Main class for interacting with the API.
Current API class uses base client for interacting with API.
Also, all API methods splitted up to resources for convinient usage.
Also, all API methods splitted up to resources for convinient usage
"""

__slots__ = ('achievements', 'animes', 'appears', 'bans', 'calendars',
Expand Down
2 changes: 1 addition & 1 deletion shikithon/decorators/method_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def endpoint_logger_wrapper(
@wraps(function)
async def endpoint_logger_wrapped(*args: P.args,
**kwargs: P.kwargs) -> R:
"""Decorator's wrapped function for logging endpoint of method
"""Decorator's wrapped function for logging endpoint of method.
:param args: Positional arguments
:type args: P.args
Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/anime.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/animes."""
"""Enums for `/api/animes`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/club.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/clubs."""
"""Enums for `/api/clubs`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/comment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/comments."""
"""Enums for `/api/comments`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/enhanced_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class EnhancedEnum(Enum):
"""Enhanced enum class.
Adds support for __str__ for getting enum value
Adds support for `__str__` for getting enum value
when casting to string or using in f-string, etc.
"""

Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/favorite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/favorites."""
"""Enums for `/api/favorites`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/users/:id/history"""
"""Enums for `/api/users/:id/history`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/manga.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/mangas."""
"""Enums for `/api/mangas`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/users/:id/messages"""
"""Enums for `/api/users/:id/messages`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/person.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/person and /api/favorites."""
"""Enums for `/api/person` and `/api/favorites`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/ranobe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/ranobe."""
"""Enums for `/api/ranobe`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/review.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/reviews"""
"""Enums for `/api/reviews`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/style.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/styles."""
"""Enums for `/api/styles`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/topic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/topics."""
"""Enums for `/api/topics`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/user_rate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/user_rates."""
"""Enums for `/api/user_rates` and `/api/v2/user_rates`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/enums/video.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Enums for /api/animes/:anime_id/videos."""
"""Enums for `/api/animes/:anime_id/videos`."""
from .enhanced_enum import EnhancedEnum


Expand Down
2 changes: 1 addition & 1 deletion shikithon/exceptions/store_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Exception for raising on store method erros."""
"""Exception for raising on store method errors."""

from loguru import logger

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/abuse_response.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for api/v2/abuse_requests"""
"""Model for `api/v2/abuse_requests`."""
from typing import List

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/achievement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/achievements"""
"""Model for `/api/achievements`."""
from datetime import datetime

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/activity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for stats.py"""
"""Submodel for `stats.py`."""
from typing import List

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/anime.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/animes"""
"""Model for `/api/animes`."""
from datetime import date, datetime
from typing import List, Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/ban.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/bans"""
"""Model for `/api/bans`."""
from datetime import datetime
from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/calendar_event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/calendar"""
"""Model for `/api/calendar`."""
from datetime import datetime
from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/character.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for creator.py"""
"""Submodel for `creator.py`."""
from datetime import datetime
from typing import List, Optional, Union

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/club.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/clubs"""
"""Model for `/api/clubs`."""
from typing import List, Optional

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/club_image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/clubs/:id/images"""
"""Model for `/api/clubs/:id/images`."""
from typing import Optional

from pydantic import BaseModel
Expand Down
8 changes: 5 additions & 3 deletions shikithon/models/comment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for ban.py and model for /api/comments"""
"""Submodel for `ban.py` and model for `/api/comments`."""
from datetime import datetime

from pydantic import BaseModel
Expand All @@ -9,7 +9,8 @@
class CommentInfo(BaseModel):
"""Represents a comment info entity.
Used for ban.py model."""
Used for `ban.py` model
"""
id: int
user_id: int
commentable_id: int
Expand All @@ -23,7 +24,8 @@ class CommentInfo(BaseModel):
class Comment(CommentInfo):
"""Represents a comment entity.
Used for api/comments."""
Used for `/api/comments`
"""
html_body: str
can_be_edited: bool
user: UserInfo
2 changes: 1 addition & 1 deletion shikithon/models/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/constants"""
"""Model for `/api/constants`."""
from typing import Tuple, Literal

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/created_user_image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/user_images"""
"""Model for `/api/user_images`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/critique.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for topic.py"""
"""Submodel for `topic.py`."""
from datetime import datetime
from typing import Optional, Union

Expand Down
6 changes: 3 additions & 3 deletions shikithon/models/date.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Submodel for people.py"""
"""Submodel for `people.py`."""
from typing import Optional

from pydantic import BaseModel


class Date(BaseModel):
"""Date model class.
"""Date object model.
Used to represent birthday or decease of person.
Used to represent birthday or decease of person
"""
day: Optional[int]
month: Optional[int]
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/dialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for api/dialogs"""
"""Model for `/api/dialogs`."""
from pydantic import BaseModel

from .message import MessageInfo
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/favourite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for favourites.py"""
"""Submodel for `favourites.py`."""
from typing import Optional

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/favourites.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/users/:id/favorites"""
"""Model for `/api/users/:id/favorites`."""
from typing import List

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/forum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for api/forums"""
"""Model for `/api/forums`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/franchise_tree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/animes|mangas|ranobe/:id/franchise"""
"""Model for `/api/animes|mangas|ranobe/:id/franchise`."""
from typing import List

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/genre.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for anime.py"""
"""Submodel for `anime.py`."""
from typing import Optional

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/users/:id/history"""
"""Model for `/api/users/:id/history`."""
from datetime import datetime
from typing import Optional, Union

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/link.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/animes/:id/external_links"""
"""Model for `/api/animes/:id/external_links`."""
from datetime import datetime
from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/linked_topic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for message.py"""
"""Submodel for `message.py`."""
from datetime import date
from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/logo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for club.py"""
"""Submodel for `club.py`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/manga.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/mangas"""
"""Model for `/api/mangas`."""
from datetime import date
from typing import List, Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/messages and submodel for dialog.py"""
"""Model for `/api/messages` and submodel for `dialog.py`."""
from datetime import datetime
from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/person.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/people and submodel for creator.py"""
"""Model for `/api/people` and submodel for `creator.py`."""
from datetime import datetime
from typing import List, Optional, Tuple

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/publisher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/publishers"""
"""Model for `/api/publishers`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/ranobe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/ranobe"""
"""Model for `/api/ranobe`."""
from datetime import date
from typing import List, Optional

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/rating.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for rating_list.py"""
"""Submodel for `rating_list.py`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/rating_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for stats.py"""
"""Submodel for `stats.py`."""
from typing import List, Optional

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/relation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/animes|mangas|ranobe/:id/related"""
"""Model for `/api/animes|mangas|ranobe/:id/related`."""
from typing import Optional, Union

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/review.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/reviews"""
"""Model for `/api/reviews`."""
from datetime import datetime
from typing import Literal, Optional, Union

Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/role.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for api/animes|mangas|ranobe/:id/roles"""
"""Model for `/api/animes|mangas|ranobe/:id/roles`."""
from typing import List, Optional

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/roles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for people.py"""
"""Submodel for `people.py`."""
from typing import List

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/score.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for score_list.py"""
"""Submodel for `score_list.py`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/score_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for stats.py"""
"""Submodel for `stats.py`."""
from typing import List

from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/screenshot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for anime.py"""
"""Submodel for `anime.py`."""
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/seyu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for character.py"""
"""Submodel for `character.py`."""
from pydantic import BaseModel

from .image import Image
Expand Down
2 changes: 1 addition & 1 deletion shikithon/models/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Submodel for user.py"""
"""Submodel for `user.py`."""
from typing import Dict, List, Optional, Union

from pydantic import BaseModel, Field
Expand Down
Loading

0 comments on commit 3c86f7f

Please sign in to comment.