animedex.backends.anilist._queries
Canonical AniList GraphQL templates.
These constants are the queries that ship at runtime. The captured AniList fixtures used by the test suite were recorded against these exact strings, so changing one here demands a fixture re-capture to keep replay tests honest.
Each template selects the full set of fields the corresponding mapper consumes. AniList rate-limits (30/min anonymous) and over- fetching is cheap — selecting a smaller field set per call is not a project priority.
Templates exposed:
Q_MEDIA_BY_ID— single Media (anime/manga) by id.Q_MEDIA_SEARCH— Page-wrapped Media search.Q_SCHEDULE— Page-wrapped Media filtered by season/year.Q_TRENDING— Page-wrapped Media sorted by TRENDING_DESC.Q_GENRE_COLLECTION,Q_MEDIA_TAG_COLLECTION,Q_SITE_STATISTICS,Q_EXTERNAL_LINK_SOURCE_COLLECTION.Q_AIRING_SCHEDULE,Q_MEDIA_TREND,Q_REVIEW,Q_RECOMMENDATION,Q_THREAD,Q_THREAD_COMMENT,Q_ACTIVITY,Q_ACTIVITY_REPLY,Q_FOLLOWING,Q_FOLLOWER,Q_MEDIA_LIST_PUBLIC,Q_MEDIA_LIST_COLLECTION_PUBLIC,Q_USER_SEARCH.
Q_MEDIA_BY_ID
- animedex.backends.anilist._queries.Q_MEDIA_BY_ID = 'query ($id: Int) {\n Media(id: $id) {\n id idMal\ntitle { romaji english native }\nsynonyms\ntype format status episodes duration\nseason seasonYear\nstartDate { year month day }\nendDate { year month day }\ngenres tags { name rank }\naverageScore meanScore popularity favourites trending\nisAdult countryOfOrigin\ndescription(asHtml: false)\nsource\ncoverImage { extraLarge large medium color }\nbannerImage\ntrailer { id site thumbnail }\nstudios { edges { isMain node { id name isAnimationStudio } } }\nnextAiringEpisode { airingAt timeUntilAiring episode }\nexternalLinks { id site type url language }\nstreamingEpisodes { title thumbnail url site }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_MEDIA_SEARCH
- animedex.backends.anilist._queries.Q_MEDIA_SEARCH = 'query ($q: String, $page: Int, $perPage: Int, $type: MediaType) {\n Page(page: $page, perPage: $perPage) {\n pageInfo { total currentPage hasNextPage perPage }\n media(search: $q, type: $type, sort: SEARCH_MATCH) {\n id idMal\n title { romaji english native }\n type format status episodes\n season seasonYear averageScore popularity isAdult\n coverImage { large color }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_CHARACTER_BY_ID
- animedex.backends.anilist._queries.Q_CHARACTER_BY_ID = 'query ($id: Int) {\n Character(id: $id) {\n id\n name { full native alternative }\n image { large medium }\n description(asHtml: false)\n gender age dateOfBirth { year month day }\n bloodType favourites\n media(perPage: 3) { edges { characterRole node { id title { romaji } } } }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_CHARACTER_SEARCH
- animedex.backends.anilist._queries.Q_CHARACTER_SEARCH = 'query ($q: String, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n characters(search: $q, sort: FAVOURITES_DESC) {\n id\n name { full native alternative }\n image { large medium }\n gender favourites\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_STAFF_BY_ID
- animedex.backends.anilist._queries.Q_STAFF_BY_ID = 'query ($id: Int) {\n Staff(id: $id) {\n id\n name { full native alternative }\n image { large medium }\n description(asHtml: false)\n primaryOccupations gender age dateOfBirth { year month day }\n yearsActive homeTown languageV2 favourites\n staffMedia(perPage: 3) { edges { staffRole node { id title { romaji } } } }\n characters(perPage: 3) { nodes { id name { full } } }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_STAFF_SEARCH
- animedex.backends.anilist._queries.Q_STAFF_SEARCH = 'query ($q: String, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n staff(search: $q) {\n id\n name { full native alternative }\n image { large medium }\n primaryOccupations languageV2 favourites\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_STUDIO_BY_ID
- animedex.backends.anilist._queries.Q_STUDIO_BY_ID = 'query ($id: Int) {\n Studio(id: $id) {\n id name isAnimationStudio favourites\n media(perPage: 5) { edges { isMainStudio node { id title { romaji } } } }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_STUDIO_SEARCH
- animedex.backends.anilist._queries.Q_STUDIO_SEARCH = 'query ($q: String, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n studios(search: $q) {\n id name isAnimationStudio favourites\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_SCHEDULE
- animedex.backends.anilist._queries.Q_SCHEDULE = 'query ($year: Int, $season: MediaSeason, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n media(seasonYear: $year, season: $season, type: ANIME, sort: POPULARITY_DESC) {\n id idMal title { romaji english native } synonyms type format status episodes duration\n season seasonYear startDate { year month day } endDate { year month day }\n genres tags { name rank } averageScore meanScore popularity favourites trending\n isAdult countryOfOrigin source description(asHtml: false)\n coverImage { extraLarge large medium color } bannerImage\n trailer { id site thumbnail }\n studios { edges { isMain node { id name isAnimationStudio } } }\n nextAiringEpisode { airingAt episode timeUntilAiring }\n externalLinks { id site type url language } streamingEpisodes { title thumbnail url site }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_TRENDING
- animedex.backends.anilist._queries.Q_TRENDING = 'query ($perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n media(type: ANIME, sort: TRENDING_DESC) {\n id title { romaji english } status format averageScore popularity trending\n coverImage { large color }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_USER_BY_NAME
- animedex.backends.anilist._queries.Q_USER_BY_NAME = 'query ($name: String) {\n User(name: $name) {\n id name about\n avatar { large medium }\n siteUrl\n statistics {\n anime { count meanScore minutesWatched }\n manga { count meanScore chaptersRead }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_USER_SEARCH
- animedex.backends.anilist._queries.Q_USER_SEARCH = 'query ($q: String, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n users(search: $q) { id name avatar { medium } }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_GENRE_COLLECTION
- animedex.backends.anilist._queries.Q_GENRE_COLLECTION = '{ GenreCollection }'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_MEDIA_TAG_COLLECTION
- animedex.backends.anilist._queries.Q_MEDIA_TAG_COLLECTION = '{\n MediaTagCollection {\n id name description category isAdult isGeneralSpoiler isMediaSpoiler\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_SITE_STATISTICS
- animedex.backends.anilist._queries.Q_SITE_STATISTICS = '{\n SiteStatistics {\n users(perPage: 1) { nodes { date count change } }\n anime(perPage: 1) { nodes { date count change } }\n manga(perPage: 1) { nodes { date count change } }\n characters(perPage: 1) { nodes { date count change } }\n staff(perPage: 1) { nodes { date count change } }\n reviews(perPage: 1) { nodes { date count change } }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_EXTERNAL_LINK_SOURCE_COLLECTION
- animedex.backends.anilist._queries.Q_EXTERNAL_LINK_SOURCE_COLLECTION = 'query ($mediaType: ExternalLinkMediaType, $type: ExternalLinkType) {\n ExternalLinkSourceCollection(mediaType: $mediaType, type: $type) {\n id site type icon language\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_AIRING_SCHEDULE
- animedex.backends.anilist._queries.Q_AIRING_SCHEDULE = 'query ($mediaId: Int, $notYetAired: Boolean, $airingAtGreater: Int, $airingAtLesser: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total hasNextPage }\n airingSchedules(\n mediaId: $mediaId,\n notYetAired: $notYetAired,\n airingAt_greater: $airingAtGreater,\n airingAt_lesser: $airingAtLesser,\n sort: TIME\n ) {\n id airingAt episode timeUntilAiring\n media {\n id idMal title { romaji english native } synonyms type format status episodes duration\n season seasonYear startDate { year month day } endDate { year month day }\n genres tags { name rank } averageScore meanScore popularity favourites trending\n isAdult countryOfOrigin source description(asHtml: false)\n coverImage { extraLarge large medium color } bannerImage\n trailer { id site thumbnail }\n studios { edges { isMain node { id name isAnimationStudio } } }\n nextAiringEpisode { airingAt episode timeUntilAiring }\n externalLinks { id site type url language } streamingEpisodes { title thumbnail url site }\n }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_MEDIA_TREND
- animedex.backends.anilist._queries.Q_MEDIA_TREND = 'query ($mediaId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total hasNextPage }\n mediaTrends(mediaId: $mediaId, sort: DATE_DESC) {\n mediaId date trending averageScore popularity inProgress episode\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_REVIEW
- animedex.backends.anilist._queries.Q_REVIEW = 'query ($mediaId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n reviews(mediaId: $mediaId, sort: RATING_DESC) {\n id summary score rating ratingAmount\n user { id name }\n siteUrl\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_RECOMMENDATION
- animedex.backends.anilist._queries.Q_RECOMMENDATION = 'query ($mediaId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n pageInfo { total }\n recommendations(mediaId: $mediaId, sort: RATING_DESC) {\n id rating\n media { id title { romaji english } }\n mediaRecommendation { id title { romaji english } }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_THREAD
- animedex.backends.anilist._queries.Q_THREAD = 'query ($q: String, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n threads(search: $q, sort: CREATED_AT_DESC) {\n id title body\n user { id name }\n replyCount viewCount createdAt\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_THREAD_COMMENT
- animedex.backends.anilist._queries.Q_THREAD_COMMENT = 'query ($threadId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n threadComments(threadId: $threadId) {\n id comment\n user { id name }\n createdAt\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_ACTIVITY
- animedex.backends.anilist._queries.Q_ACTIVITY = 'query ($perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n activities(sort: ID_DESC) {\n ... on TextActivity { id text user { name } createdAt }\n ... on ListActivity { id status user { name } media { id title { romaji } } createdAt }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_ACTIVITY_REPLY
- animedex.backends.anilist._queries.Q_ACTIVITY_REPLY = 'query ($activityId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n activityReplies(activityId: $activityId) {\n id text user { name } createdAt\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_FOLLOWING
- animedex.backends.anilist._queries.Q_FOLLOWING = 'query ($userId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n following(userId: $userId) { id name }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_FOLLOWER
- animedex.backends.anilist._queries.Q_FOLLOWER = 'query ($userId: Int, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n followers(userId: $userId) { id name }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_MEDIA_LIST_PUBLIC
- animedex.backends.anilist._queries.Q_MEDIA_LIST_PUBLIC = 'query ($userName: String, $type: MediaType, $perPage: Int) {\n Page(page: 1, perPage: $perPage) {\n mediaList(userName: $userName, type: $type) {\n id status score progress\n media { id title { romaji } }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_MEDIA_LIST_COLLECTION_PUBLIC
- animedex.backends.anilist._queries.Q_MEDIA_LIST_COLLECTION_PUBLIC = 'query ($userName: String, $type: MediaType) {\n MediaListCollection(userName: $userName, type: $type) {\n user { id name }\n lists {\n name status entries { id status score progress media { id title { romaji } } }\n }\n }\n}'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_VIEWER
- animedex.backends.anilist._queries.Q_VIEWER = '{ Viewer { id name } }'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_NOTIFICATION
- animedex.backends.anilist._queries.Q_NOTIFICATION = '{ Notification { ... on AiringNotification { id type contexts media { id title { romaji } } } } }'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_MARKDOWN
- animedex.backends.anilist._queries.Q_MARKDOWN = 'query ($markdown: String) { Markdown(markdown: $markdown) { html } }'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
Q_ANI_CHART_USER
- animedex.backends.anilist._queries.Q_ANI_CHART_USER = '{ AniChartUser { user { id name } highlights } }'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.