Skip to content
dani edited this page Feb 23, 2024 · 11 revisions

See the client page for how to retrieve and use these models

fuzzly.models.post.Post

class Post(BaseModel):
	post_id: PostId
	title: Optional[str]
	description: Optional[str]
	user: UserPortable
	score: Optional[Score]
	rating: Rating
	parent: Optional[PostId]
	privacy: Privacy
	created: Optional[datetime]
	updated: Optional[datetime]
	filename: Optional[str]
	media_type: Optional[MediaType]
	size: Optional[PostSize]
	blocked: bool

subtypes

fuzzly.models.PostId

automatically converts post ids in int, byte, or string format to their user-friendly str format. also checks for valid values.

PostId(123)
PostId('abcd1234')
PostId(b'abc123')

fuzzly.models.PostSort

class PostSort(Enum):
	new: str = 'new'
	old: str = 'old'
	top: str = 'top'
	hot: str = 'hot'
	best: str = 'best'
	controversial: str = 'controversial'

fuzzly.models.tag.Tag

class Tag(BaseModel):
	tag: str
	owner: Optional[UserPortable]
	group: TagGroupPortable
	deprecated: bool
	inherited_tags: List[str]
	description: Optional[str]
	count: int

subtypes

fuzzly.models.tag.TagGroups

class TagGroups(Dict[TagGroupPortable, List[str]]) :
	pass

fuzzly.models.set.Set

class Set(BaseModel):
	set_id: SetId
	owner: UserPortable
	count: int
	title: Optional[str]
	description: Optional[str]
	privacy: UserPrivacy
	created: datetime
	updated: datetime
	first: Optional[Post]
	last: Optional[Post]

subtypes

fuzzly.models.SetId

automatically converts set ids in int, byte, or string format to their user-friendly str format. also checks for valid values.

SetId(123)
SetId('abc-123')
SetId(b'abcde')

fuzzly.models.set.PostSet

class PostSet(Set):
	set_id: SetId
	owner: UserPortable
	count: int
	title: Optional[str]
	description: Optional[str]
	privacy: UserPrivacy
	created: datetime
	updated: datetime
	first: Optional[Post]
	last: Optional[Post]
	neighbors: SetNeighbors

subtypes

fuzzly.models.UserPortable

class UserPortable(BaseModel):
	name: str
	handle: str
	privacy: UserPrivacy
	icon: Optional[PostId]
	verified: Optional[Verified]
	following: Optional[bool]

subtypes

fuzzly.models.Score

class Score(BaseModel):
	up: int
	down: int
	total: int
	user_vote: int

fuzzly.models.Rating

class Rating(Enum):
	general: str = 'general'
	mature: str = 'mature'
	explicit: str = 'explicit'

fuzzly.models.Privacy

class Privacy(Enum):
	public: str = 'public'
	unlisted: str = 'unlisted'
	private: str = 'private'
	unpublished: str = 'unpublished'
	draft: str = 'draft'

fuzzly.models.post.MediaType

class MediaType(BaseModel):
	file_type: str
	mime_type: str

fuzzly.models.PostSize

class PostSize(BaseModel):
	width: int
	height: int

fuzzly.models.tag.TagGroupPortable

class TagGroupPortable(Enum):
	artist: str = 'artist'
	subject: str = 'subject'
	sponsor: str = 'sponsor'
	species: str = 'species'
	gender: str = 'gender'
	misc: str = 'misc'

fuzzly.models.UserPrivacy

class UserPrivacy(Enum):
	public: str = 'public'
	private: str = 'private'

fuzzly.models.set.SetNeighbors

class SetNeighbors(BaseModel):
	index: int
	before: List[Optional[Post]]
	after: List[Optional[Post]]

subtypes

fuzzly.models.Verified

class Verified(Enum):
	artist: str = 'artist'
	mod: str = 'mod'
	admin: str = 'admin'