Skip to content

Documentation for posts.py

sankaku.models.posts.GenerationDirectivesAspectRatio

Bases: SankakuResponseModel

type: str instance-attribute

width: int instance-attribute

height: int instance-attribute


sankaku.models.posts.GenerationDirectivesRating

Bases: SankakuResponseModel

value: str instance-attribute

default: str instance-attribute


sankaku.models.posts.GenerationDirectives

Bases: SankakuResponseModel

tags: Optional[List[GenerationDirectivesTag]] = None class-attribute instance-attribute

aspect_ratio: Optional[GenerationDirectivesAspectRatio] = None class-attribute instance-attribute

rating: Optional[GenerationDirectivesRating] = None class-attribute instance-attribute

negative_prompt: Optional[str] = None class-attribute instance-attribute

natural_input: Optional[str] = None class-attribute instance-attribute

denoising_strength: Optional[int] = None class-attribute instance-attribute


sankaku.models.posts.AIGenerationDirectives

Bases: SankakuResponseModel

Model that describes additional fields for AI-generated posts.

width: int instance-attribute

height: int instance-attribute

prompt: str instance-attribute

batch_size: int instance-attribute

batch_count: int instance-attribute

sampling_steps: int instance-attribute

negative_prompt: str instance-attribute

version: Optional[str] = None class-attribute instance-attribute


sankaku.models.posts.BasePost

Bases: SankakuResponseModel

Model that contains minimum amount of information that all posts have.

id: int instance-attribute

created_at: datetime instance-attribute

rating: types.Rating instance-attribute

status: str instance-attribute

author: Author instance-attribute

file_url: Optional[str] instance-attribute

preview_url: Optional[str] instance-attribute

width: int instance-attribute

height: int instance-attribute

file_size: int instance-attribute

file_type: Optional[types.FileType] = None class-attribute instance-attribute

extension: Optional[str] = Field(alias='file_type', default=None) class-attribute instance-attribute

md5: str instance-attribute

tags: List[PostTag] instance-attribute


sankaku.models.posts.Comment

Bases: SankakuResponseModel

Model that describes comments related to posts if they are exist.

id: int instance-attribute

created_at: datetime instance-attribute

post_id: int instance-attribute

author: Author instance-attribute

body: str instance-attribute

score: int instance-attribute

parent_id: Optional[int] instance-attribute

children: List[Comment] instance-attribute

deleted: bool instance-attribute

deleted_by: dict instance-attribute

updated_at: Optional[datetime] instance-attribute

can_reply: bool instance-attribute

reason: None instance-attribute


sankaku.models.posts.Post

Bases: BasePost

Model that describes posts.

sample_url: Optional[str] instance-attribute

sample_width: int instance-attribute

sample_height: int instance-attribute

preview_width: Optional[int] instance-attribute

preview_height: Optional[int] instance-attribute

has_children: bool instance-attribute

has_comments: bool instance-attribute

has_notes: bool instance-attribute

is_favorited: bool instance-attribute

user_vote: Optional[int] instance-attribute

parent_id: Optional[int] instance-attribute

change: Optional[int] instance-attribute

fav_count: int instance-attribute

recommended_posts: int instance-attribute

recommended_score: int instance-attribute

vote_count: int instance-attribute

total_score: int instance-attribute

comment_count: Optional[int] instance-attribute

source: Optional[str] instance-attribute

in_visible_pool: bool instance-attribute

is_premium: bool instance-attribute

is_rating_locked: bool instance-attribute

is_note_locked: bool instance-attribute

is_status_locked: bool instance-attribute

redirect_to_signup: bool instance-attribute

reactions: List instance-attribute

sequence: Optional[int] = None class-attribute instance-attribute

video_duration: Optional[float] instance-attribute

generation_directives: Optional[GenerationDirectives] instance-attribute


sankaku.models.posts.AIPost

Bases: BasePost

Model that describes AI-generated posts.

There is possibility that AI posts have the same fields as common posts, but premium account is needed to check it properly. So this model is actual for non-premium accounts.

updated_at: Optional[datetime] instance-attribute

post_associated_id: Optional[int] instance-attribute

generation_directives: Optional[AIGenerationDirectives] instance-attribute