Model Classes

These are all representations of “things” on Tildes, created from HTML from the site and provide easy access to the interesting parts of that HTML.

Topics

class tildee.models.TildesTopic(text)

Represents a single topic on Tildes, generated from the entire page.

Variables:
  • tags (List[str]) – List of tags this topic has.
  • group (str) – The group this topic was posted in.
  • title (str) – The title of this topic.
  • id36 (str) – The id36 of the topic.
  • status (TildesAccessStatus) – Status of this topic. If DELETED or REMOVED, content_html, link, author, timestamp, comments, log, num_votes and num_comments are unavailable.
  • content_html (Optional[str]) – The text of this topic as rendered by the site.
  • link (Optional[str]) – The link of this topic.
  • author (str) – The topic author’s username.
  • timestamp (str) – The topic’s creation timestamp.
  • num_votes (int) – The amount of votes this topic has received.
  • num_comments (int) – The amount of comments on this topic.
  • log (List[TildesTopicLogEntry]) – The associated topic log in chronological order.
  • is_locked (bool) – Whether or not the topic is currently locked.
  • comments (List[TildesComment]) – Top level comments in this topic.
class tildee.models.TildesPartialTopic(text)

Represents a topic on Tildes as fetched from the topic listings, generated from its surrounding <article> tag. Has only reduced information available.

Variables:
  • id36 (str) – The topic’s id36.
  • title (str) – The topic’s title.
  • group (Optional[str]) – The topic’s group, if provided in the listing.
  • author (str) – The topic’s author.
  • link (Optional[str]) – The topic’s link, if available.
  • content_html (Optional[str]) – The text of this topic as rendered by the site, if available.
  • num_votes (int) – The amount of votes this topic has received.
  • num_comments (int) – The amount of comments on this topic.
  • tags (List[str]) – The tags on this topic. Can be incomplete or missing if you have the “Show topic tags in listing pages” setting disabled.
  • timestamp (str) – The topic’s timestamp.
class tildee.models.TildesTopicLogEntry(text)

Represents a single entry from a topic’s log, generated from its surrounding <li> tag.

Variables:
  • user (str) – The responsible curator’s username.
  • timestamp (str) – The entry’s timestamp.
  • kind (TildesTopicLogEntryKind) – The kind of log entry.
  • data (Optional[Dict]) – The data associated with this log entry. See below for structure.
class tildee.models.TildesTopicLogEntryKind

Enum representing the possible kinds of topic log entry. Documentation includes structure for TildesTopicLogEntry’s data attribute.

Link edit, data contains old and new link.
data: {"old": str, "new": str}
LOCK = 6
Comments locked, no data.
data: None
MOVE = 5
Group move, data contains old and new group path.
data: {"old": str, "new": str}
REMOVE = 8
Topic removed, no data.
data: None
TAG_EDIT = 2
Tag edit, data contains added and removed tags.
data: {"added": List[str], "removed": List[str]}
TITLE_EDIT = 3
Title edit, data contains old and new title. If the program can’t decide what is part of the titles and what isn’t, certain will be set to False.
data: {"old": str, "new": str, "certain": bool}
UNKNOWN = 1
Default option if the entry is unrecognized, no data.
data: None
UNLOCK = 7
Comments unlocked, no data.
data: None
UNREMOVE = 9
Topic unremoved, no data.
data: None
class tildee.models.TildesAccessStatus

Enum representing the possible visibility statuses of comments or topics.

DELETED = 3

Comment/Topic deleted by its author, only reduced data available.

FULL = 1

Full content is available.

REMOVED = 2

Comment/Topic removed by site admin, only reduced data available.

Comments

class tildee.models.TildesComment(text)

Represents a single comment on Tildes, generated from its surrounding <article> tag.

Variables:
  • id36 (str) – The id36 of this comment.
  • status (TildesAccessStatus) – Status of this comment. If DELETED or REMOVED, no data beyond id36 are available.
  • content_html (str) – This comment’s content as rendered by the site.
  • applied_labels (List[str]) – The labels the account has applied to this comment.
  • author (str) – The comment author’s username.
  • timestamp (str) – The comment’s creation timestamp.
  • num_votes (int) – The amount of votes this comment has received.
  • children (List[TildesComment]) – Top level replies to this comment.
class tildee.models.TildesNotification(text)

Represents a single notification on Tildes, generated from its surrounding <li> tag.

Variables:
  • subject (str) – The id36 of the comment that triggered the notification.
  • kind (TildesNotificationKind) – The kind of notification.
class tildee.models.TildesNotificationKind

Enum representing the possible kinds of notification.

COMMENT_REPLY = 4
MENTION = 2
TOPIC_REPLY = 3
UNKNOWN = 1

Groups

class tildee.models.TildesGroup(text)

Data about a Tildes Group, generated from it’s <tr> tag on the group listing page.

Variables:
  • name (str) – The name of the group.
  • desc (str) – The group’s description.
  • num_subscribers (int) – How many users have subscribed to the group.
  • subscribed (bool) – If the current user is subscribed to the group.
class tildee.models.TildesWikiPage(text)

Represents a single group wiki page, generated from its entire page.

Variables:
  • title (str) – The page’s title.
  • slug (str) – The page’s slug, i.e. an URL-safe transformation of the title.
  • group (str) – The group the page is in.
  • content_html (str) – The content of the page as rendered by the site.

Messages

class tildee.models.TildesConversation(text)

Represents a conversation on Tildes, generated from the entire page.

Variables:
  • title (str) – The Subject of this conversation.
  • entries (List[TildesMessage]) – The messages in this conversation in order.
class tildee.models.TildesMessage(text)

Represents a message in a conversation on Tildes, generated from its surrounding <article> tag.

Variables:
  • author (str) – The message author’s username.
  • timestamp (str) – The message’s creation timestamp.
  • content_html (str) – The message’s content as rendered by the site.