API Reference¶
This module implements a variety of classes used to hold the data parsed from Tibia.com.
These objects are generally obtained from their respective from_content
methods.
It is possible to create and edit these objects as desired, but it may lead to unexpected behaviour if not done properly.
Client¶
Enumerations¶
Enumerations are provided for various values in order to avoid depending on strings.
Many of these enumerations correspond to available options in forms in Tibia.com
Characters¶
The Character section consists of the Character
class and its auxiliary classes used to hold its data.
The entry points for this are:
CharacterParser.from_content()
- Parsing a character’s content.Client.fetch_character()
- Fetching and parsing a character’s content.
Character¶
Auxiliary Classes¶
AccountBadge¶
AccountInformation¶
Achievement¶
CharacterHouse¶
Death¶
GuildMembership¶
DeathParticipant¶
OtherCharacter¶
Worlds¶
Models related to Tibia.com’s World section. The WorldOverview
class contains the list of all worlds, while
the World
class contains the details of a single world.
WorldOverview¶
WorldEntry¶
World¶
OnlineCharacter¶
Guilds¶
Models related to Tibia.com’s Guilds section. The main model is Guild
, while GuildEntry
is the
previewed information in the guild list of the GuildsSection
.
GuildsSection¶
Guild¶
GuildEntry¶
Auxiliary Classes¶
GuildInvite¶
GuildHouse¶
GuildMember¶
GuildWars¶
GuildWarEntry¶
Highscores¶
Models related to Tibia.com’s Highscores section.
Highscores¶
HighscoresEntry¶
LoyaltyHighscoresEntry¶
Houses¶
Models related to Tibia.com’s Houses section.
HousesSection¶
House¶
HouseEntry¶
Leaderboard¶
Models related to Tibia.com’s Leaderboard section.
Leaderboard¶
Auxiliary Classes¶
LeaderboardRotation¶
LeaderboardEntry¶
Forums¶
Models related to Tibia.com’s Forum section.
CMPostArchive¶
ForumSection¶
ForumAnnouncement¶
ForumBoard¶
ForumPost¶
ForumThread¶
AnnouncementEntry¶
BoardEntry¶
ThreadEntry¶
Auxiliary Classes¶
CMPost¶
ForumEmoticon¶
LastPost¶
News¶
Models related to Tibia.com’s News section. This also contains the Event Calendar
NewsArchive¶
News¶
NewsEntry¶
EventSchedule¶
EventEntry¶
Bazaar¶
Models related to Tibia.com’s Bazaar section.
CharacterBazaar¶
Auction¶
AuctionDetails¶
Auxiliary Classes¶
AchievementEntry¶
AuctionFilters¶
BestiaryEntry¶
BlessingEntry¶
CharmsEntry¶
FamiliarEntry¶
ItemEntry¶
MountEntry¶
OutfitEntry¶
Familiars¶
ItemSummary¶
Mounts¶
OutfitImage¶
Outfits¶
SalesArgument¶
SkillEntry¶
Kill Statistics¶
KillStatistics¶
RaceEntry¶
Library¶
CreaturesSection¶
Creature¶
CreatureEntry¶
BoostableBosses¶
BoostedCreatures¶
BossEntry¶
SpellsSection¶
Spell¶
Rune¶
SpellEntry¶
Base Classes¶
The following classes are not meant to be used or instantiated, but are documented here for informational purposes.
They implement methods and properties that can be inherited by other classes to implement their functionality.
- pydantic model tibiapy.models.pagination.Paginated[source]¶
An entity made of multiple pages.
Show JSON schema
{ "title": "Paginated", "description": "An entity made of multiple pages.", "type": "object", "properties": { "currentPage": { "default": 1, "title": "Currentpage", "type": "integer" }, "totalPages": { "default": 1, "title": "Totalpages", "type": "integer" }, "resultsCount": { "default": 0, "title": "Resultscount", "type": "integer" }, "entries": { "default": [], "items": {}, "title": "Entries", "type": "array" } } }
- Config:
populate_by_name: bool = True
alias_generator: function = <function to_camel at 0x7f0e4d1e59e0>
- Fields:
- pydantic model tibiapy.models.pagination.PaginatedWithUrl[source]¶
An entity made of multiple pages with URLs.
Show JSON schema
{ "title": "PaginatedWithUrl", "description": "An entity made of multiple pages with URLs.", "type": "object", "properties": { "currentPage": { "default": 1, "title": "Currentpage", "type": "integer" }, "totalPages": { "default": 1, "title": "Totalpages", "type": "integer" }, "resultsCount": { "default": 0, "title": "Resultscount", "type": "integer" }, "entries": { "default": [], "items": {}, "title": "Entries", "type": "array" } } }
- Config:
populate_by_name: bool = True
alias_generator: function = <function to_camel at 0x7f0e4d1e59e0>
- Fields:
- field current_page: int = 1 (alias 'currentPage')¶
The currently viewed page.
- field entries: List[T] = []¶
The entries in this page.
- field results_count: int = 0 (alias 'resultsCount')¶
The total number of entries across all pages.
- field total_pages: int = 1 (alias 'totalPages')¶
The total number of pages.
- pydantic model tibiapy.models.pagination.AjaxPaginator[source]¶
A paginator that can be fetched via AJAX requests.
Show JSON schema
{ "title": "AjaxPaginator", "description": "A paginator that can be fetched via AJAX requests.", "type": "object", "properties": { "currentPage": { "default": 1, "title": "Currentpage", "type": "integer" }, "totalPages": { "default": 1, "title": "Totalpages", "type": "integer" }, "resultsCount": { "default": 0, "title": "Resultscount", "type": "integer" }, "entries": { "default": [], "items": {}, "title": "Entries", "type": "array" }, "isFullyFetched": { "default": false, "title": "Isfullyfetched", "type": "boolean" } } }
- Config:
populate_by_name: bool = True
alias_generator: function = <function to_camel at 0x7f0e4d1e59e0>
- Fields:
- field current_page: int = 1 (alias 'currentPage')¶
The currently viewed page.
- field entries: List[T] = []¶
The entries in this page.
-
field is_fully_fetched:
bool
= False (alias 'isFullyFetched')¶ Whether this result set was fully fetched or not.
- field results_count: int = 0 (alias 'resultsCount')¶
The total number of entries across all pages.
- field total_pages: int = 1 (alias 'totalPages')¶
The total number of pages.
Parsers¶
Parsers are used to convert to extract information from the HTML content of pages in Tibia.com.
The majority of users do not need to interact with these classes, but they can be used to provide alternate clients using other network libraries.
Most of the parsers support parsing the page displayed for no results (e.g. trying to parse the page for non-existent world Fidera) by returning None
instead of raising an exception.
Additionally, parsers attempt to detect when the HTML belongs to a different section by raising a InvalidContent
exception.