API Reference#

Client#

class hondana.Client(*, username: None = ..., email: None = ..., password: None = ..., session: Optional[aiohttp.ClientSession] = ..., refresh_token: None = ...)[source]#
class hondana.Client(*, username: None = ..., email: str = ..., password: str = ..., session: Optional[aiohttp.ClientSession] = ..., refresh_token: None = ...)
class hondana.Client(*, username: None = ..., email: str = ..., password: str = ..., session: Optional[aiohttp.ClientSession] = ..., refresh_token: str = ...)
class hondana.Client(*, username: str = ..., email: None = ..., password: str = ..., session: Optional[aiohttp.ClientSession] = ..., refresh_token: None = ...)
class hondana.Client(*, username: str = ..., email: None = ..., password: str = ..., session: Optional[aiohttp.ClientSession] = ..., refresh_token: str = ...)
class hondana.Client(*, username: None = ..., email: None = ..., password: None = ..., session: Optional[aiohttp.ClientSession] = ..., refresh_token: str = ...)

User Client for interfacing with the MangaDex API.

username#

Your login username for the API / site. Used in conjunction with your password to generate an authentication token.

Type:

Optional[str]

email#

Your login email for the API / site. Used in conjunction with your password to generate an authentication token.

Type:

Optional[str]

password#

Your login password for the API / site. Used in conjunction with your username to generate an authentication token.

Type:

Optional[str]

session#

A aiohttp ClientSession to use instead of creating one.

Type:

Optional[aiohttp.ClientSession]

refresh_token#

Your last refresh token to use if you want to skip the login stage.

Type:

Optional[str]

Note

The Client will work without authentication, and all authenticated endpoints will fail before attempting a request.

Note

The aiohttp.ClientSession passed via constructor will have headers and authentication set. Do not pass one you plan to re-use for other things, lest you leak your login data.

Raises:

ValueError – You failed to pass appropriate login information (login/email and password).

login(*, username: str = None, email: None = None, password: str, refresh_token: None = None) None[source]#
login(*, username: None = None, email: str = None, password: str, refresh_token: None = None) None
login(*, username: str = None, email: None = None, password: str, refresh_token: str = None) None
login(*, username: None = None, email: str = None, password: str, refresh_token: str = None) None
login(*, username: None = None, email: None = None, password: None = None, refresh_token: str = None) None

A method to add authentication details to the client post-creation.

Parameters:
  • username (Optional[str]) – The login username to authenticate to the API.

  • email (Optional[str]) – The login email to authenticate to the API.

  • password (Optional[str]) – The password to authenticate to the API.

  • refresh_token (Optional[str]) – The refresh token to use in place of auth.

await static_login() None[source]#

This function is a coroutine.

This method simply logs into the API and assigns a token to the client.

property user_info: Optional[UserInfo]#

This attribute will return a permissions instance for the current logged-in user.

You must be authenticated to access this, and logged in.

If you wish to just check permissions without making an api request, consider static_login()

Return type:

UserInfo

dump_refresh_token(*, file: bool = True, path: Union[PathLike[str], str] = '.hondana-refresh-token', mode: Literal['a', 'a+', 'w', 'w+'] = 'w') str[source]#

This method will dump your current refresh token to a file for later re-use in the login process in future client initialisations.

Parameters:
  • file (bool) – Whether to dump to a file, or not.

  • path (Union[os.PathLike, str]) – The path to dump the file. Defaults to ".hondana-refresh-token".

  • mode (Literal["a", "a+", "w", "w+"]) – The mode in which to open the file. Defaults to "w".

Returns:

The current refresh token.

Return type:

str

await logout() None[source]#

This function is a coroutine.

Logs the client out. This process will invalidate the current authorization token in the process.

await close() None[source]#

This function is a coroutine.

Logs the client out of the API and closes the internal http session.

await check_username_available(username: str) bool[source]#

This function is a coroutine.

This method will check if the username supplied is available for use on MangaDex.

Parameters:

username (str) – The username to check for.

Raises:

Forbidden – The request failed due to authorization.

Returns:

If the username is available or not.

Return type:

bool

await update_tags() dict[str, str][source]#

This function is a coroutine.

Convenience method for updating the local cache of tags.

This should ideally not need to be called by the end user but nevertheless it exists in the event MangaDex add a new tag or similar.

Returns:

The new tags from the API.

Return type:

Dict[str, str]

await update_report_reasons() dict[str, dict[str, str]][source]#

This function is a coroutine.

Convenience method for updating the local cache of report reasons.

This should ideally not need to be called by the end user but nevertheless it exists in the event MangaDex add a new report reasons or similar.

Returns:

The new report reasons from the API.

Return type:

Dict[str, Dict[str, str]]

Warning

This method makes 5 API requests, which if called unnecessarily could result in a ratelimit.

await get_tags() list[hondana.tags.Tag][source]#

This function is a coroutine.

This method will retrieve the current list of tags on MangaDex.

Returns:

The list of tags.

Return type:

List[Tag]

await get_my_feed(*, limit: ~typing.Optional[int] = 100, offset: int = 0, translated_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, excluded_original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, content_rating: ~typing.Optional[list[hondana.enums.ContentRating]] = None, excluded_groups: ~typing.Optional[list[str]] = None, excluded_uploaders: ~typing.Optional[list[str]] = None, include_future_updates: ~typing.Optional[bool] = None, created_at_since: ~typing.Optional[~datetime.datetime] = None, updated_at_since: ~typing.Optional[~datetime.datetime] = None, published_at_since: ~typing.Optional[~datetime.datetime] = None, order: ~typing.Optional[~hondana.query.FeedOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>, include_empty_pages: ~typing.Optional[bool] = None, include_future_publish_at: ~typing.Optional[bool] = None, include_external_url: ~typing.Optional[bool] = None) ChapterFeed[source]#

This function is a coroutine.

This method will retrieve the logged-in user’s followed manga chapter feed.

Parameters:
  • limit (int) – Defaults to 100. This is the limit of manga that is returned in this request, it is clamped at 500 as that is the max in the API.

  • offset (int) – Defaults to 0. This is the pagination offset, the number must be greater than 0. If set lower than 0 then it is set to 0.

  • translated_language (List[LanguageCode]) – A list of language codes to filter the returned chapters with.

  • original_language (List[LanguageCode]) – A list of language codes to filter the original language of the returned chapters with.

  • excluded_original_language (List[LanguageCode]) – A list of language codes to negate filter the original language of the returned chapters with.

  • content_rating (Optional[List[ContentRating]]) – The content rating to filter the feed by.

  • excluded_groups (Optional[List[str]]) – The list of scanlator groups to exclude from the response.

  • excluded_uploaders (Optional[List[str]]) – The list of uploaders to exclude from the response.

  • include_future_updates (Optional[bool]) – Whether to include future release chapters from the feeds, defaults to "1" API side.

  • created_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their creation date.

  • updated_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their update date.

  • published_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their published date.

  • order (Optional[FeedOrderQuery]) – A query parameter to choose the ‘order by’ response from the API.

  • includes (Optional[ChapterIncludes]) – The optional data to include in the response.

  • include_empty_pages (Optional[bool]) – Whether to show chapters with no pages available.

  • include_future_publish_at (Optional[bool]) – Whether to show chapters with a publishAt value set in the future.

  • includeExternalUrl (Optional[bool]) – Whether to show chapters that have an external URL attached to them.

Note

If no start point is given with the created_at_since, updated_at_since or published_at_since parameters, then the API will return oldest first based on creation date.

Raises:

BadRequest – The query parameters were not valid.

Returns:

Returns a collection of chapters.

Return type:

ChapterFeed

await manga_list(*, limit: Optional[int] = 100, offset: int = 0, title: Optional[str] = None, author_or_artist: Optional[str] = None, authors: Optional[list[str]] = None, artists: Optional[list[str]] = None, year: Optional[int] = None, included_tags: Optional[QueryTags] = None, excluded_tags: Optional[QueryTags] = None, status: Optional[list[MangaStatus]] = None, original_language: Optional[list[common.LanguageCode]] = None, excluded_original_language: Optional[list[common.LanguageCode]] = None, available_translated_language: Optional[list[common.LanguageCode]] = None, publication_demographic: Optional[list[PublicationDemographic]] = None, ids: Optional[list[str]] = None, content_rating: Optional[list[ContentRating]] = None, created_at_since: Optional[datetime.datetime] = None, updated_at_since: Optional[datetime.datetime] = None, order: Optional[MangaListOrderQuery] = None, includes: Optional[MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>, has_available_chapters: Optional[bool] = None, group: Optional[str] = None) MangaCollection[source]#

This function is a coroutine.

This method will perform a search based on the passed query parameters for manga.

Parameters:
  • limit (Optional[int]) – Defaults to 100. This is the limit of manga that is returned in this request, it is clamped at 500 as that is the max in the API.

  • offset (int) – Defaults to 0. This is the pagination offset, the number must be greater than 0. If set lower than 0 then it is set to 0.

  • title (Optional[str]) – The manga title or partial title to include in the search.

  • author_or_artist (Optional[str]) – A uuid to filter the manga list that represents an author or artist.

  • authors (Optional[List[str]]) – The author(s) UUIDs to include in the search.

  • artists (Optional[List[str]]) – The artist(s) UUIDs to include in the search.

  • year (Optional[int]) – The release year of the manga to include in the search.

  • included_tags (Optional[QueryTags]) – An instance of hondana.QueryTags to include in the search.

  • excluded_tags (Optional[QueryTags]) – An instance of hondana.QueryTags to include in the search.

  • status (Optional[List[MangaStatus]]) – The status(es) of manga to include in the search.

  • original_language (Optional[List[LanguageCode]]) – A list of language codes to include for the manga’s original language. i.e. ["en"]

  • excluded_original_language (Optional[List[LanguageCode]]) – A list of language codes to exclude for the manga’s original language. i.e. ["en"]

  • available_translated_language (Optional[List[LanguageCode]]) – A list of language codes to filter they available translation languages in. i.e. ["en"]

  • publication_demographic (Optional[List[PublicationDemographic]]) – The publication demographic(s) to limit the search to.

  • ids (Optional[str]) – A list of manga UUID(s) to limit the search to.

  • content_rating (Optional[List[ContentRating]]) – The content rating(s) to filter the search to.

  • created_at_since (Optional[datetime.datetime]) – A (naive UTC) datetime instance we specify for searching. Used for returning manga created after this date.

  • updated_at_since (Optional[datetime.datetime]) – A (naive UTC) datetime instance we specify for searching. Used for returning manga updated after this date.

  • order (Optional[MangaListOrderQuery]) – A query parameter to choose the ordering of the response.

  • includes (Optional[MangaIncludes]) – A list of things to include in the returned manga response payloads. i.e. ["author", "cover_art", "artist"] Defaults to these values.

  • has_available_chapters (Optional[bool]) – Filter the manga list to only those that have chapters.

  • group (Optional[str]) – Filter the manga list to only those uploaded by this group.

Note

Passing None to limit will attempt to retrieve all items in the manga list.

Raises:

BadRequest – The query parameters were not valid.

Returns:

Returns a collection of Manga.

Return type:

MangaCollection

await create_manga(*, title: common.LocalizedString, alt_titles: Optional[list[common.LocalizedString]] = None, description: Optional[common.LocalizedString] = None, authors: Optional[list[str]] = None, artists: Optional[list[str]] = None, links: Optional[manga.MangaLinks] = None, original_language: str, last_volume: Optional[str] = None, last_chapter: Optional[str] = None, publication_demographic: Optional[PublicationDemographic] = None, status: MangaStatus, year: Optional[int] = None, content_rating: ContentRating, tags: Optional[QueryTags] = None, mod_notes: Optional[str] = None) Manga[source]#

This function is a coroutine.

This method will create a Manga within the MangaDex API for you.

Parameters:
  • title (LocalizedString) – The manga titles in the format of language_key: title i.e. {"en": "Some Manga Title"}

  • alt_titles (Optional[List[LocalizedString]]) – The alternative titles in the format of language_key: title i.e. [{"en": "Some Other Title"}, {"fr": "Un Autre Titre"}]

  • description (Optional[LocalizedString]) – The manga description in the format of language_key: description i.e. {"en": "My amazing manga where x y z happens"}

  • authors (Optional[List[str]]) – The list of author UUIDs to credit to this manga.

  • artists (Optional[List[str]]) – The list of artist UUIDs to credit to this manga.

  • links (Optional[MangaLinks]) – The links relevant to the manga. See here for more details: https://api.mangadex.org/docs.html#section/Static-data/Manga-links-data

  • original_language (str) – The language key for the original language of the manga.

  • last_volume (Optional[str]) – The last volume to attribute to this manga.

  • last_chapter (Optional[str]) – The last chapter to attribute to this manga.

  • publication_demographic (Optional[PublicationDemographic]) – The target publication demographic of this manga.

  • status (MangaStatus) – The status of the manga.

  • year (Optional[int]) – The release year of the manga.

  • content_rating (ContentRating) – The content rating of the manga.

  • tags (Optional[QueryTags]) – The QueryTags instance for the list of tags to attribute to this manga.

  • mod_notes (Optional[str]) – The moderator notes to add to this Manga.

Note

The mod_notes parameter requires the logged-in user to be a MangaDex moderator. Leave this as None unless you fit these criteria.

Raises:
  • BadRequest – The query parameters were not valid.

  • Forbidden – The query failed due to authorization failure.

Returns:

The manga that was returned after creation.

Return type:

Manga

await get_manga_volumes_and_chapters(manga_id: str, /, *, translated_language: Optional[list[common.LanguageCode]] = None, groups: Optional[list[str]] = None) manga.GetMangaVolumesAndChaptersResponse[source]#

This function is a coroutine.

This endpoint returns the raw relational mapping of a manga’s volumes and chapters.

Parameters:
  • manga_id (str) – The manga UUID we are querying against.

  • translated_language (Optional[List[LanguageCode]]) – The list of language codes you want to limit the search to.

  • groups (Optional[List[str]]) – A list of scanlator groups to filter the results by.

Returns:

The raw payload from mangadex. There is no guarantee of the keys here.

Return type:

GetMangaVolumesAndChaptersResponse

await get_manga(manga_id: str, /, *, includes: ~typing.Optional[~hondana.query.MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>) Manga[source]#

This function is a coroutine.

The method will fetch a Manga from the MangaDex API.

Parameters:
  • manga_id (str) – The UUID of the manga to view.

  • includes (Optional[MangaIncludes]) – The includes query parameter for this manga. If not given, it defaults to all possible reference expansions.

Raises:
  • Forbidden – The query failed due to authorization failure.

  • NotFound – The passed manga ID was not found, likely due to an incorrect ID.

Returns:

  • Manga – The Manga that was returned from the API.

  • .. versionadded:: 2.0.11

Return type:

Manga

await update_manga(manga_id: str, /, *, title: Optional[common.LocalizedString] = None, alt_titles: Optional[list[common.LocalizedString]] = None, description: Optional[common.LocalizedString] = None, authors: Optional[list[str]] = None, artists: Optional[list[str]] = None, links: Optional[manga.MangaLinks] = None, original_language: Optional[str] = None, last_volume: Optional[str] = ..., last_chapter: Optional[str] = ..., publication_demographic: Optional[PublicationDemographic] = ..., status: Optional[MangaStatus], year: Optional[int] = ..., content_rating: Optional[ContentRating] = None, tags: Optional[QueryTags] = None, primary_cover: Optional[str] = ..., version: int) Manga[source]#

This function is a coroutine.

This method will update a Manga within the MangaDex API.

Parameters:
  • manga_id (str) – The UUID of the manga to update.

  • title (Optional[LocalizedString]) – The manga titles in the format of language_key: title

  • alt_titles (Optional[List[LocalizedString]]) – The alternative titles in the format of language_key: title

  • description (Optional[LocalizedString]) – The manga description in the format of language_key: description

  • authors (Optional[List[str]]) – The list of author UUIDs to credit to this manga.

  • artists (Optional[List[str]]) – The list of artist UUIDs to credit to this manga.

  • links (Optional[MangaLinks]) – The links relevant to the manga.

  • original_language (Optional[str]) – The language key for the original language of the manga.

  • last_volume (Optional[str]) – The last volume to attribute to this manga.

  • last_chapter (Optional[str]) – The last chapter to attribute to this manga.

  • publication_demographic (PublicationDemographic) – The target publication demographic of this manga.

  • status (Optional[MangaStatus]) – The status of the manga.

  • year (Optional[int]) – The release year of the manga.

  • content_rating (Optional[ContentRating]) – The content rating of the manga.

  • tags (Optional[QueryTags]) – The QueryTags instance for the list of tags to attribute to this manga.

  • primary_cover (Optional[str]) – The primary cover for this Manga.

  • version (int) – The revision version of this manga.

Note

The last_volume, last_chapter, publication_demographic, year and primary_cover parameters are nullable in the API, pass None explicitly to do this.

Raises:
  • BadRequest – The query parameters were not valid.

  • Forbidden – The returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

Returns:

The manga that was returned after creation.

Return type:

Manga

await delete_manga(manga_id: str, /) None[source]#

This function is a coroutine.

This method will delete a manga within the MangaDex API.

Parameters:

manga_id (str) – The ID of the manga we are deleting.

Raises:
  • Forbidden – The request returned an error due to authentication failure.

  • NotFound – The specified manga doesn’t exist.

await unfollow_manga(manga_id: str, /) None[source]#

This function is a coroutine.

This method will unfollow a Manga for the logged-in user in the MangaDex API.

Parameters:

manga_id (str) – The UUID of the manga to unfollow.

Raises:
  • Forbidden – The request returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

await follow_manga(manga_id: str, /, *, set_status: bool = True, status: ReadingStatus = ReadingStatus.reading) None[source]#

This function is a coroutine.

This method will follow a Manga for the logged-in user in the MangaDex API.

Parameters:
  • manga_id (str) – The UUID of the manga to follow.

  • set_status (bool) – Whether to set the reading status of the manga you follow. Due to the current MangaDex infrastructure, not setting a status will cause the manga to not show up in your lists. Defaults to True

  • status (ReadingStatus) – The status to apply to the newly followed manga. Irrelevant if set_status is False.

Raises:
  • Forbidden – The request returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

await manga_feed(manga_id: str, /, *, limit: ~typing.Optional[int] = 100, offset: int = 0, translated_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, excluded_original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, content_rating: ~typing.Optional[list[hondana.enums.ContentRating]] = None, excluded_groups: ~typing.Optional[list[str]] = None, excluded_uploaders: ~typing.Optional[list[str]] = None, include_future_updates: ~typing.Optional[bool] = None, created_at_since: ~typing.Optional[~datetime.datetime] = None, updated_at_since: ~typing.Optional[~datetime.datetime] = None, published_at_since: ~typing.Optional[~datetime.datetime] = None, order: ~typing.Optional[~hondana.query.FeedOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>, include_empty_pages: ~typing.Optional[bool] = None, include_future_publish_at: ~typing.Optional[bool] = None, include_external_url: ~typing.Optional[bool] = None) ChapterFeed[source]#

This function is a coroutine.

This method returns the specified manga’s chapter feed.

Parameters:
  • manga_id (str) – The UUID of the manga whose feed we are requesting.

  • limit (Optional[int]) – Defaults to 100. The maximum amount of chapters to return in the response.

  • offset (int) – Defaults to 0. The pagination offset for the request.

  • translated_language (List[LanguageCode]) – A list of language codes to filter the returned chapters with.

  • original_language (List[LanguageCode]) – A list of language codes to filter the original language of the returned chapters with.

  • excluded_original_language (List[LanguageCode]) – A list of language codes to negate filter the original language of the returned chapters with.

  • content_rating (Optional[List[ContentRating]]) – The content rating to filter the feed by.

  • excluded_groups (Optional[List[str]]) – The list of scanlator groups to exclude from the response.

  • excluded_uploaders (Optional[List[str]]) – The list of uploaders to exclude from the response.

  • include_future_updates (Optional[bool]) – Whether to include future chapters from this feed. Defaults to "1" API side.

  • created_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their creation date.

  • updated_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their updated at date.

  • published_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their published at date.

  • order (Optional[FeedOrderQuery]) – A query parameter to choose how the responses are ordered.

  • includes (Optional[ChapterIncludes]) – The options to include increased payloads for per chapter. Defaults to all values.

  • include_empty_pages (Optional[bool]) – Whether to show chapters with no pages available.

  • include_future_publish_at (Optional[bool]) – Whether to show chapters with a publishAt value set in the future.

  • includeExternalUrl (Optional[bool]) – Whether to show chapters that have an external URL attached to them.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:

BadRequest – The query parameters were malformed.

Returns:

Returns a collection of chapters.

Return type:

ChapterFeed

await manga_read_markers(*, manga_ids: list[str]) Union[manga.MangaReadMarkersResponse, manga.MangaGroupedReadMarkersResponse][source]#

This function is a coroutine.

This method will return the read chapters of the passed manga if singular, or all manga if plural.

Parameters:

manga_ids (List[str]) – A list of a single manga UUID or a list of many manga UUIDs.

Return type:

Union[MangaReadMarkersResponse, MangaGroupedReadMarkersResponse]

await batch_update_manga_read_markers(manga_id: str, /, *, update_history: bool = True, read_chapters: Optional[list[str]] = None, unread_chapters: Optional[list[str]] = None) None[source]#

This function is a coroutine.

This method will batch update your read chapters for a given Manga.

Parameters:
  • manga_id (str) – The Manga we are updating read chapters for.

  • update_history (bool) – Whether to show this chapter in the authenticated user’s read history. Defaults to True.

  • read_chapters (Optional[List[str]]) – The read chapters for this Manga.

  • unread_chapters (Optional[List[str]]) – The unread chapters for this Manga.

Raises:

TypeError – You must provide one or both of the parameters read_chapters and/or unread_chapters.

await get_random_manga(*, includes: Optional[MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>, content_rating: Optional[list[ContentRating]] = None, included_tags: Optional[QueryTags] = None, excluded_tags: Optional[QueryTags] = None) Manga[source]#

This function is a coroutine.

This method will return a random manga from the MangaDex API.

Parameters:
  • includes (Optional[MangaIncludes]) – The optional includes for the manga payload. Defaults to all possible reference expansions.

  • content_rating (Optional[List[ContentRating]]) – The content ratings to filter the random manga by

  • included_tags (Optional[QueryTags]) – The tags and search mode to use for inclusion.

  • excluded_tags (Optional[QueryTags]) – The tags and search mode to use for exclusion.

Returns:

The random Manga that was returned.

Return type:

Manga

await get_my_followed_manga(*, limit: ~typing.Optional[int] = 100, offset: int = 0, includes: ~typing.Optional[~hondana.query.MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>) MangaCollection[source]#

This function is a coroutine.

This method will return an object containing all the followed manga from the currently logged-in user.

Parameters:
  • limit (Optional[int]) – The amount of items we are requesting.

  • offset (int) – The pagination offset for the items we are requesting.

  • includes (Optional[MangaIncludes]) – The optional includes to add to the api responses.

Note

Passing None to limit will attempt to retrieve all items in the followed manga list.

Returns:

Returns a collection of manga.

Return type:

MangaCollection

await get_all_manga_reading_status(*, status: Optional[ReadingStatus] = None) manga.MangaMultipleReadingStatusResponse[source]#

This function is a coroutine.

This method will return the current reading status of all manga in the logged-in user’s library.

Parameters:

status (Optional[ReadingStatus]) – The reading status to filter the response with.

Returns:

The payload returned from MangaDex.

Return type:

MangaMultipleReadingStatusResponse

await get_manga_reading_status(manga_id: str, /) manga.MangaSingleReadingStatusResponse[source]#

This function is a coroutine.

This method will return the current reading status for the specified manga.

Parameters:

manga_id (str) – The UUID associated with the manga you wish to query.

Raises:
  • Forbidden – You are not authenticated to perform this action.

  • NotFound – The specified manga does not exist, likely due to an incorrect ID.

Returns:

The raw response from the API on the request.

Return type:

MangaSingleReadingStatusResponse

await update_manga_reading_status(manga_id: str, /, *, status: ReadingStatus) None[source]#

This function is a coroutine.

This method will update your current reading status for the specified manga.

Parameters:
  • manga_id (str) – The UUID associated with the manga you wish to update.

  • status (Optional[ReadingStatus]) – The reading status you wish to update this manga with.

Note

Leaving status as the default will remove the manga reading status from the API. Please provide a value if you do not wish for this to happen.

Raises:
  • BadRequest – The query parameters were invalid.

  • NotFound – The specified manga cannot be found, likely due to incorrect ID.

await get_manga_draft(manga_id: str, /) Manga[source]#

This function is a coroutine.

This method will return a manga draft from MangaDex.

Parameters:

manga_id (str) – The ID relation to the manga draft.

Returns:

The Manga returned from the API.

Return type:

Manga

await submit_manga_draft(manga_id: str, /, *, version: int) Manga[source]#

This function is a coroutine.

This method will submit a draft for a manga.

Parameters:
  • manga_id (str) – The ID relating to the manga we are submitting to.

  • version (int) – The version of the manga we’re attributing this submission to.

Return type:

Manga

Raises:
  • BadRequest – The request parameters were incorrect or malformed.

  • Forbidden – You are not authorised to perform this action.

  • NotFound – The manga was not found.

await get_manga_draft_list(*, limit: int = 10, offset: int = 0, state: ~typing.Optional[~hondana.enums.MangaState] = None, order: ~typing.Optional[~hondana.query.MangaDraftListOrderQuery] = None, includes: ~typing.Optional[~hondana.query.MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>) Manga[source]#

This function is a coroutine.

This method will return all drafts for a given manga.

Parameters:
  • limit (int) – The limit of objects to return. Defaults to 10.

  • offset (int) – The pagination offset. Defaults to 0.

  • state (Optional[MangaState]) – The state of the submission to filter by.

  • order (Optional[MangaDraftListOrderQuery]) – The order parameter for order the responses.

  • includes (Optional[MangaIncludes]) – The optional includes to request in the responses.

Return type:

Manga

await get_manga_relation_list(manga_id: str, /, *, includes: ~typing.Optional[~hondana.query.MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>) MangaRelationCollection[source]#

This function is a coroutine.

This method will return a list of all relations to a given manga.

Parameters:
  • manga_id (str) – The ID for the manga we wish to query against.

  • includes (Optional[MangaIncludes]) – The optional parameters for expanded requests to the API. Defaults to all possible expansions.

Return type:

MangaRelationCollection

Raises:

BadRequest – The manga ID passed is malformed

await create_manga_relation(manga_id: str, /, *, target_manga: str, relation_type: MangaRelationType) MangaRelation[source]#

This function is a coroutine.

This method will create a manga relation.

Parameters:
  • manga_id (str) – The manga ID we are creating a relation to.

  • target_manga (str) – The manga ID of the related manga.

  • relation_type (MangaRelationType) – The relation type we are creating.

Return type:

MangaRelation

Raises:
  • BadRequest – The parameters were malformed

  • Forbidden – You are not authorised for this action.

await delete_manga_relation(manga_id: str, relation_id: str, /) None[source]#

This function is a coroutine.

This method will delete a manga relation.

Parameters:
  • manga_id (str) – The ID of the source manga.

  • relation_id (str) – The ID of the related manga.

await add_manga_to_custom_list(manga_id: str, /, *, custom_list_id: str) None[source]#

This function is a coroutine.

This method will add the specified manga to the specified custom list.

Parameters:
  • manga_id (str) – The UUID associated with the manga you wish to add to the custom list.

  • custom_list_id (str) – The UUID associated with the custom list you wish to add the manga to.

Raises:
  • Forbidden – You are not authorised to add manga to this custom list.

  • NotFound – The specified manga or specified custom list are not found, likely due to an incorrect UUID.

await remove_manga_from_custom_list(manga_id: str, /, *, custom_list_id: str) None[source]#

This function is a coroutine.

This method will remove the specified manga from the specified custom list.

Parameters:
  • manga_id (str) – The UUID associated with the manga you wish to remove from the specified custom list.

  • custom_list_id (str) – THe UUID associated with the custom list you wish to add the manga to.

Raises:
  • Forbidden – You are not authorised to remove a manga from the specified custom list.

  • NotFound – The specified manga or specified custom list are not found, likely due to an incorrect UUID.

await chapter_list(*, limit: ~typing.Optional[int] = 100, offset: int = 0, ids: ~typing.Optional[list[str]] = None, title: ~typing.Optional[str] = None, groups: ~typing.Optional[list[str]] = None, uploader: ~typing.Optional[~typing.Union[str, list[str]]] = None, manga: ~typing.Optional[str] = None, volume: ~typing.Optional[~typing.Union[str, list[str]]] = None, chapter: ~typing.Optional[~typing.Union[str, list[str]]] = None, translated_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, excluded_original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, content_rating: ~typing.Optional[list[hondana.enums.ContentRating]] = None, excluded_groups: ~typing.Optional[list[str]] = None, excluded_uploaders: ~typing.Optional[list[str]] = None, include_future_updates: ~typing.Optional[bool] = None, include_empty_pages: ~typing.Optional[bool] = None, include_future_publish_at: ~typing.Optional[bool] = None, include_external_url: ~typing.Optional[bool] = None, created_at_since: ~typing.Optional[~datetime.datetime] = None, updated_at_since: ~typing.Optional[~datetime.datetime] = None, published_at_since: ~typing.Optional[~datetime.datetime] = None, order: ~typing.Optional[~hondana.query.FeedOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>) ChapterFeed[source]#

This function is a coroutine.

This method will return a list of published chapters.

Parameters:
  • limit (Optional[int]) – Defaults to 100. This specifies the amount of chapters to return in one request.

  • offset (int) – Defaults to 0. This specifies the pagination offset.

  • ids (Optional[List[str]]) – The list of chapter UUIDs to filter the request with.

  • title (Optional[str]) – The chapter title query to limit the request with.

  • groups (Optional[List[str]]) – The scanlation group UUID(s) to limit the request with.

  • uploader (Optional[Union[str, List[str]]]) – The uploader UUID to limit the request with.

  • manga (Optional[str]) – The manga UUID to limit the request with.

  • volume (Optional[Union[str, List[str]]]) – The volume UUID or UUIDs to limit the request with.

  • chapter (Optional[Union[str, List[str]]]) – The chapter UUID or UUIDs to limit the request with.

  • translated_language (Optional[List[LanguageCode]]) – The list of languages codes to filter the request with.

  • original_language (Optional[List[LanguageCode]]) – The list of languages to specifically target in the request.

  • excluded_original_language (Optional[List[LanguageCode]]) – The list of original languages to exclude from the request.

  • content_rating (Optional[List[ContentRating]]) – The content rating to filter the feed by.

  • excluded_groups (Optional[List[str]]) – The list of scanlator groups to exclude from the response.

  • excluded_uploaders (Optional[List[str]]) – The list of uploaders to exclude from the response.

  • include_future_updates (Optional[bool]) – Whether to include future chapters in this feed. Defaults to True API side.

  • include_empty_pages (Optional[bool]) – Whether to include chapters that have no recorded pages.

  • include_future_publish_at (Optional[bool]) – Whether to include chapters that have a publish_at set to a time in the future.

  • include_external_url (Optional[bool]) – Whether to include chapters that have an external url set.

  • created_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their creation date.

  • updated_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their updated at date.

  • published_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their published at date.

  • order (Optional[FeedOrderQuery]) – A query parameter to choose how the responses are ordered.

  • includes (Optional[ChapterIncludes]) – The list of options to include increased payloads for per chapter. Defaults to all possible expansions.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Note

If order is not specified then the API will return results first based on their creation date, which could lead to unexpected results.

Raises:
  • BadRequest – The query parameters were malformed

  • Forbidden – The request returned an error due to authentication failure.

Returns:

Returns a collection of chapters.

Return type:

ChapterFeed

await get_chapter(chapter_id: str, /, *, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>, fetch_full_manga: bool = False) Chapter[source]#

This function is a coroutine.

This method will retrieve a single chapter from the MangaDex API.

Parameters:
  • chapter_id (str) – The UUID representing the chapter we are fetching.

  • includes (Optional[ChapterIncludes]) – The reference expansion includes we are requesting with this payload. Defaults to all possible expansions.

  • fetch_full_manga (bool) – This parameter will fetch the full manga object with the chapter if set to True. Defaults to False.

Note

fetch_full_manga when True will result in an extra API request to fetch the full manga data.

Returns:

The Chapter we fetched from the API.

Return type:

Chapter

await update_chapter(chapter_id: str, /, *, title: Optional[str] = None, volume: str = ..., chapter: str = ..., translated_language: Optional[str] = None, groups: Optional[list[str]] = None, version: int) Chapter[source]#

This function is a coroutine.

This method will update a chapter in the MangaDex API.

Parameters:
  • chapter_id (str) – The UUID representing the chapter we are going to update.

  • title (Optional[str]) – The title to rename the chapter to, if given.

  • volume (Optional[str]) – The volume identity that this chapter belongs to, if any.

  • chapter (Optional[str]) – The chapter identity marking this chapter, if any.

  • translated_language (Optional[str]) – The language code this chapter is translated to.

  • groups (Optional[str]) – The UUIDs representing credited scanlation groups for this chapter.

  • version (int) – The version revision of this chapter.

Note

The volume and chapter keys are nullable, pass None to them to send null to the API

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to update this chapter.

  • NotFound – One or more UUIDs given were not found.

Returns:

The chapter after being updated.

Return type:

Chapter

await delete_chapter(chapter_id: str, /) None[source]#

This function is a coroutine.

This method will delete a chapter from the MangaDex API.

Parameters:

chapter_id (str) – The UUID of the chapter you wish to delete.

Raises:
  • BadRequest – The query was malformed.

  • Forbidden – You are not authorized to delete this chapter.

  • NotFound – The UUID passed for this chapter does not relate to a chapter in the API.

await my_chapter_read_history() ChapterReadHistoryCollection[source]#

This function is a coroutine.

This method will return the last 30 chapters of read history for the currently logged in user.

Raises:
  • Forbidden – You are not authorized to access this endpoint.

  • NotFound – You do not have any read history.

Returns:

A rich type around the returned data.

Return type:

ChapterReadHistoryCollection

await cover_art_list(*, limit: ~typing.Optional[int] = 10, offset: int = 0, manga: ~typing.Optional[list[str]] = None, ids: ~typing.Optional[list[str]] = None, uploaders: ~typing.Optional[list[str]] = None, locales: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, order: ~typing.Optional[~hondana.query.CoverArtListOrderQuery] = None, includes: ~typing.Optional[~hondana.query.CoverIncludes] = <CoverIncludes manga=True user=True>) CoverCollection[source]#

This function is a coroutine.

This method will fetch a list of cover arts from the MangaDex API.

Parameters:
  • limit (int) – Defaults to 10. This specifies the amount of scanlator groups to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

  • manga (Optional[List[str]]) – A list of manga UUID(s) to limit the request to.

  • ids (Optional[List[str]]) – A list of cover art UUID(s) to limit the request to.

  • uploaders (Optional[List[str]]) – A list of uploader UUID(s) to limit the request to.

  • locales (Optional[List[LanguageCode]]) – The locales to filter this search by.

  • order (Optional[CoverArtListOrderQuery]) – A query parameter to choose how the responses are ordered.

  • includes (Optional[CoverIncludes]) – The optional includes to request increased payloads during the request.

Raises:
  • BadRequest – The request parameters were malformed.

  • Forbidden – The request returned an error due to authentication failure.

Returns:

Returns a collection of covers.

Return type:

CoverCollection

await upload_cover(manga_id: str, /, *, cover: bytes, volume: Optional[str] = None, description: str, locale: Optional[hondana.types.common.LanguageCode] = None) Cover[source]#

This function is a coroutine.

This method will upload a cover to the MangaDex API.

Parameters:
  • manga_id (str) – The ID relating to the manga this cover belongs to.

  • cover (bytes) – THe raw bytes of the image.

  • volume (Optional[str]) – The volume this cover relates to.

  • description (str) – The description of this cover.

  • locale (Optional[LanguageCode]) – The locale of this cover.

Raises:
  • BadRequest – The volume parameter was malformed or the file was a bad format.

  • Forbidden – You are not permitted for this action.

Return type:

Cover

await get_cover(cover_id: str, /, *, includes: ~typing.Optional[~hondana.query.CoverIncludes] = <CoverIncludes manga=True user=True>) Cover[source]#

This function is a coroutine.

The method will fetch a Cover from the MangaDex API.

Parameters:
  • cover_id (str) – The id of the cover we are fetching from the API.

  • includes (Optional[CoverIncludes]) – A list of the additional information to gather related to the Cover.

Note

If you do not include the "manga" includes, then we will not be able to get the cover url.

Raises:

NotFound – The passed cover ID was not found, likely due to an incorrect ID.

Returns:

The Cover returned from the API.

Return type:

Cover

await edit_cover(cover_id: str, /, *, volume: str = ..., description: str = ..., version: int) Cover[source]#

This function is a coroutine.

This method will edit a cover on the MangaDex API.

Parameters:
  • cover_id (str) – The UUID relating to the cover you wish to edit.

  • volume (str) – The volume identifier relating the cover will represent.

  • description (Optional[str]) – The description of the cover.

  • version (int) – The version revision of the cover.

Note

The volume key is mandatory. You can pass None to null it in the API, but it must have a value.

Raises:
  • TypeError – The volume key was not given a value. This is required.

  • BadRequest – The request body was malformed.

  • Forbidden – The request returned an error due to authentication failure.

Returns:

The returned cover after the edit.

Return type:

Cover

await delete_cover(cover_id: str, /) None[source]#

This function is a coroutine.

This method will delete a cover from the MangaDex API.

Parameters:

cover_id (str) – The UUID relating to the cover you wish to delete.

Raises:
  • BadRequest – The request payload was malformed.

  • Forbidden – The request returned an error due to authentication.

await scanlation_group_list(*, limit: ~typing.Optional[int] = 10, offset: int = 0, ids: ~typing.Optional[list[str]] = None, name: ~typing.Optional[str] = None, focused_language: ~typing.Optional[hondana.types.common.LanguageCode] = None, order: ~typing.Optional[~hondana.query.ScanlatorGroupListOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ScanlatorGroupIncludes] = <ScanlatorGroupIncludes leader=True member=True>) ScanlatorGroupCollection[source]#

This function is a coroutine.

This method will return a list of scanlator groups from the MangaDex API.

Parameters:
  • limit (Optional[int]) – Defaults to 10. This specifies the amount of scanlator groups to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

  • ids (Optional[List[str]]) – A list of scanlator group UUID(s) to limit the request to.

  • name (Optional[str]) – A name to limit the request to.

  • focused_language (Optional[LanguageCode]) – A focused language to limit the request to.

  • order (Optional[ScanlatorGroupListOrderQuery]) – An ordering statement for the request.

  • includes (Optional[ScanlatorGroupIncludes]) – An optional list of includes to request increased payloads during the request.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:
  • BadRequest – The query parameters were malformed

  • Forbidden – The request returned an error due to authentication failure.

Returns:

A returned collection of scanlation groups.

Return type:

ScanlatorGroupCollection

await user_list(*, limit: Optional[int] = 10, offset: int = 0, ids: Optional[list[str]] = None, username: Optional[str] = None, order: Optional[UserListOrderQuery] = None) UserCollection[source]#

This function is a coroutine.

This method will return a list of Users from the MangaDex API.

Parameters:
  • limit (Optional[int]) – Defaults to 10. This specifies the amount of users to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

  • ids (Optional[List[str]]) – A list of User UUID(s) to limit the request to.

  • username (Optional[str]) – The username to limit this request to.

  • order (Optional[UserListOrderQuery]) – The optional query param on how the response will be ordered.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:
  • BadRequest – The request parameters were malformed

  • Forbidden – The request returned an error due to authentication failure.

Returns:

A returned collection of users.

Return type:

UserCollection

await get_user(user_id: str, /) User[source]#

This function is a coroutine.

This method will fetch a user from the MangaDex API.

Parameters:

user_id (str) – The UUID of the user you wish to fetch

Returns:

The user returned from the API.

Return type:

User

await delete_user(user_id: str, /) None[source]#

This function is a coroutine.

This method will initiate the deletion of a user from the MangaDex API.

Parameters:

user_id (str) – The UUID of the user you wish to delete.

Raises:
  • Forbidden – The response returned an error due to authentication failure.

  • NotFound – The user specified cannot be found.

await approve_user_deletion(approval_code: str, /) None[source]#

This function is a coroutine.

This method will approve a user deletion in the MangaDex API.

Parameters:

approval_code (str) – The UUID representing the approval code to delete the user.

await update_user_password(*, old_password: str, new_password: str) None[source]#

This function is a coroutine.

This method will change the current authenticated user’s password.

Parameters:
  • old_password (str) – The current (old) password we will be changing from.

  • new_password (str) – The new password we will be changing to.

Raises:

Forbidden – The request returned an error due to an authentication issue.

await update_user_email(email: str, /) None[source]#

This function is a coroutine.

This method will update the current authenticated user’s email.

Parameters:

email (str) – The new email address to change to.

Raises:

Forbidden – The API returned an error due to authentication failure.

await get_my_details() User[source]#

This function is a coroutine.

This method will return the current authenticated user’s details.

Raises:

Forbidden – The request returned an error due to authentication failure.

Returns:

Your current user details returned from the API.

Return type:

User

await get_my_followed_groups(limit: int = 10, offset: int = 0) list[hondana.scanlator_group.ScanlatorGroup][source]#

This function is a coroutine.

This method will return a list of scanlation groups the current authenticated user follows.

Parameters:
  • limit (int) – Defaults to 10. The amount of groups to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

Raises:

Forbidden – The request returned an error due to authentication failure.

Returns:

The list of groups that are being followed.

Return type:

List[ScanlatorGroup]

await check_if_following_group(group_id: str, /) bool[source]#

This function is a coroutine.

This method will check if the current authenticated user is following a scanlation group.

Parameters:

group_id (str) – The UUID representing the scanlation group you wish to check.

Returns:

Whether the passed scanlation group is followed or not.

Return type:

bool

await get_my_followed_users(*, limit: Optional[int] = 10, offset: int = 0) UserCollection[source]#

This function is a coroutine.

This method will return the current authenticated user’s followed users.

Parameters:
  • limit (Optional[int]) – Defaults to 10. The amount of users to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:

Forbidden – The request returned an error due to authentication failure.

Returns:

A returned collection of users.

Return type:

UserCollection

await check_if_following_user(user_id: str, /) bool[source]#

This function is a coroutine.

This method will check if the current authenticated user is following the specified user.

Parameters:

user_id (str) – The UUID relating to the user you wish to query against.

Raises:

Forbidden – The requested returned an error due to authentication failure.

Returns:

Whether the target user is followed or not.

Return type:

bool

await check_if_following_manga(manga_id: str, /) bool[source]#

This function is a coroutine.

This method will check if the current authenticated user is following the specified manga.

Parameters:

manga_id (str) – The UUID relating to the manga you wish to query against.

Raises:

Forbidden – The request returned an error due to authentication failure.

Returns:

Whether the target manga is followed or not.

Return type:

bool

await get_my_custom_list_follows(limit: int = 10, offset: int = 0) list[hondana.custom_list.CustomList][source]#

This function is a coroutine.

This method will return the current authenticated user’s custom list follows.

Returns:

The list of custom lists you follow.

Return type:

list[CustomList]

await check_if_following_custom_list(custom_list_id: str, /) bool[source]#

This function is a coroutine.

This method will check if the current authenticated user is following the specified custom list.

Returns:

Whether you follow this custom list or not.

Return type:

bool

await create_account(*, username: str, password: str, email: str) User[source]#

This function is a coroutine.

This method will create an account with the passed parameters within the MangaDex API.

Parameters:
  • username (str) – The username you wish to use in the new account.

  • password (str) – The password to use in the new account.

  • email (str) – The email address to use in the new account.

Note

The created account will still need to be activated.

Raises:

BadRequest – The parameters passed were malformed.

Returns:

The created user.

Return type:

User

await activate_account(activation_code: str, /) None[source]#

This function is a coroutine.

This method will activate an account on the MangaDex API.

Parameters:

activation_code (str) – The activation code for the account.

Raises:
  • BadRequest – The query was malformed.

  • NotFound – The activation code passed was not a valid one.

await resend_activation_code(email: str, /) None[source]#

This function is a coroutine.

This method will resend an activation code to the specified email.

Parameters:

email (str) – The email to resend the activation code to.

Raises:

BadRequest – The email passed is not pending activation.

await recover_account(email: str, /) None[source]#

This function is a coroutine.

This method will start an account recovery process on the given account. Effectively triggering the “forgotten password” email to be sent.

Parameters:

email (str) – The email address belonging to the account you wish to recover.

Raises:

BadRequest – The email does not belong to a matching account.

await complete_account_recovery(recovery_code: str, /, *, new_password: str) None[source]#

This function is a coroutine.

This method will complete an account recovery process.

Parameters:
  • recovery_code (str) – The recovery code given during the recovery process.

  • new_password (str) – The new password to use for the recovered account.

Raises:

BadRequest – The recovery code given was not found or the password was greater than 1024 characters.

await ping_the_server() bool[source]#

This function is a coroutine.

This method will return a simple ‘pong’ response from the API. Mainly a small endpoint to check the API is alive and responding.

Returns:

Whether and ‘pong’ response was received.

Return type:

bool

await legacy_id_mapping(type: hondana.types.legacy.LegacyMappingType, /, *, item_ids: list[int]) LegacyMappingCollection[source]#

This function is a coroutine.

This method will return a small response from the API to retrieve a legacy MangaDex’s new details.

Parameters:
  • type (LegacyMappingType) – The type of the object we are querying.

  • item_ids (List[int]) – The legacy integer IDs of MangaDex items.

Raises:

BadRequest – The query was malformed.

Returns:

The list of returned items from this query.

Return type:

LegacyMappingCollection

await get_at_home_url(chapter_id: str, /, *, ssl: bool = True) str[source]#

This function is a coroutine.

This method will retrieve a MangaDex@Home URL for accessing a chapter.

Parameters:
  • chapter_id (str) – The UUID of the chapter we are retrieving a URL for.

  • ssl (bool) – Defaults to True. Whether to require the MangaDex @ Home node be available on port 443. If False is selected, then the MD@H node we request may be available on a non-standard port.

Raises:

NotFound – The specified chapter ID was not found.

Returns:

Returns the URL we requested.

Return type:

str

await create_custom_list(*, name: str, visibility: Optional[CustomListVisibility] = None, manga: Optional[list[str]] = None) CustomList[source]#

This function is a coroutine.

This method will create a custom list within the MangaDex API.

Parameters:
  • name (str) – The name of this custom list.

  • visibility (Optional[CustomListVisibility]) – The visibility of this custom list.

  • manga (Optional[List[str]]) – A list of manga IDs to add to this custom list.

Raises:
  • BadRequest – The payload was malformed.

  • NotFound – One of the passed Manga IDs was not found.

Returns:

The custom list that was created.

Return type:

CustomList

await get_custom_list(custom_list_id: str, /, *, includes: ~typing.Optional[~hondana.query.CustomListIncludes] = <CustomListIncludes manga=True user=True owner=True>) CustomList[source]#

This function is a coroutine.

This method will retrieve a custom list from the MangaDex API.

Parameters:
  • custom_list_id (str) – The UUID associated with the custom list we wish to retrieve.

  • includes (Optional[CustomListIncludes]) – The list of additional data to request in the payload.

Raises:

NotFound – The custom list with this ID was not found.

Returns:

The retrieved custom list.

Return type:

CustomList

await update_custom_list(custom_list_id: str, /, *, name: Optional[str] = None, visibility: Optional[CustomListVisibility] = None, manga: Optional[list[str]] = None, version: int) CustomList[source]#

This function is a coroutine.

This method will update a custom list within the MangaDex API.

Parameters:
  • custom_list_id (str) – The custom list ID we wish to update.

  • name (Optional[str]) – The name we wish to edit the custom list with.

  • visibility (Optional[CustomListVisibility]) – The visibility we wish to edit the custom list with.

  • manga (Optional[List[str]]) – The list of manga IDs to edit this custom list with.

  • version (int) – The version revision of this custom list.

Note

Updating a custom list is an atomic action. Passing the manga key here will overwrite the manga in this custom list.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to edit this custom list.

  • NotFound – The custom list was not found, or one of the manga passed was not found.

Returns:

The returned custom list after it was updated.

Return type:

CustomList

await delete_custom_list(custom_list_id: str, /) None[source]#

This function is a coroutine.

This method will delete a custom list from the MangaDex API.

Parameters:

custom_list_id (str) – The UUID relating to the custom list we wish to delete.

Raises:
  • Forbidden – You are not authorized to delete this custom list.

  • NotFound – The custom list with this UUID was not found.

await follow_custom_list(custom_list_id: str, /) None[source]#

This function is a coroutine.

This method will follow a custom list within the MangaDex API.

Parameters:

custom_list_id (str) – The UUID relating to the custom list we wish to follow.

Raises:
  • BadRequest – The request was malformed.

  • Forbidden – You are not authorized to follow this custom list.

  • NotFound – The specified custom list does not exist.

await unfollow_custom_list(custom_list_id: str, /) None[source]#

This function is a coroutine.

The method will unfollow a custom list within the MangaDex API.

Parameters:

custom_list_id (str) – The UUID relating to the custom list we wish to unfollow.

Raises:
  • Forbidden – You are not authorized to unfollow this custom list.

  • NotFound – The specified custom list does not exist.

await get_my_custom_lists(*, limit: Optional[int] = 10, offset: int = 0) CustomListCollection[source]#

This function is a coroutine.

This method will get the current authenticated user’s custom list.

Parameters:
  • limit (Optional[int]) – Defaults to 10. The amount of custom lists to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:

Forbidden – The request returned an error due to authentication failure.

Returns:

A returned collection of custom lists.

Return type:

CustomListCollection

await get_users_custom_lists(user_id: str, /, *, limit: Optional[int] = 10, offset: int = 0) CustomListCollection[source]#

This function is a coroutine.

This method will retrieve another user’s custom lists.

Parameters:
  • user_id (str) – The UUID of the user whose lists we wish to retrieve.

  • limit (Optional[int]) – Defaults to 10. The amount of custom lists to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:

Forbidden – The request returned an error due to authentication failure.

Returns:

A returned collection of custom lists.

Return type:

CustomListCollection

await get_custom_list_manga_feed(custom_list_id: str, /, *, limit: ~typing.Optional[int] = 100, offset: int = 0, translated_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, excluded_original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, content_rating: ~typing.Optional[list[hondana.enums.ContentRating]] = None, excluded_groups: ~typing.Optional[list[str]] = None, excluded_uploaders: ~typing.Optional[list[str]] = None, include_future_updates: ~typing.Optional[bool] = None, created_at_since: ~typing.Optional[~datetime.datetime] = None, updated_at_since: ~typing.Optional[~datetime.datetime] = None, published_at_since: ~typing.Optional[~datetime.datetime] = None, order: ~typing.Optional[~hondana.query.FeedOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>, include_empty_pages: ~typing.Optional[bool] = None, include_future_publish_at: ~typing.Optional[bool] = None, include_external_url: ~typing.Optional[bool] = None) ChapterFeed[source]#

This function is a coroutine.

This method returns the specified manga’s chapter feed.

Parameters:
  • custom_list_id (str) – The UUID of the custom list whose feed we are requesting.

  • limit (Optional[int]) – Defaults to 100. The maximum amount of chapters to return in the response.

  • offset (int) – Defaults to 0. The pagination offset for the request.

  • translated_language (List[LanguageCode]) – A list of language codes to filter the returned chapters with.

  • original_language (List[LanguageCode]) – A list of language codes to filter the original language of the returned chapters with.

  • excluded_original_language (List[LanguageCode]) – A list of language codes to negate filter the original language of the returned chapters with.

  • content_rating (Optional[List[ContentRating]]) – The content rating to filter this query with.

  • excluded_groups (Optional[List[str]]) – The list of scanlator groups to exclude from the response.

  • excluded_uploaders (Optional[List[str]]) – The list of uploaders to exclude from the response.

  • include_future_updates (Optional[bool]) – Whether to include future chapters in this feed. Defaults to True API side.

  • created_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their creation date.

  • updated_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their updated at date.

  • published_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their published at date.

  • order (Optional[FeedOrderQuery]) – A query parameter to choose how the responses are ordered. i.e. {"chapters": "desc"}

  • includes (Optional[ChapterIncludes]) – The list of optional includes we request the data for. Defaults to all possible expansions.

  • include_empty_pages (Optional[bool]) – Whether to show chapters with no pages available.

  • include_future_publish_at (Optional[bool]) – Whether to show chapters with a publishAt value set in the future.

  • includeExternalUrl (Optional[bool]) – Whether to show chapters that have an external URL attached to them.

Raises:
  • BadRequest – The query parameters were malformed.

  • Unauthorized – The request was performed with no authorization.

  • Forbidden – You are not authorized to request this feed.

  • NotFound – The specified custom list was not found.

Returns:

Returns a collections of chapters.

Return type:

ChapterFeed

await create_scanlation_group(*, name: str, website: Optional[str] = None, irc_server: Optional[str] = None, irc_channel: Optional[str] = None, discord: Optional[str] = None, contact_email: Optional[str] = None, description: Optional[str] = None, twitter: Optional[str] = None, manga_updates: Optional[str] = None, inactive: Optional[bool] = None, publish_delay: Optional[Union[str, timedelta]] = None) ScanlatorGroup[source]#

This function is a coroutine.

This method will create a scanlation group within the MangaDex API.

Parameters:
  • name (str) – The name of the scanlation group.

  • website (Optional[str]) – The scanlation group’s website, if any.

  • irc_server (Optional[str]) – The scanlation group’s irc server, if any.

  • irc_channel (Optional[str]) – The scanlation group’s irc channel, if any.

  • discord (Optional[str]) – The scanlation group’s discord server, if any.

  • contact_email (Optional[str]) – The scanlation group’s email, if any.

  • description (Optional[str]) – The scanlation group’s description, if any.

  • twitter (Optional[str]) – The scanlation group’s twitter url, if any.

  • manga_updates (Optional[str]) – The group’s page where they post manga updates, if any.

  • inactive (Optional[bool]) – If the scanlation group is inactive or not.

  • publish_delay (Optional[Union[str, datetime.timedelta]]) – If the scanlation group’s releases are published on a delay.

Note

The publish_delay parameter must match the hondana.utils.MANGADEX_TIME_REGEX pattern or be a valid datetime.timedelta.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to create scanlation groups.

Returns:

The group returned from the API on creation.

Return type:

ScanlatorGroup

await get_scanlation_group(scanlation_group_id: str, /, *, includes: ~typing.Optional[~hondana.query.ScanlatorGroupIncludes] = <ScanlatorGroupIncludes leader=True member=True>) ScanlatorGroup[source]#

This function is a coroutine.

This method will get a scanlation group from the MangaDex API.

Parameters:
  • scanlation_group_id (str) – The UUID relating to the scanlation group you wish to fetch.

  • includes (Optional[ScanlatorGroupIncludes]) – The list of optional includes we request the data for. Defaults to all possible expansions

Raises:
  • Forbidden – You are not authorized to view this scanlation group.

  • NotFound – The scanlation group was not found.

Returns:

The group returned from the API.

Return type:

ScanlatorGroup

await update_scanlation_group(scanlation_group_id: str, /, *, name: Optional[str] = None, leader: Optional[str] = None, members: Optional[list[str]] = None, website: Optional[str] = ..., irc_server: Optional[str] = ..., irc_channel: Optional[str] = ..., discord: Optional[str] = ..., contact_email: Optional[str] = ..., description: Optional[str] = ..., twitter: Optional[str] = ..., manga_updates: Optional[str] = ..., focused_languages: list[hondana.types.common.LanguageCode] = ..., inactive: Optional[bool] = None, locked: Optional[bool] = None, publish_delay: Optional[Union[str, timedelta]] = None, version: int) ScanlatorGroup[source]#

This function is a coroutine.

This method will update a scanlation group within the MangaDex API.

Parameters:
  • scanlation_group_id (str) – The UUID relating to the scanlation group we are updating.

  • name (Optional[str]) – The name to update the group with.

  • leader (Optional[str]) – The UUID of the leader to update the group with.

  • members (Optional[str]) – A list of UUIDs relating to the members to update the group with.

  • website (Optional[str]) – The website to update the group with.

  • irc_server (Optional[str]) – The IRC Server to update the group with.

  • irc_channel (Optional[str]) – The IRC Channel to update the group with.

  • discord (Optional[str]) – The discord server to update the group with.

  • contact_email (Optional[str]) – The contact email to update the group with.

  • description (Optional[str]) – The new description to update the group with.

  • twitter (Optional[str]) – The new twitter url to update the group with.

  • manga_updates (Optional[str]) – The URL to the group’s page where they post updates, if any.

  • focused_languages (Optional[List[LanguageCode]]) – The new list of language codes to update the group with.

  • inactive (Optional[bool]) – If the group is inactive or not.

  • locked (Optional[bool]) – Update the lock status of this scanlator group.

  • publish_delay (Optional[Union[str, datetime.timedelta]]) – The publishing delay to add to all group releases.

  • version (int) – The version revision of this scanlator group.

Note

The website, irc_server, irc_channel, discord, contact_email, description, twitter, manga_updates and focused_language keys are all nullable in the API. To do so please pass None explicitly to these keys.

Note

The publish_delay parameter must match the hondana.utils.MANGADEX_TIME_REGEX pattern or be a valid datetime.timedelta.

Raises:
  • BadRequest – The request body was malformed

  • Forbidden – You are not authorized to update this scanlation group.

  • NotFound – The passed scanlation group ID cannot be found.

Returns:

The group returned from the API after its update.

Return type:

ScanlatorGroup

await delete_scanlation_group(scanlation_group_id: str, /) None[source]#

This function is a coroutine.

This method will delete a scanlation group.

Parameters:

scanlation_group_id (str) – The UUID relating to the scanlation group you wish to delete.

Raises:
  • Forbidden – You are not authorized to delete this scanlation group.

  • NotFound – The scanlation group cannot be found, likely due to an incorrect ID.

await follow_scanlation_group(scanlation_group_id: str, /) None[source]#

This function is a coroutine.

This method will delete a scanlation group.

Parameters:

scanlation_group_id (str) – The UUID relating to the scanlation group you wish to follow.

Raises:

NotFound – The scanlation group cannot be found, likely due to an incorrect ID.

await unfollow_scanlation_group(scanlation_group_id: str, /) None[source]#

This function is a coroutine.

This method will delete a scanlation group.

Parameters:

scanlation_group_id (str) – The UUID relating to the scanlation group you wish to unfollow.

Raises:

NotFound – The scanlation group cannot be found, likely due to an incorrect ID.

await author_list(*, limit: ~typing.Optional[int] = 10, offset: int = 0, ids: ~typing.Optional[list[str]] = None, name: ~typing.Optional[str] = None, order: ~typing.Optional[~hondana.query.AuthorListOrderQuery] = None, includes: ~typing.Optional[~hondana.query.AuthorIncludes] = <AuthorIncludes manga=True>) AuthorCollection[source]#

This function is a coroutine.

This method will fetch a list of authors from the MangaDex API.

Parameters:
  • limit (Optional[int]) – Defaults to 10. This specifies the amount of scanlator groups to return in one request.

  • offset (int) – Defaults to 0. The pagination offset.

  • ids (Optional[List[str]]) – A list of author UUID(s) to limit the request to.

  • name (Optional[str]) – A name to limit the request to.

  • order (Optional[AuthorListOrderQuery]) – A query parameter to choose how the responses are ordered.

  • includes (Optional[AuthorIncludes]) – An optional list of includes to request increased payloads during the request. Defaults to all possible expansions.

Note

Passing None to limit will attempt to retrieve all items in the author collection.

Raises:
  • BadRequest – The request payload was malformed.

  • Forbidden – The request failed due to authentication failure.

Returns:

A returned collection of authors.

Return type:

AuthorCollection

await create_author(*, name: str, biography: Optional[hondana.types.common.LocalizedString] = None, twitter: str = ..., pixiv: str = ..., melon_book: str = ..., fan_box: str = ..., booth: str = ..., nico_video: str = ..., skeb: str = ..., fantia: str = ..., tumblr: str = ..., youtube: str = ..., website: str = ...) Author[source]#

This function is a coroutine.

This method will create an author within the MangaDex API.

Parameters:
  • name (str) – The name of the author we are creating.

  • biography (Optional[LocalizedString]) – The biography of the author we are creating.

  • twitter (Optional[str]) – The twitter URL of the author.

  • pixiv (Optional[str]) – The pixiv URL of the author.

  • melon_book (Optional[str]) – The melon book URL of the author.

  • fan_box (Optional[str]) – The fan box URL of the author.

  • booth (Optional[str]) – The booth URL of the author.

  • nico_video (Optional[str]) – The nico video URL of the author.

  • skeb (Optional[str]) – The skeb URL of the author.

  • fantia (Optional[str]) – The fantia URL of the author.

  • tumblr (Optional[str]) – The tumblr URL of the author.

  • youtube (Optional[str]) – The youtube URL of the author.

  • website (Optional[str]) – The website URL of the author.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to create authors.

Returns:

The author created within the API.

Return type:

Author

await get_author(author_id: str, /, *, includes: ~typing.Optional[~hondana.query.AuthorIncludes] = <AuthorIncludes manga=True>) Author[source]#

This function is a coroutine.

The method will fetch an Author from the MangaDex API.

Note

MangaDex does not differentiate types of Artist/Author. The endpoint is the same for both.

Parameters:
  • author_id (str) – The ID of the author we are fetching.

  • includes (Optional[AuthorIncludes]) – The optional extra data we are requesting from the API. Defaults to all possible expansions.

Raises:

NotFound – The passed author ID was not found, likely due to an incorrect ID.

Returns:

The Author returned from the API.

Return type:

Author

await get_artist(artist_id: str, /, *, includes: ~typing.Optional[~hondana.query.ArtistIncludes] = <ArtistIncludes manga=True>) Artist[source]#

This function is a coroutine.

The method will fetch an artist from the MangaDex API.

Note

MangaDex does not differentiate types of Artist/Author. The endpoint is the same for both.

Parameters:
  • artist_id (str) – The ID of the author we are fetching.

  • includes (Optional[AuthorIncludes]) – The optional extra data we are requesting from the API. Defaults to all possible expansions.

Raises:

NotFound – The passed artist ID was not found, likely due to an incorrect ID.

Returns:

The Author returned from the API.

Return type:

Artist

await update_author(author_id: str, /, *, name: Optional[str] = None, biography: Optional[hondana.types.common.LocalizedString] = None, twitter: str = ..., pixiv: str = ..., melon_book: str = ..., fan_box: str = ..., booth: str = ..., nico_video: str = ..., skeb: str = ..., fantia: str = ..., tumblr: str = ..., youtube: str = ..., website: str = ..., version: int) Author[source]#

This function is a coroutine.

This method will update an author on the MangaDex API.

Parameters:
  • author_id (str) – The UUID relating to the author we wish to update.

  • name (Optional[str]) – The new name to update the author with.

  • biography (Optional[LocalizedString]) – The biography of the author we are creating.

  • twitter (Optional[str]) – The twitter URL of the author.

  • pixiv (Optional[str]) – The pixiv URL of the author.

  • melon_book (Optional[str]) – The melon book URL of the author.

  • fan_box (Optional[str]) – The fan box URL of the author.

  • booth (Optional[str]) – The booth URL of the author.

  • nico_video (Optional[str]) – The nico video URL of the author.

  • skeb (Optional[str]) – The skeb URL of the author.

  • fantia (Optional[str]) – The fantia URL of the author.

  • tumblr (Optional[str]) – The tumblr URL of the author.

  • youtube (Optional[str]) – The youtube URL of the author.

  • website (Optional[str]) – The website URL of the author.

  • version (int) – The version revision of this author.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to update this author.

  • NotFound – The author UUID given was not found.

Returns:

The updated author from the API.

Return type:

Author

await delete_author(author_id: str, /) None[source]#

This function is a coroutine.

This method will delete an author from the MangaDex API.

Parameters:

author_id (str) – The UUID relating the author you wish to delete.

Raises:
  • Forbidden – You are not authorized to delete this author.

  • NotFound – The UUID given for the author was not found.

await create_report(details: ReportDetails, /) None[source]#

This function is a coroutine.

This method will create a report for moderator review in the MangaDex API.

Parameters:

details (ReportDetails) – The details of the report.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – The request returned a response due to authentication failure.

  • NotFound – The specified report UUID or object UUID does not exist.

await get_my_manga_ratings(manga_ids: list[str], /) list[hondana.manga.MangaRating][source]#

This function is a coroutine.

This method will return your personal manga ratings for the given manga.

Parameters:

manga_ids (List[str]) – The IDs of the manga you wish to fetch your ratings for.

Raises:
  • Forbidden – Failed response due to authentication failure.

  • NotFound – A given manga id was not found or does not exist.

Return type:

List[MangaRating]

await set_manga_rating(manga_id: str, /, *, rating: int) None[source]#

This function is a coroutine.

This method will set your rating on the passed manga. This method overwrites your previous set rating, if any.

Parameters:
  • manga_id (str) – The manga you are setting the rating for.

  • rating (int) – The rating value, between 1 and 10.

Raises:
  • Forbidden – The request returned a response due to authentication failure.

  • NotFound – The specified manga UUID was not found or does not exist.

await delete_manga_rating(manga_id: str, /) None[source]#

This function is a coroutine.

This method will delete your set rating on the passed manga.

Parameters:

manga_id (str) – The manga you wish to delete the rating for.

Raises:
  • Forbidden – The request returned a response due to authentication failure.

  • NotFound – The specified manga UUID was not found or does not exist.

await get_manga_statistics(manga_id: str, /) MangaStatistics[source]#

This function is a coroutine.

This method will return the statistics for the passed manga.

Parameters:

manga_id (str) – The manga id to fetch the statistics for.

Return type:

MangaStatistics

await find_manga_statistics(manga_ids: list[str], /) list[hondana.manga.MangaStatistics][source]#

This function is a coroutine.

This method will return the statistics for the passed manga.

Parameters:

manga_ids (List[str]) – The list of manga IDs to fetch the statistics for.

Return type:

List[MangaStatistics]

await abandon_upload_session(session_id: str, /) None[source]#

This function is a coroutine.

This method will abandon an existing upload session.

Parameters:

session_id (str) – The upload

upload_session(manga: Union[Manga, str], /, *, chapter: str, chapter_to_edit: Optional[Union[Chapter, str]] = None, volume: Optional[str] = None, title: Optional[str] = None, translated_language: hondana.types.common.LanguageCode, scanlator_groups: list[str], external_url: Optional[str] = None, publish_at: Optional[datetime] = None, existing_upload_session_id: Optional[str] = None, version: Optional[int] = None) ChapterUpload[source]#

This method will return an async context manager to handle some upload session management.

Examples

Using the async context manager:

async with Client.upload_session(
    manga,
    chapter=chapter,
    volume=volume,
    title=title,
    translated_language=translated_language,
    scanlator_groups=scanlator_groups
) as session:
    await session.upload_images(your_list_of_bytes)
Parameters:
  • manga (Union[Manga, str]) – The manga we will be uploading a chapter for.

  • chapter (str) – The chapter we are uploading. Typically, this is a numerical identifier.

  • chapter_to_edit (Optional[Union[Chapter, str]]) – The chapter you intend to edit. Defaults to None.

  • volume (Optional[str]) – The volume we are uploading a chapter for. Typically, this is a numerical identifier. Defaults to None in the API.

  • title (Optional[str]) – The chapter’s title. Defaults to None.

  • translated_language (LanguageCode) – The language this chapter is translated in.

  • scanlator_groups (List[str]) – The list of scanlator groups to attribute to this chapter’s scanlation. Only 5 are allowed on a given chapter.

  • external_url (Optional[str]) – The external URL of this chapter. Defaults to None.

  • publish_at (Optional[datetime.datetime]) – When to publish this chapter (and pages) on MangaDex, represented as a UTC datetime. This must be a future date.

  • existing_upload_session_id (Optional[str]) – Pass this parameter if you wish to resume an existing upload session.

  • version (Optional[int]) – The new version of the chapter you are editing. Only necessary if chapter_to_edit is not None.

Note

The external_url parameter requires an explicit permission on MangaDex to set.

Return type:

ChapterUpload

await upload_chapter(manga: Union[Manga, str], /, *, chapter: str, chapter_to_edit: Optional[Union[Chapter, str]] = None, volume: Optional[str] = None, title: Optional[str] = None, translated_language: hondana.types.common.LanguageCode, scanlator_groups: list[str], external_url: Optional[str] = None, publish_at: Optional[datetime] = None, existing_upload_session_id: Optional[str] = None, version: Optional[int] = None, images: list[pathlib.Path]) Chapter[source]#

This function is a coroutine.

This method will perform the chapter upload for you, providing a list of images.

Parameters:
  • manga (Union[Manga, str]) – The manga we will be uploading a chapter for.

  • chapter (str) – The chapter we are uploading. Typically, this is a numerical identifier.

  • chapter_to_edit (Optional[Union[Chapter, str]]) – The chapter you intend to edit. Defaults to None.

  • volume (Optional[str]) – The volume we are uploading a chapter for. Typically, this is a numerical identifier. Defaults to None.

  • title (Optional[str]) – The chapter’s title. Defaults to None.

  • translated_language (LanguageCode) – The language this chapter is translated in.

  • scanlator_groups (List[str]) – The list of scanlator groups to attribute to this chapter’s scanlation. Only 5 are allowed on a given chapter.

  • external_url (Optional[str]) – The external URL of this chapter. Defaults to None.

  • publish_at (Optional[datetime.datetime]) – When to publish this chapter (and pages) on MangaDex, represented as a UTC datetime. This must be a future date.

  • existing_upload_session_id (Optional[str]) – Pass this parameter if you wish to resume an existing upload session.

  • version (Optional[int]) – The new version of the chapter you are editing. Only necessary if chapter_to_edit is not None.

  • images (List[pathlib.Path]) – The list of images to upload as their Paths.

Note

The external_url parameter requires an explicit permission on MangaDex to set.

Warning

The images parameter MUST be ordered how you would expect the images to be shown in the frontend. E.g. list[0] would be page 1, and so on. The upload method will sort them alphabetically for you by default, to which I recommend naming the files 1.png, 2.png, etc.

Warning

This method is for ease of use, but offers little control over the upload session. If you need more control, such as to delete images from the existing session. I suggest using upload_session() instead for greater control.

Note

I personally advise the context manager method as it allows more control over your upload session.

await get_latest_settings_template() dict[str, Any][source]#

This function is a coroutine.

This method will return the json object of the latest settings template.

Currently, there is no formatting done on this key as the api has not documented it.

Returns:

The settings template.

Return type:

Dict[str, Any]

await get_specific_template_version(version: str) dict[str, Any][source]#

This function is a coroutine.

This method will return a specific setting template version.

Parameters:

version (str) – The UUID relating to the specified template.

Raises:
  • Forbidden – The request failed due to authentication issues.

  • NotFound – The specified template was not found.

Returns:

The returned settings template.

Return type:

Dict[str, Any]

await get_my_settings() SettingsPayload[source]#

This function is a coroutine.

This method will return the current logged-in user’s settings.

Raises:
  • Forbidden – The request failed due to authentication issues.

  • NotFound – The logged-in user’s settings were not found.

Returns:

The user’s settings.

Return type:

hondana.types.settings.SettingsPayload

await upsert_user_settings(payload: Settings, updated_at: Optional[datetime.datetime] = None) SettingsPayload[source]#

This function is a coroutine.

This method will update or create user settings based on a formatted settings templates.

Parameters:
  • payload (hondana.types.settings.Settings) – A payload representing the settings.

  • updated_at (datetime.datetime) – The datetime at which you updated the settings. Defaults to a UTC datetime for “now”.

Raises:
  • Forbidden – The request failed due to authentication issues.

  • NotFound – The logged-in user’s settings were not found.

Returns:

The returned (and created) payload.

Return type:

SettingsPayload

API Models#

Artist#

class hondana.Artist[source]#

A class representing an Artist returns from the MangaDex API.

id#

The UUID associated with this artist.

Type:

str

name#

The artist’s name.

Type:

str

image_url#

The artist’s image url, if any.

Type:

Optional[str]

twitter#

The artist’s Twitter url, if any.

Type:

Optional[str]

pixiv#

The artist’s Pixiv url, if any.

Type:

Optional[str]

melon_book#

The artist’s Melon Book url, if any.

Type:

Optional[str]

fan_box#

The artist’s Fan Box url, if any.

Type:

Optional[str]

booth#

The artist’s Booth url, if any.

Type:

Optional[str]

nico_video#

The artist’s Nico Video url, if any.

Type:

Optional[str]

skeb#

The artist’s Skeb url, if any.

Type:

Optional[str]

fantia#

The artist’s Fantia url, if any.

Type:

Optional[str]

tumblr#

The artist’s Tumblr url, if any.

Type:

Optional[str]

youtube#

The artist’s Youtube url, if any.

Type:

Optional[str]

weibo#

The artist’s Weibo url, if any.

Type:

Optional[str]

naver#

The artist’s Naver url, if any.

Type:

Optional[str]

website#

The artist’s website url, if any.

Type:

Optional[str]

version#

The version revision of this artist.

Type:

int

property biography: Optional[str]#

The artist’s biography, if present.

Returns:

The artist’s biography. This property will attempt to get the "en" key first, and fallback to the first key in the object.

Return type:

Optional[str]

localised_biography(language: hondana.types.common.LanguageCode) Optional[str][source]#

The artist’s biography in the specified language, if present.

Parameters:

language (LanguageCode) – The language code of the language to return.

Returns:

The artist’s biography in the specified language.

Return type:

Optional[str]

property created_at: datetime#

When this artist was created.

Return type:

datetime.datetime

property updated_at: datetime#

When this artist was last updated.

Return type:

datetime.datetime

property url: str#

The URL to this artist.

Returns:

The URL of the artist.

Return type:

str

property manga: Optional[list[Manga]]#

Returns a list Manga related to this artist.

Note

If the Artist was not requested with the manga includes parameter, this will return None. To populate this, consider get_manga()

Return type:

Optional[List[Manga]]

await get_manga() Optional[list[Manga]][source]#

This function is a coroutine.

This method will return cached manga responses, or attempt to fetch them from the API. It also caches the response and populates manga.

Warning

This method will make N API quests for N amount of manga this artist is attributed to. Consider requesting this object with the manga[] includes/expansion to save on more API requests.

Return type:

Optional[List[Manga]]

await update_author(*, name: Optional[str] = None, biography: Optional[hondana.types.common.LocalizedString] = None, twitter: str = ..., pixiv: str = ..., melon_book: str = ..., fan_box: str = ..., booth: str = ..., nico_video: str = ..., skeb: str = ..., fantia: str = ..., tumblr: str = ..., youtube: str = ..., website: str = ..., version: int) Artist[source]#

This function is a coroutine.

This method will update an artist on the MangaDex API.

Parameters:
  • name (Optional[str]) – The new name to update the artist with.

  • biography (Optional[LocalizedString]) – The biography of the artist we are creating.

  • twitter (Optional[str]) – The twitter URL of the artist.

  • pixiv (Optional[str]) – The pixiv URL of the artist.

  • melon_book (Optional[str]) – The melon book URL of the artist.

  • fan_box (Optional[str]) – The fan box URL of the artist.

  • booth (Optional[str]) – The booth URL of the artist.

  • nico_video (Optional[str]) – The nico video URL of the artist.

  • skeb (Optional[str]) – The skeb URL of the artist.

  • fantia (Optional[str]) – The fantia URL of the artist.

  • tumblr (Optional[str]) – The tumblr URL of the artist.

  • youtube (Optional[str]) – The youtube URL of the artist.

  • website (Optional[str]) – The website URL of the artist.

  • version (int) – The version revision of this artist.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to update this artist.

  • NotFound – The artist UUID given was not found.

Returns:

The updated artist from the API.

Return type:

Artist

await delete() None[source]#

This function is a coroutine.

This method will delete the current author from the MangaDex API.

Raises:
  • Forbidden – You are not authorized to delete this author.

  • NotFound – The UUID given for the author was not found.

Author#

class hondana.Author[source]#

A class representing an Author returned from the MangaDex API.

id#

The UUID associated with this author.

Type:

str

name#

The author’s name.

Type:

str

image_url#

The author’s image url, if any.

Type:

Optional[str]

twitter#

The author’s Twitter url, if any.

Type:

Optional[str]

pixiv#

The author’s Pixiv url, if any.

Type:

Optional[str]

melon_book#

The author’s Melon Book url, if any.

Type:

Optional[str]

fan_box#

The author’s Fan Box url, if any.

Type:

Optional[str]

booth#

The author’s Booth url, if any.

Type:

Optional[str]

nico_video#

The author’s Nico Video url, if any.

Type:

Optional[str]

skeb#

The author’s Skeb url, if any.

Type:

Optional[str]

fantia#

The author’s Fantia url, if any.

Type:

Optional[str]

tumblr#

The author’s Tumblr url, if any.

Type:

Optional[str]

youtube#

The author’s Youtube url, if any.

Type:

Optional[str]

weibo#

The author’s Weibo url, if any.

Type:

Optional[str]

naver#

The author’s Naver url, if any.

Type:

Optional[str]

website#

The author’s website url, if any.

Type:

Optional[str]

version#

The version revision of this author.

Type:

int

property biography: Optional[str]#

The author’s biography, if present.

Returns:

The author’s biography. This property will attempt to get the "en" key first, and fallback to the first key in the object.

Return type:

Optional[str]

localised_biography(language: hondana.types.common.LanguageCode) Optional[str][source]#

The author’s biography in the specified language, if present.

Parameters:

language (LanguageCode) – The language code of the language to return.

Returns:

The author’s biography in the specified language.

Return type:

Optional[str]

property created_at: datetime#

When this author was created.

Return type:

datetime.datetime

property updated_at: datetime#

When this author was last updated.

Return type:

datetime.datetime

property url: str#

The URL to this author.

Returns:

The URL of the author.

Return type:

str

property manga: Optional[list[Manga]]#

Returns a list Manga related to this author.

Note

If the Author was not requested with the manga includes parameter, this will return None. To populate this, consider get_manga()

Return type:

Optional[List[Manga]]

await get_manga() Optional[list[Manga]][source]#

This function is a coroutine.

This method will return cached manga responses, or attempt to fetch them from the API. It also caches the response and populates manga.

Warning

This method will make N API quests for N amount of manga this author is attributed to. Consider requesting this object with the manga[] includes/expansion so save on more API requests.

Return type:

Optional[List[Manga]]

await update_author(*, name: Optional[str] = None, biography: Optional[hondana.types.common.LocalizedString] = None, twitter: str = ..., pixiv: str = ..., melon_book: str = ..., fan_box: str = ..., booth: str = ..., nico_video: str = ..., skeb: str = ..., fantia: str = ..., tumblr: str = ..., youtube: str = ..., website: str = ..., version: int) Author[source]#

This function is a coroutine.

This method will update an author on the MangaDex API.

Parameters:
  • name (Optional[str]) – The new name to update the author with.

  • biography (Optional[LocalizedString]) – The biography of the author we are creating.

  • twitter (Optional[str]) – The twitter URL of the author.

  • pixiv (Optional[str]) – The pixiv URL of the author.

  • melon_book (Optional[str]) – The melon book URL of the author.

  • fan_box (Optional[str]) – The fan box URL of the author.

  • booth (Optional[str]) – The booth URL of the author.

  • nico_video (Optional[str]) – The nico video URL of the author.

  • skeb (Optional[str]) – The skeb URL of the author.

  • fantia (Optional[str]) – The fantia URL of the author.

  • tumblr (Optional[str]) – The tumblr URL of the author.

  • youtube (Optional[str]) – The youtube URL of the author.

  • website (Optional[str]) – The website URL of the author.

  • version (int) – The version revision of this author.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to update this author.

  • NotFound – The author UUID given was not found.

Returns:

The updated author from the API.

Return type:

Author

await delete(author_id: str, /) None[source]#

This function is a coroutine.

This method will delete the current author from the MangaDex API.

Raises:
  • Forbidden – You are not authorized to delete this author.

  • NotFound – The UUID given for the author was not found.

Chapter#

class hondana.Chapter[source]#

A class representing a Chapter returned from the MangaDex API.

id#

The UUID associated with this chapter.

Type:

str

title#

The manga’s title. Interestingly enough, this can sometimes be None.

Type:

Optional[str]

volume#

The volume identifier (e.g. ‘1’) this chapter is associated with, if any.

Type:

Optional[str]

chapter#

The chapter identifier (e.g. ‘001’) associated with this chapter, if any.

Type:

Optional[str]

pages#

The number of pages this chapter has.

Type:

int

translated_language#

The language code that this chapter was translated to.

Type:

str

external_url#

The chapter’s external url, if any.

Type:

Optional[str]

version#

The revision version of this chapter.

Type:

int

Warning

THe manga and get_parent_manga() will both return a Manga with minimal data if this Chapter was requested as part of a feed. The reason is that the Chapter.relationships["manga"].relationships key is null the API response during feed requests to avoid potential recursive data.

to_dict() dict[str, Any][source]#

Method to dump the chapter to a dictionary.

Warning

The dumped dictionary is not standard json spec compliant.

Return type:

Dict[str, Any]

await get_at_home(ssl: bool = True) ChapterAtHome[source]#

This function is a coroutine.

This method returns the @Home data for this chapter.

:param ssl bool: Whether to obtain an @Home URL for SSL only connections.

Defaults to True.

Returns:

The returned details to reach a MD@H node for this chapter.

Return type:

ChapterAtHome

property url: str#

The URL to this chapter.

Returns:

The URL of the chapter.

Return type:

str

property created_at: datetime#

When this chapter was created.

Returns:

The UTC datetime of when this chapter was created.

Return type:

datetime.datetime

property updated_at: datetime#

When this chapter was last updated.

Returns:

The UTC datetime of when this chapter was last updated.

Return type:

datetime.datetime

property published_at: datetime#

When this chapter was published.

Returns:

The UTC datetime of when this chapter was published.

Return type:

datetime.datetime

property readable_at: datetime#

When this chapter is readable.

Returns:

The UTC datetime of when this chapter becomes readable.

Return type:

datetime.datetime

property manga: Optional[Manga]#

The parent Manga of the chapter.

Returns:

The manga within the Chapter’s payload, usually the parent manga.

Return type:

Optional[Manga]

property manga_id: Optional[str]#

The parent manga id of this chapter.

Note

This can be None if the chapter has no relationships key. Or in the almost impossible situation that it has no "manga" relationship.

Returns:

The manga id.

Return type:

str

property scanlator_groups: Optional[list[hondana.scanlator_group.ScanlatorGroup]]#

The Scanlator Group that handled this chapter.

Returns:

The groups that handled this chapter’s scanlation and upload.

Return type:

Optional[List[ScanlatorGroup]]

property uploader: Optional[User]#

The uploader who uploaded this chapter.

Returns:

The user that handled this chapter’s upload.

Return type:

Optional[User]

await get_parent_manga() Optional[Manga][source]#

This function is a coroutine.

This method will fetch the parent manga from a chapter’s relationships and cache the response.

Returns:

The Manga that was fetched from the API.

Return type:

Optional[Manga]

await get_scanlator_groups() Optional[list[hondana.scanlator_group.ScanlatorGroup]][source]#

This function is a coroutine.

This method will fetch the scanlator group from a chapter’s relationships.

Warning

It is recommended to request this Chapter with the scanlator_group reference expansion, as this method will make an API call to request this data.

Returns:

The scanlator group that was fetched from the API.

Return type:

Optional[List[ScanlatorGroup]]

await update(*, title: Optional[str] = None, volume: str = ..., chapter: str = ..., translated_language: Optional[str] = None, groups: Optional[list[str]] = None, version: int) Chapter[source]#

This function is a coroutine.

This method will update the current chapter in the MangaDex API.

Parameters:
  • title (Optional[str]) – The title to rename the chapter to, if given.

  • volume (Optional[str]) – The volume identity that this chapter belongs to, if any.

  • chapter (Optional[str]) – The chapter identity marking this chapter, if any.

  • translated_language (Optional[str]) – The language code this chapter is translated to.

  • groups (Optional[List[str]]) – The UUIDs representing credited scanlation groups for this chapter.

  • version (int) – The version revision of this chapter.

Note

The volume and chapter keys are nullable, pass None to them to send null to the API

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to update this chapter.

  • NotFound – One or more UUIDs given were not found.

Returns:

The chapter after being updated.

Return type:

Chapter

await delete() None[source]#

This function is a coroutine.

This method will delete the current chapter from the MangaDex API.

Raises:
  • BadRequest – The query was malformed.

  • Forbidden – You are not authorized to delete this chapter.

  • NotFound – The UUID passed for this chapter does not relate to a chapter in the API.

await mark_as_read(update_history: bool = True) None[source]#

This function is a coroutine.

This method will mark the current chapter as read for the current authenticated user in the MangaDex API.

Parameters:

update_history (bool) – Whether to include this chapter in the authenticated user’s read history.

await mark_as_unread(update_history: bool = True) None[source]#

This function is a coroutine.

This method will mark the current chapter as unread for the current authenticated user in the MangaDex API.

Parameters:

update_history (bool) – Whether to include this chapter in the authenticated user’s read history.

await download(path: Optional[Union[PathLike[str], str]] = None, *, start_page: int = 0, end_page: Optional[int] = None, data_saver: bool = False, ssl: bool = False, report: bool = True) None[source]#

This function is a coroutine.

This method will attempt to download a chapter for you using the MangaDex process.

Parameters:
  • path (Optional[Union[os.PathLike, str]]) – The path at which to use (or create) a directory to save the pages of the chapter. Defaults to "chapter number - chapter title"

  • start_page (int) – The page at which to start downloading, leave at 0 (default) to download all.

  • end_page (Optional[int]) – The page at which to stop downloading, leave at None to download all pages after the start page.

  • data_saver (bool) – Whether to use the smaller (and poorer quality) images, if you are on a data budget. Defaults to False.

  • ssl (bool) – Whether to request an SSL @Home link from MangaDex, this guarantees https as compared to potentially getting an HTTP url. Defaults to False.

  • report (bool) – Whether to report success or failures to MangaDex per page download. The API guidelines ask us to do this, so it defaults to True. Does not count towards your (user) rate-limits.

async for ... in download_bytes(*, start_page: int = 0, end_page: Optional[int] = None, data_saver: bool = False, ssl: bool = False, report: bool = True) AsyncGenerator[bytes, None][source]#

This function is a coroutine.

This method will attempt to download a chapter for you using the MangaDex process, and return the bytes of each page. This is similar to download(), but instead of writing to a directory it returns the bytes directly.

Parameters:
  • start_page (int) – The page at which to start downloading, leave at 0 (default) to download all.

  • end_page (Optional[int]) – The page at which to stop downloading, leave at None to download all pages after the start page.

  • data_saver (bool) – Whether to use the smaller (and poorer quality) images, if you are on a data budget. Defaults to False.

  • ssl (bool) – Whether to request an SSL @Home link from MangaDex, this guarantees https as compared to potentially getting an HTTP url. Defaults to False.

  • report (bool) – Whether to report success or failures to MangaDex per page download. The API guidelines ask us to do this, so it defaults to True.

Yields:

bytes – The bytes of each page.

class hondana.ChapterAtHome[source]#

A small helper object for the MD@H responses from the API.

base_url#

The base url for the MD@H connection

Type:

str

hash#

The hash of this chapter.

Type:

str

data#

A list of page hashes for this chapter, for download/reading.

Type:

List[str]

data_saver#

A list of page hashes for this chapter, for download/reading. These pages are of “data saver” quality, compared to full quality data

Type:

List[str]

class hondana.UploadData[source]#

A small helper object to store the upload data for each upload session and holds respective responses and errors.

succeeded#

The succeeded responses from the upload session.

Type:

List[UploadedChapterResponse]

errors#

The errors from the upload session.

Type:

List[ErrorType]

has_failures#

The upload has errors.

Type:

bool

errored_files#

A property that returns a set of filenames that failed to upload.

Returns:

The filenames of the failed uploads.

Return type:

Set[str]

class hondana.PreviouslyReadChapter[source]#

A richer interface for chapter read histories.

chapter_id#

The previously read chapter’s ID.

Type:

str

read_date#

The datetime (in UTC) when this chapter was marked as read.

Type:

datetime.datetime

await fetch_chapter(*, includes: ~hondana.query.ChapterIncludes = <ChapterIncludes manga=True user=True scanlation_group=True>) Chapter[source]#

This function is a coroutine.

This method will fetch the chapter from the ID in the read payload.

Return type:

Chapter

Chapter Upload#

class hondana.ChapterUpload[source]#

A context manager for handling the uploading of chapters to the MangaDex API.

Parameters:
  • manga (Manga) – The manga we are uploading a chapter for.

  • volume (Optional[str]) – The volume name/number this chapter is/for. Defaults to None.

  • chapter (str) – The chapter name/number.

  • chapter_to_edit (Optional[Union[Chapter, str]]) – The chapter we are editing, if we are editing a chapter. Defaults to None.

  • title (Optional[str]) – The chapter’s title. Defaults to None.

  • translated_language (LanguageCode) – The language this chapter is translated in.

  • external_url (Optional[str]) – The external link to this chapter, if any. Using this parameter requires an explicit permission MD side.

  • publish_at (Optional[datetime.datetime]) – The future date at which to publish this chapter (and pages) to MangaDex.

  • scanlator_groups (List[str]) – The list of scanlator group IDs to attribute to this chapter.

  • existing_upload_session_id (str) – If you already have an open upload session and wish to resume there, please pass the ID to this attribute.

  • version (Optional[int]) – The version you are updating a chapter to. Parameter is ignored if chapter_to_edit is None.

Raises:
  • TypeError – If you provide more than 10 ScanlatorGroups.

  • TypeError – If you provide a chapter to edit but do not specify the version.

await open_session() BeginChapterUploadResponse[source]#

This function is a coroutine.

Opens an upload session and retrieves the session ID.

Return type:

BeginChapterUploadResponse

await upload_images(images: list[pathlib.Path], *, sort: bool = True, sorting_key: Optional[Callable[[Path], Any]] = None) UploadData[source]#

This function is a coroutine.

This method will take a list of bytes and upload them to the MangaDex API.

Parameters:
  • images (List[pathlib.Path]) – A list of images files as their Path objects.

  • sort (bool) – A bool to toggle if we sort the list of Paths alphabetically.

  • sorting_key (Optional[Callable[[pathlib.Path], Any]]) – A key to use in the sorting of the list of above paths. This callable is passed to the key parameter of the sorted builtin. If None, the default sorting key is used.

Returns:

The upload data object of this upload session.

Return type:

UploadData

Note

If sort is set to True then the library will sort the list of image paths alphabetically. This means that 1.png, 11.png, and 2.png will be sorted to 1.png, 2.png, and 11.png.

The autosort the library provides only supports the following filename formats:
  • 1.png

  • 1-something.png

Note

If sorting_key is provided, then it must be a callable that takes a single parameter of pathlib.Path and returns a sortable value. This means that the return value of sorting_key must be richly comparable, with __lt__ and __gt__.

await delete_images(image_ids: list[str], /) None[source]#

This function is a coroutine.

This method will delete image(s) from the pending upload session.

Parameters:

image_ids (List[str]) – A list of pending image IDs.

Note

If you need these IDs during an existing context manager, you can access uploaded and find it from there.

await abandon(session_id: Optional[str] = None, /) None[source]#

This function is a coroutine.

This method will abandon your current (or passed) upload session.

Parameters:

session_id (Optional[str]) – The session id which to abandon. Will default to the current instance’s session.

await commit() Chapter[source]#

This function is a coroutine.

This method will commit the pending upload session and return the valid chapter.

Return type:

Chapter

Collections#

class hondana.MangaCollection[source]#

A collection object type to represent manga.

manga#

The manga returned from this collection.

Type:

List[Manga]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[Manga]#

Returns the mangas in the collection.

Return type:

List[Manga]

class hondana.MangaRelationCollection[source]#

A collection object type to represent manga relations.

relations#

The manga relations returned from this collection.

Type:

List[MangaRelation]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[MangaRelation]#

Returns the manga relations in the collection.

Return type:

List[MangaRelation]

class hondana.ChapterFeed[source]#

A collection object type to represent chapters.

chapters#

The chapters returned from this collection.

Type:

List[Chapter]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[Chapter]#

Returns the chapters in the collection.

Return type:

List[Chapter]

class hondana.AuthorCollection[source]#

A collection object type to represent authors.

authors#

The authors returned from this collection.

Type:

List[Author]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[Author]#

Returns the authors in the collection.

Return type:

List[Author]

class hondana.CoverCollection[source]#

A collection object type to represent covers.

covers#

The covers returned from this collection.

Type:

List[Cover]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[Cover]#

Returns the covers in the collection.

Return type:

List[Cover]

class hondana.ScanlatorGroupCollection[source]#

A collection object type to represent scanlator groups.

groups#

The groups returned from this collection.

Type:

List[ScanlatorGroup]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[ScanlatorGroup]#

Returns the groups in the collection.

Return type:

List[ScanlatorGroup]

class hondana.ReportCollection[source]#

A collection object type to represent reports.

reports#

The reports returned from this collection.

Type:

List[Report]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[Report]#

Returns the reports in the collection.

Return type:

List[Report]

class hondana.UserCollection[source]#

A collection object type to represent users.

users#

The users returned from this collection.

Type:

List[User]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[User]#

Returns the users in the collection.

Return type:

List[User]

class hondana.CustomListCollection[source]#

A collection object type to represent custom lists.

lists#

The custom lists returned from this collection.

Type:

List[CustomList]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[CustomList]#

Returns the custom lists in the collection.

Return type:

List[CustomList]

class hondana.LegacyMappingCollection[source]#

A collection object type to represent custom lists.

legacy_mappings#

The legacy mappings returned from this collection.

Type:

List[LegacyItem]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[LegacyItem]#

Returns the legacy mappings in the collection.

Return type:

List[LegacyItem]

class hondana.ChapterReadHistoryCollection[source]#

A collection object type to represent chapter read history.

chapter_read_histories#

The chapter read histories returned from this collection.

Type:

List[PreviouslyReadChapter]

total#

The total possible results with this query could return.

Type:

int

offset#

The offset used in this query.

Type:

int

limit#

The limit used in this query.

Type:

int

property items: list[PreviouslyReadChapter]#

Returns the legacy mappings in the collection.

Return type:

List[PreviouslyReadChapter]

Cover#

class hondana.Cover[source]#

A class representing a Cover returned from the MangaDex API.

id#

The UUID associated with this cover.

Type:

str

volume#

The volume attributed to this cover, if any.

Type:

Optional[str]

file_name#

The file name of this cover.

Type:

str

description#

The description of this cover.

Type:

str

version#

The version revision of this Cover.

Type:

int

property created_at: datetime#

When this cover was created.

Returns:

The UTC datetime of when this cover was created.

Return type:

datetime.datetime

property updated_at: datetime#

When this cover was last updated.

Returns:

The UTC datetime of when this cover was last updated.

Return type:

datetime.datetime

property uploader: Optional[User]#

The user who uploaded this cover.

Note

This is only populated if the Cover has populated relationships.

Returns:

The user who uploaded this cover, if present.

Return type:

Optional[User]

url(type: Optional[Literal[256, 512]] = None, /, parent_id: Optional[str] = None) Optional[str][source]#

Method to return the Cover url.

Due to the API structure, this will return None if the parent manga key is missing from the response relationships.

Parameters:
  • type (Optional[Literal[256, 512]]) – Defaults to None to return original quality. Specifies the return image dimensions.

  • parent_id (Optional[str]) – Parameter where you can potentially set or override the parent manga to skip relationship lookup. Useful for when Cover is part of something else’s relationships, holding none of it’s own.

Returns:

The Cover url.

Return type:

Optional[str]

await fetch_image(size: Optional[Literal[256, 512]] = None, /) Optional[bytes][source]#

This function is a coroutine.

This method depends on url, as such, it can return None.

Parameters:

size (Optional[Literal[256, 512]]) – Defaults to None to return original quality. Specifies the returned image size.

Returns:

The raw image bytes.

Return type:

bytes

await edit_cover(*, volume: Optional[str] = ..., description: Optional[str] = ..., version: int) Cover[source]#

This function is a coroutine.

This method will edit the current cover on the MangaDex API.

Parameters:
  • volume (str) – The volume identifier relating the cover will represent.

  • description (Optional[str]) – The description of the cover.

  • version (int) – The version revision of the cover.

Warning

The volume key is mandatory. You can pass None to null it in the API, but it must have a value.

Raises:
  • TypeError – The volume key was not given a value. This is required.

  • BadRequest – The request body was malformed.

  • Forbidden – The request returned an error due to authentication failure.

Returns:

The returned cover after the edit.

Return type:

Cover

await delete() None[source]#

This function is a coroutine.

This method will delete the current cover from the MangaDex API.

Raises:
  • BadRequest – The request payload was malformed.

  • Forbidden – The request returned an error due to authentication.

CustomList#

class hondana.CustomList[source]#

A class representing a CustomList returned from the MangaDex API.

id#

The UUID relating to this custom list.

Type:

str

name#

The name of this custom list.

Type:

str

visibility#

The visibility of this custom list.

Type:

CustomListVisibility

version#

The version revision of this custom list.

Type:

int

property url: str#

The URL to this custom list.

Returns:

The URL of the custom list.

Return type:

str

property owner: Optional[User]#

Returns the owner of this custom list.

Returns:

The owner of this list, if any.

Return type:

Optional[User]

property manga: Optional[list[hondana.manga.Manga]]#

Returns the of manga present in this custom list, if any.

Returns:

The list of manga present, if any.

Return type:

Optional[List[Manga]]

await get_owner() Optional[User][source]#

This function is a coroutine.

This method will make an API request to get the owner of a Custom List.

Returns:

The owner of this list, if any.

Return type:

Optional[User]

await get_manga(*, limit: Optional[int] = 100, offset: int = 0) Optional[list[hondana.manga.Manga]][source]#

This function is a coroutine.

This method will attempt to fetch the manga that are members of this custom list.

Parameters:
  • limit (Optional[int]) – The amount of manga to fetch per request, defaults to 100.

  • offset (int) – The pagination offset to begin at. Defaults to 0.

Return type:

Optional[List[Manga]]

await update(*, name: Optional[str] = None, visibility: Optional[CustomListVisibility] = None, manga: Optional[list[str]] = None, version: int) CustomList[source]#

This function is a coroutine.

This method will update the current custom list within the MangaDex API.

Parameters:
  • name (Optional[str]) – The name we wish to edit the custom list with.

  • visibility (Optional[CustomListVisibility]) – The visibility we wish to edit the custom list with.

  • manga (Optional[List[str]]) – The list of manga IDs to edit this custom list with.

  • version (int) – The version revision of this custom list.

Note

Updating a custom list is an atomic action. Passing the manga key here will overwrite the manga in this custom list.

Raises:
  • BadRequest – The request body was malformed.

  • Forbidden – You are not authorized to edit this custom list.

  • NotFound – The custom list was not found, or one of the manga passed was not found.

Returns:

The returned custom list after it was updated.

Return type:

CustomList

await delete_custom_list() None[source]#

This function is a coroutine.

This method will delete the current custom list from the MangaDex API.

Raises:
  • Forbidden – You are not authorized to delete this custom list.

  • NotFound – The custom list with this UUID was not found.

await follow() None[source]#

This function is a coroutine.

The method will follow a custom list within the MangaDex API.

Raises:
  • Forbidden – You are not authorized to follow this custom list.

  • NotFound – The specified custom list does not exist.

await unfollow() None[source]#

This function is a coroutine.

The method will unfollow a custom list within the MangaDex API.

Raises:
  • Forbidden – You are not authorized to unfollow this custom list.

  • NotFound – The specified custom list does not exist.

Legacy#

class hondana.LegacyItem[source]#

A generic class representing a legacy ID mapping from the previous MangaDex API to the new.

id#

The legacy mapping UUID (NOT the new item UUID).

Type:

str

obj_new_id#

The target item’s new UUID.

Type:

str

obj_legacy_id#

The target item’s old API integer ID.

Type:

int

obj_type#

The type of the legacy item we resolved.

Type:

LegacyMappingType

Manga#

class hondana.Manga[source]#

A class representing a Manga returned from the MangaDex API.

id#

The UUID associated to this manga.

Type:

str

relation_type#

The type of relation this is, to the parent manga requested. Only available when get_related_manga() is called.

Type:

Optional[MangaRelationType]

alternate_titles#

The alternative title mapping for the Manga. i.e. {"en": "Some Other Title"}

Type:

LocalizedString

locked#

If the Manga is considered ‘locked’ or not in the API.

Type:

bool

The mapping of links the API has attributed to the Manga. (see: https://api.mangadex.org/docs.html#section/Static-data/Manga-links-data)

Type:

MangaLinks

original_language#

The language code for the original language of the Manga.

Type:

str

last_volume#

The last volume attributed to the manga, if any.

Type:

Optional[str]

last_chapter#

The last chapter attributed to the manga, if any.

Type:

Optional[str]

publication_demographic#

The attributed publication demographic(s) for the manga, if any.

Type:

Optional[PublicationDemographic]

year#

The year the manga was release, if the key exists.

Type:

Optional[int]

content_rating#

The content rating attributed to the manga, if any.

Type:

Optional[ContentRating]

chapter_numbers_reset_on_new_volume#

Whether the chapter numbers will reset on a new volume or not.

Type:

bool

latest_uploaded_chapter#

The ID of the latest uploaded chapter of this manga.

Type:

str

state#

The publication state of the Manga.

Type:

Optional[MangaState]

stats#

The statistics of the manga.

Type:

Optional[MangaStatistics]

version#

The version revision of this manga.

Type:

int

Note

The stats is only populated after get_statistics() is called.

property url: str#

The URL to this manga.

Returns:

The URL of the manga.

Return type:

str

property title: str#

The manga’s title.

Returns:

The title of the manga, defaults to the en key in the titles attribute of the response. Attempts to fall back to the manga’s default language, and failing that it will fall back to the next available key if en or default language key is not present.

Return type:

str

property description: Optional[str]#

The manga’s description/synopsis.

Returns:

The description of the manga, defaults to the en key in the titles. Falls back to the next available key if en is not present. If there is no description, returns None.

Return type:

Optional[str]

property raw_description: hondana.types.common.LocalizedString#

The raw description attribute from the manga’s payload from the API.

Returns:

The raw object from the manga’s api response payload. Provides no formatting on its own. Consider description() or localised_description() instead.

Return type:

LocalizedString

property alt_titles: hondana.types.common.LocalizedString#

The raw alt_titles attribute from the manga’s payload from the API.

Returns:

The raw object from the manga’s payload. Provides no formatting on its own. Consider localised_title() instead.

Return type:

hondana.types.common.LocalizedString

property created_at: datetime#

The date this manga was created.

Returns:

The UTC datetime of when this manga was created.

Return type:

datetime.datetime

property updated_at: datetime#

The date this manga was last updated.

Returns:

The UTC datetime of when this manga was last updated.

Return type:

datetime.datetime

tags#

The tags of this Manga.

Returns:

The list of tags that this manga is associated with.

Return type:

List[Tag]

property artists: Optional[list[hondana.artist.Artist]]#

The artists of the parent Manga.

Note

If the parent manga was not requested with the “artist” includes[] query parameter then this method will return None.

Returns:

The artists associated with this Manga.

Return type:

Optional[List[Artist]]

property authors: Optional[list[hondana.author.Author]]#

The artists of the parent Manga.

Note

If the parent manga was not requested with the “artist” includes[] query parameter then this method will return None.

Returns:

The artists associated with this Manga.

Return type:

Optional[List[Author]]

property cover: Optional[Cover]#

The cover of the manga.

Note

If the parent manga was not requested with the “cover” includes[] query parameter then this method will return None.

Returns:

The cover of the manga.

Return type:

Optional[Cover]

property related_manga: Optional[list[hondana.manga.Manga]]#

The related manga of the parent Manga.

Returns:

The related manga of the parent manga.

Return type:

Optional[List[Manga]]

await get_artists() Optional[list[hondana.artist.Artist]][source]#

This function is a coroutine.

This method will return the artists of the manga and caches the response.

Note

If the parent manga was requested with the “artist” includes[] query parameter, then this method will not make extra API calls to retrieve the artist data.

Returns:

The artists of the manga.

Return type:

Optional[List[Author]]

await get_authors() Optional[list[hondana.author.Author]][source]#

This function is a coroutine.

This method will return the authors of the manga and caches the response.

Note

If the parent manga was requested with the “author” includes[] query parameter, then this method will not make extra API calls to retrieve the author data.

Returns:

The authors of the manga.

Return type:

Optional[List[Author]]

await get_cover() Optional[Cover][source]#

This function is a coroutine.

This method will return the cover URL of the parent Manga if it exists and caches the response.

Returns:

The Cover associated with this Manga.

Return type:

Optional[Cover]

cover_url(*, size: Optional[Literal[256, 512]] = None) Optional[str][source]#

This method will return a direct url to the cover art of the parent Manga.

If the manga was requested without the "cover_art" includes[] parameters, then this method will return None.

Note

For a more stable cover return, try get_cover()

This function is a coroutine.

This method will return all the related manga and cache their response.

Parameters:
  • limit (int) – The amount of manga to fetch. Defaults to 100.

  • offset (int) – The pagination offset. Defaults to 0.

Note

If the parent manga was requested with the “manga” includes[] query parameter, then this method will not make extra API calls to retrieve manga data.

Returns:

The related manga of the parent.

Return type:

Optional[List[Manga]]

await update(*, title: Optional[LocalizedString] = None, alt_titles: Optional[list[LocalizedString]] = None, description: Optional[LocalizedString] = None, authors: Optional[list[str]] = None, artists: Optional[list[str]] = None, links: Optional[manga.MangaLinks] = None, original_language: Optional[str] = None, last_volume: Optional[str] = ..., last_chapter: Optional[str] = ..., publication_demographic: PublicationDemographic = ..., status: Optional[MangaStatus] = None, year: Optional[int] = ..., content_rating: Optional[ContentRating] = None, tags: Optional[QueryTags] = None, primary_cover: Optional[str] = ..., version: int) Manga[source]#

This function is a coroutine.

This method will update the current Manga within the MangaDex API.

Parameters:
  • title (Optional[LocalizedString]) – The manga titles in the format of language_key: title i.e. {"en": "Some Manga Title"}

  • alt_titles (Optional[List[LocalizedString]]) – The alternative titles in the format of language_key: title i.e. [{"en": "Some Other Title"}, {"fr": "Un Autre Titre"}]

  • description (Optional[LocalizedString]) – The manga description in the format of language_key: description i.e. {"en": "My amazing manga where x y z happens"}

  • authors (Optional[List[str]]) – The list of author UUIDs to credit to this manga.

  • artists (Optional[List[str]]) – The list of artist UUIDs to credit to this manga.

  • links (Optional[MangaLinks]) – The links relevant to the manga. See here for more details: https://api.mangadex.org/docs.html#section/Static-data/Manga-links-data

  • original_language (Optional[str]) – The language key for the original language of the manga.

  • last_volume (Optional[str]) – The last volume to attribute to this manga.

  • last_chapter (Optional[str]) – The last chapter to attribute to this manga.

  • publication_demographic (Optional[PublicationDemographic]) – The target publication demographic of this manga.

  • status (Optional[MangaStatus]) – The status of the manga.

  • year (Optional[int]) – The release year of the manga.

  • content_rating (Optional[ContentRating]) – The content rating of the manga.

  • tags (Optional[QueryTags]) – The QueryTags instance for the list of tags to attribute to this manga.

  • primmary_cover (Optional[str]) – The UUID representing the cover that should show for this manga as it’s primary.

  • version (int) – The revision version of this manga.

Note

The last_volume, last_chapter, publication_demographic, year and primary_cover parameters are nullable in the API. Pass None explicitly to do so.

Raises:
  • BadRequest – The query parameters were not valid.

  • Forbidden – The update returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

Returns:

The manga that was returned after creation.

Return type:

Manga

await delete() None[source]#

This function is a coroutine.

This method will delete a Manga from the MangaDex API.

Raises:
  • Forbidden – The update returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

await unfollow() None[source]#

This function is a coroutine.

This method will unfollow the current Manga for the logged-in user in the MangaDex API.

Raises:
  • Forbidden – The request returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

await follow(*, set_status: bool = True, status: ReadingStatus = ReadingStatus.reading) None[source]#

This function is a coroutine.

This method will follow the current Manga for the logged-in user in the MangaDex API.

Parameters:
  • set_status (bool) – Whether to set the reading status of the manga you follow. Due to the current MangaDex infrastructure, not setting a status will cause the manga to not show up in your lists. Defaults to True

  • status (ReadingStatus) – The status to apply to the newly followed manga. Irrelevant if set_status is False.

Raises:
  • Forbidden – The request returned an error due to authentication failure.

  • NotFound – The specified manga does not exist.

localised_title(language_code: hondana.types.common.LanguageCode, /) Optional[str][source]#

This method will attempt to return the current manga’s title in the provided language code. Falling back to the title.

Aliased to localized_title()

Parameters:

language_code (LanguageCode) – The language code to attempt to return the manga name in.

Returns:

The manga name in the provided language, if found.

Return type:

Optional[str]

localized_title(language_code: hondana.types.common.LanguageCode, /) Optional[str]#

This method will attempt to return the current manga’s title in the provided language code. Falling back to the title.

Aliased to localized_title()

Parameters:

language_code (LanguageCode) – The language code to attempt to return the manga name in.

Returns:

The manga name in the provided language, if found.

Return type:

Optional[str]

localised_description(language_code: hondana.types.common.LanguageCode, /) Optional[str][source]#

This method will attempt to return the current manga’s description in the provided language code. Falling back to the description.

Aliased to localized_description()

Parameters:

language_code (LanguageCode) – The language code to attempt to return the manga description in.

Returns:

The manga description in the provided language, if found.

Return type:

Optional[str]

localized_description(language_code: hondana.types.common.LanguageCode, /) Optional[str]#

This method will attempt to return the current manga’s description in the provided language code. Falling back to the description.

Aliased to localized_description()

Parameters:

language_code (LanguageCode) – The language code to attempt to return the manga description in.

Returns:

The manga description in the provided language, if found.

Return type:

Optional[str]

await feed(*, limit: ~typing.Optional[int] = 100, offset: int = 0, translated_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, excluded_original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, content_rating: ~typing.Optional[list[hondana.enums.ContentRating]] = None, excluded_groups: ~typing.Optional[list[str]] = None, excluded_uploaders: ~typing.Optional[list[str]] = None, include_future_updates: ~typing.Optional[bool] = None, created_at_since: ~typing.Optional[~datetime.datetime] = None, updated_at_since: ~typing.Optional[~datetime.datetime] = None, published_at_since: ~typing.Optional[~datetime.datetime] = None, order: ~typing.Optional[~hondana.query.FeedOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>, include_empty_pages: ~typing.Optional[bool] = None, include_future_publish_at: ~typing.Optional[bool] = None, include_external_url: ~typing.Optional[bool] = None) ChapterFeed[source]#

This function is a coroutine.

This method returns the current manga’s chapter feed.

Parameters:
  • limit (Optional[int]) – Defaults to 100. The maximum amount of chapters to return-in the response.

  • offset (int) – Defaults to 0. The pagination offset for the request.

  • translated_language (List[str]) – A list of language codes to filter the returned chapters with.

  • original_language (List[LanguageCode]) – A list of language codes to filter the original language of the returned chapters with.

  • excluded_original_language (List[LanguageCode]) – A list of language codes to negate filter the original language of the returned chapters with.

  • content_rating (Optional[List[ContentRating]]) – The content rating to filter the feed by.

  • excluded_groups (Optional[List[str]]) – The list of scanlator groups to exclude from the response.

  • excluded_uploaders (Optional[List[str]]) – The list of uploaders to exclude from the response.

  • include_future_updates (Optional[bool]) – Whether to include future chapters in this feed. Defaults to True API side.

  • created_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their creation date.

  • updated_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their updated at date.

  • published_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their published at date.

  • order (Optional[FeedOrderQuery]) – A query parameter to choose how the responses are ordered. i.e. {"chapters": "desc"}

  • includes (Optional[ChapterIncludes]) – The list of options to include increased payloads for per chapter. Defaults to these values.

  • include_empty_pages (Optional[bool]) – Whether to show chapters with no pages available.

  • include_future_publish_at (Optional[bool]) – Whether to show chapters with a publishAt value set in the future.

  • includeExternalUrl (Optional[bool]) – Whether to show chapters that have an external URL attached to them.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Raises:

BadRequest – The query parameters were malformed.

Returns:

Returns a collection of chapters.

Return type:

ChapterFeed

await update_read_markers() manga.MangaReadMarkersResponse[source]#

This function is a coroutine.

This method will return the read chapters of the current manga.

Returns:

The raw payload of the API. Contains a list of read chapter UUIDs.

Return type:

hondana.types.manga.MangaReadMarkersResponse

await bulk_update_read_markers(*, update_history: bool = True, read_chapters: Optional[list[str]], unread_chapters: Optional[list[str]]) None[source]#

This function is a coroutine.

This method will batch update your read chapters for a given Manga.

Parameters:
  • update_history (bool) – Whether to show this chapter in the authenticated user’s read history. Defaults to True.

  • read_chapters (Optional[List[str]]) – The read chapters for this Manga.

  • unread_chapters (Optional[List[str]]) – The unread chapters for this Manga.

Raises:

TypeError – You must provide one or both of the parameters read_chapters and/or unread_chapters.

await get_reading_status() manga.MangaSingleReadingStatusResponse[source]#

This function is a coroutine.

This method will return the current reading status for the current manga.

Raises:
  • Forbidden – You are not authenticated to perform this action.

  • NotFound – The specified manga does not exist, likely due to an incorrect ID.

Returns:

The raw payload from the API response.

Return type:

MangaSingleReadingStatusResponse

await update_reading_status(*, status: ReadingStatus) None[source]#

This function is a coroutine.

This method will update your current reading status for the current manga.

Parameters:

status (ReadingStatus) – The reading status you wish to update this manga with.

Note

Leaving status as the default will remove the manga reading status from the API. Please provide a value if you do not wish for this to happen.

Raises:
  • BadRequest – The query parameters were invalid.

  • NotFound – The specified manga cannot be found, likely due to incorrect ID.

await get_volumes_and_chapters(*, translated_language: Optional[list[LanguageCode]] = None, groups: Optional[list[str]] = None) manga.GetMangaVolumesAndChaptersResponse[source]#

This function is a coroutine.

This endpoint returns the raw relational mapping of a manga’s volumes and chapters.

Parameters:
  • translated_language (Optional[List[LanguageCode]]) – The list of language codes you want to limit the search to.

  • groups (Optional[List[str]]) – A list of scanlator groups to filter the results by.

Returns:

The raw payload from mangadex. There is no guarantee of the keys here.

Return type:

GetMangaVolumesAndChaptersResponse

await add_to_custom_list(*, custom_list_id: str) None[source]#

This function is a coroutine.

This method will add the current manga to the specified custom list.

Parameters:

custom_list_id (str) – The UUID associated with the custom list you wish to add the manga to.

Raises:
  • Forbidden – You are not authorised to add manga to this custom list.

  • NotFound – The specified manga or specified custom list are not found, likely due to an incorrect UUID.

await remove_from_custom_list(*, custom_list_id: str) None[source]#

This function is a coroutine.

This method will remove the current manga from the specified custom list.

Parameters:

custom_list_id (str) – THe UUID associated with the custom list you wish to add the manga to.

Raises:
  • Forbidden – You are not authorised to remove a manga from the specified custom list.

  • NotFound – The specified manga or specified custom list are not found, likely due to an incorrect UUID.

await get_chapters(*, limit: ~typing.Optional[int] = 10, offset: int = 0, ids: ~typing.Optional[list[str]] = None, title: ~typing.Optional[str] = None, groups: ~typing.Optional[list[str]] = None, uploader: ~typing.Optional[str] = None, volumes: ~typing.Optional[list[str]] = None, chapter: ~typing.Optional[list[str]] = None, translated_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, excluded_original_language: ~typing.Optional[list[hondana.types.common.LanguageCode]] = None, content_rating: ~typing.Optional[list[hondana.enums.ContentRating]] = None, excluded_groups: ~typing.Optional[list[str]] = None, excluded_uploaders: ~typing.Optional[list[str]] = None, include_future_updates: ~typing.Optional[bool] = None, include_empty_pages: ~typing.Optional[bool] = None, include_future_publish_at: ~typing.Optional[bool] = None, include_external_url: ~typing.Optional[bool] = None, created_at_since: ~typing.Optional[~datetime.datetime] = None, updated_at_since: ~typing.Optional[~datetime.datetime] = None, published_at_since: ~typing.Optional[~datetime.datetime] = None, order: ~typing.Optional[~hondana.query.FeedOrderQuery] = None, includes: ~typing.Optional[~hondana.query.ChapterIncludes] = <ChapterIncludes manga=True user=True scanlation_group=True>) ChapterFeed[source]#

This function is a coroutine.

This method will return a list of published chapters.

Parameters:
  • limit (Optional[int]) – Defaults to 100. This specifies the amount of chapters to return in one request.

  • offset (int) – Defaults to 0. This specifies the pagination offset.

  • ids (Optional[List[str]]) – The list of chapter UUIDs to filter the request with.

  • title (Optional[str]) – The chapter title query to limit the request with.

  • groups (Optional[List[str]]) – The scanlation group UUID(s) to limit the request with.

  • uploader (Optional[str]) – The uploader UUID to limit the request with.

  • volumes (Optional[Union[str, List[str]]]) – The volume UUID or UUIDs to limit the request with.

  • chapter (Optional[Union[str, List[str]]]) – The chapter UUID or UUIDs to limit the request with.

  • translated_language (Optional[List[LanguageCode]]) – The list of languages codes to filter the request with.

  • original_language (Optional[List[LanguageCode]]) – The list of languages to specifically target in the request.

  • excluded_original_language (Optional[List[LanguageCode]]) – The list of original languages to exclude from the request.

  • content_rating (Optional[List[ContentRating]]) – The content rating to filter the feed by.

  • excluded_groups (Optional[List[str]]) – The list of scanlator groups to exclude from the response.

  • excluded_uploaders (Optional[List[str]]) – The list of uploaders to exclude from the response.

  • include_future_updates (Optional[bool]) – Whether to include future chapters in this feed. Defaults to True API side.

  • include_empty_pages (Optional[bool]) – Whether to include chapters that have no recorded pages.

  • include_future_publish_at (Optional[bool]) – Whether to include chapters that have a publish_at set to a time in the future.

  • include_external_url (Optional[bool]) – Whether to include chapters that have an external url set.

  • created_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their creation date.

  • updated_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their updated at date.

  • published_at_since (Optional[datetime.datetime]) – A start point to return chapters from based on their published at date.

  • order (Optional[FeedOrderQuery]) – A query parameter to choose how the responses are ordered. i.e. {"chapters": "desc"}

  • includes (Optional[ChapterIncludes]) – The list of options to include increased payloads for per chapter. Defaults to all values.

Note

Passing None to limit will attempt to retrieve all items in the chapter feed.

Note

If order is not specified then the API will return results first based on their creation date, which could lead to unexpected results.

Raises:

BadRequest – The query parameters were malformed

Returns:

Returns a collection of chapters.

Return type:

ChapterFeed

await get_draft() Manga[source]#

This function is a coroutine.

This method will return a manga draft from MangaDex.

Returns:

The Manga returned from the API.

Return type:

Manga

await submit_draft(*, version: int) Manga[source]#

This function is a coroutine.

This method will submit a draft for a manga.

Parameters:

version (int) – The version of the manga we’re attributing this submission to.

Raises:
  • BadRequest – The request parameters were incorrect or malformed.

  • Forbidden – You are not authorised to perform this action.

  • NotFound – The manga was not found.

Return type:

Manga

await get_relations(*, includes: ~typing.Optional[~hondana.query.MangaIncludes] = <MangaIncludes author=True artist=True cover_art=True manga=True>) MangaRelationCollection[source]#

This function is a coroutine.

This method will return a list of all relations to a given manga.

Parameters:

includes (Optional[MangaIncludes]) – The optional parameters for expanded requests to the API. Defaults to all possible expansions.

Raises:

BadRequest – The manga ID passed is malformed

Return type:

MangaRelationCollection

await upload_cover(*, cover: bytes, volume: Optional[str] = None, description: str, locale: Optional[hondana.types.common.LanguageCode] = None) Cover[source]#

This function is a coroutine.

This method will upload a cover to the MangaDex API.

Parameters:
  • cover (bytes) – THe raw bytes of the image.

  • volume (Optional[str]) – The volume this cover relates to.

  • description (str) – The description of this cover.

  • locale (Optional[LanguageCode]) – The locale of this cover.

Raises:
  • BadRequest – The volume parameter was malformed or the file was a bad format.

  • Forbidden – You are not permitted for this action.

Return type:

Cover

await create_relation(*, target_manga: str, relation_type: MangaRelationType) MangaRelation[source]#

This function is a coroutine.

This method will create a manga relation.

Parameters:
Raises:
  • BadRequest – The parameters were malformed

  • Forbidden – You are not authorised for this action.

Return type:

MangaRelation

await delete_relation(relation_id: str, /) None[source]#

This function is a coroutine.

This method will delete a manga relation.

Parameters:

relation_id (str) – The ID of the related manga.

await set_rating(*, rating: int) None[source]#

This function is a coroutine.

This method will set your rating on the manga. This method overwrites your previous set rating, if any.

Parameters:

rating (int) – The rating value, between 0 and 10.

Raises:
  • Forbidden – The request returned a response due to authentication failure.

  • NotFound – The specified manga UUID was not found or does not exist.

await delete_rating() None[source]#

This function is a coroutine.

This method will delete your set rating on the manga.

Raises:
  • Forbidden – The request returned a response due to authentication failure.

  • NotFound – The specified manga UUID was not found or does not exist.

await get_statistics() MangaStatistics[source]#

This function is a coroutine.

This method will fetch statistics on the current manga, and cache them as the stats

Return type:

MangaStatistics

class hondana.MangaRelation[source]#

A class representing a MangaRelation returned from the MangaDex API.

source_manga_id#

The UUID associated to the parent manga of this relation.

Type:

str

id#

The UUID associated to this manga relation.

Type:

str

version#

The version revision of this manga relation.

Type:

int

relation_type#

The type of relationship to the source manga.

Type:

MangaRelationType

class hondana.MangaStatistics[source]#

A small object to house manga statistics.

follows#

The number of follows this manga has.

Type:

int

parent_id#

The manga these statistics belong to.

Type:

str

average#

The average mean score of the manga ratings.

Type:

Optional[float]

bayesian#

The bayesian average score of the manga ratings.

Type:

Optional[float]

distribution#

The scoring distribution of the manga. Keys are 1-10 and values are total amount of ratings per key.

Type:

Optional[Dict[str, int]]

Note

The distribution attribute will be None unless this object was created with get_manga_statistics() or get_statistics()

class hondana.MangaRating[source]#

A small object to encompass your personal manga ratings.

parent_id#

The parent manga this rating belongs to.

Type:

str

rating#

Your personal rating for this manga, between 1 and 10.

Type:

int

created_at#

When you created the rating, as a UTC aware datetime.

Type:

datetime.datetime

Query#

class hondana.query.MangaListOrderQuery(**kwargs: Order)[source]#
Parameters:
  • title (Order) – Title ordering.

  • year (Order) – Year ordering.

  • created_at (Order) – Ordering by creation date.

  • updated_at (Order) – Ordering by last updated date.

  • latest_uploaded_chapter (Order) – Ordering by latest uploaded chapter.

  • followed_count (Order) – Ordering by followed count.

  • relevance (Order) – Ordering by relevance to search query.

  • rating (Order) – Ordering by rating.

class hondana.query.FeedOrderQuery(**kwargs: Order)[source]#
Parameters:
  • created_at (Order) – Ordering by creation date.

  • updated_at (Order) – Ordering by last updated date.

  • publish_at (Order) – Ordering by published at date.

  • readable_at (Order) – Ordering by when the chapters are readable.

  • volume (Order) – Ordering by volume number.

  • chapter (Order) – Ordering by chapter number.

class hondana.query.MangaDraftListOrderQuery(**kwargs: Order)[source]#
Parameters:
  • title (Order) – Title ordering.

  • year (Order) – Year ordering.

  • created_at (Order) – Ordering by creation date.

  • updated_at (Order) – Ordering by last updated date.

class hondana.query.CoverArtListOrderQuery(**kwargs: Order)[source]#
Parameters:
  • created_at (Order) – Ordering by creation date.

  • updated_at (Order) – Ordering by last updated date.

  • volume (Order) – Ordering by volume number.

class hondana.query.ScanlatorGroupListOrderQuery(**kwargs: Order)[source]#
Parameters:
  • name (Order) – Name ordering.

  • created_at (Order) – Ordering by creation date.

  • updated_at (Order) – Ordering by last updated date.

  • followed_count (Order) – Ordering by followed count.

  • relevance (Order) – Ordering by relevance to search query.

class hondana.query.AuthorListOrderQuery(**kwargs: Order)[source]#
Parameters:

name (Order) – Name ordering.

class hondana.query.UserListOrderQuery(**kwargs: Order)[source]#
Parameters:

username (Order) – Username ordering.

class hondana.query.ArtistIncludes(*, manga: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:

manga (bool) – Defaults to True. Whether to include manga in the relationships.

class hondana.query.AuthorIncludes(*, manga: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:

manga (bool) – Defaults to True. Whether to include manga in the relationships.

class hondana.query.ChapterIncludes(*, manga: bool = True, user: bool = True, scanlation_group: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:
  • manga (bool) – Defaults to True. Whether to include manga in the relationships.

  • user (bool) – Defaults to True. Whether to include user in the relationships.

  • scanlation_group (bool) – Defaults to True. Whether to include scanlator group in the relationships.

class hondana.query.CoverIncludes(*, manga: bool = True, user: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:
  • manga (bool) – Defaults to True. Whether to include manga in the relationships.

  • user (bool) – Defaults to True. Whether to include user in the relationships.

class hondana.query.CustomListIncludes(*, manga: bool = True, user: bool = True, owner: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:
  • manga (bool) – Defaults to True. Whether to include manga in the relationships.

  • user (bool) – Defaults to True. Whether to include user in the relationships.

  • owner (bool) – Defaults to True. Whether to include owner in the relationships.

class hondana.query.MangaIncludes(*, author: bool = True, artist: bool = True, cover_art: bool = True, manga: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:
  • author (bool) – Defaults to True. Whether to include author in the relationships.

  • artist (bool) – Defaults to True. Whether to include artist in the relationships.

  • cover_art (bool) – Defaults to True. Whether to include cover in the relationships.

  • manga (bool) – Defaults to True. Whether to include manga in the relationships.

class hondana.query.ScanlatorGroupIncludes(*, leader: bool = True, member: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:
  • leader (bool) – Defaults to True. Whether to include leader in the relationships.

  • member (bool) – Defaults to True. Whether to include members in the relationships.

class hondana.query.UserReportIncludes(*, user: bool = True, reason: bool = True)[source]#

A helper for generating the includes[] parameter for queries.

Parameters:
  • user (bool) – Defaults to True. Whether to include user in the relationships.

  • reason (bool) – Defaults to True. Whether to include report in the relationships.

Relationship#

class hondana.Relationship[source]#

An open container type representing an arbitrary relationship within MangaDex.

Note

Relationships are similar to full objects, except they store no relationships of their own. Each “object” retrieved here will be a partial variant.

id#

The ID relating to this relationship.

Type:

str

type#

The type of relationship.

Type:

str

attributes#

The attributes of this relationship.

Type:

Mapping[str, Any]

Report#

class hondana.ReportDetails(*, category: ~typing.Literal[<ReportCategory.author: 'author'>], reason: ~hondana.enums.AuthorReportReason, details: ..., target_id: ...)[source]#
class hondana.ReportDetails(*, category: ~typing.Literal[<ReportCategory.chapter: 'chapter'>], reason: ~hondana.enums.ChapterReportReason, details: ..., target_id: ...)
class hondana.ReportDetails(*, category: ~typing.Literal[<ReportCategory.scanlation_group: 'scanlation_group'>], reason: ~hondana.enums.ScanlationGroupReportReason, details: ..., target_id: ...)
class hondana.ReportDetails(*, category: ~typing.Literal[<ReportCategory.manga: 'manga'>], reason: ~hondana.enums.MangaReportReason, details: ..., target_id: ...)
class hondana.ReportDetails(*, category: ~typing.Literal[<ReportCategory.user: 'user'>], reason: ~hondana.enums.UserReportReason, details: ..., target_id: ...)

A helper object for creating reports to send to MangaDex.

Parameters:
class hondana.UserReport[source]#

A user generated report on MangaDex.

id#

This report’s ID.

Type:

str

details#

The report’s details

Type:

str

object_id#

The target object’s ID.

Type:

str

status#

The current status of the report.

Type:

ReportStatus

property created_at: datetime#

Returns the date this report was created in UTC.

Returns:

The date this report was created.

Return type:

datetime.datetime

class hondana.Report[source]#
id#

The UUID of this report.

Type:

str

reason#

The reason for this report.

Type:

str

details_required#

If details are required for this report.

Type:

bool

category#

The category this report falls under.

Type:

ReportCategory

version#

The version revision of this report.

Type:

int

Scanlation Group#

class hondana.ScanlatorGroup[source]#

A class representing a Scanlator Group from the MangaDex API.

id#

The UUID relating to this scanlator group.

Type:

str

name#

The name of the scanlator group.

Type:

str

alt_names#

The alternate names for this group, if any.

Type:

List[str]

website#

The website of this scanlator group.

Type:

str

irc_server#

The IRC server for this scanlator group.

Type:

str

irc_channel#

The IRC channel for this scanlator group.

Type:

str

discord#

The Discord server for this scanlator group.

Type:

str

focused_languages#

The scanlator group’s focused languages, if any.

Type:

Optional[List[str]]

contact_email#

The contact email for this scanlator group.

Type:

str

description#

The description of this scanlator group.

Type:

str

twitter#

The twitter URL of the group, if any.

Type:

Optional[str]

manga_updates#

The URL where the group posts their updates, if any.

Type:

Optional[str]

locked#

If this scanlator group is considered ‘locked’ or not.

Type:

bool

official#

Whether the group is official or not.

Type:

bool

verified#

Whether this group is verified or not.

Type:

bool

inactive#

Whether this group is inactive or not.

Type:

bool

version#

The version revision of this scanlator group.

Type:

int

property created_at: datetime#

Returns the time when the ScanlatorGroup was created.

Return type:

datetime.datetime

property updated_at: datetime#

Returns the time when the ScanlatorGroup was last updated.

Return type:

datetime.datetime

property url: str#

The URL to this scanlator group.

Returns:

The URL of the scanlator group.

Return type:

str

property publish_delay: Optional[timedelta]#

The publishing delay of this scanlation group.

Returns:

The default timedelta offset at which this group releases their chapters, if any.

Return type:

Optional[datetime.timedelta]

property leader: Optional[User]#

The leader of this scanlation group, if any.

Returns:

The leader of the scanlation group.

Return type:

Optional[User]

property members: Optional[list[User]]#

The members of this scanlation group, if any.

Returns:

The members of the scanlation group.

Return type:

Optional[List[User]]

await get_leader() Optional[User][source]#

This function is a coroutine.

This method will return the User representing the leader of the scanlation group.

Note

If the ScanlatorGroup was requested with the leader includes, then this method will not make an API call.

Note

If this object was created as part of another object’s includes then this will return None. This is due to having no relationship data.

Returns:

The leader of the ScanlatorGroup, if present.

Return type:

Optional[User]

await get_members() Optional[list[User]][source]#

This function is a coroutine.

This method will return a list of members of the scanlation group, if present.

Note

If the ScanlatorGroup was requested with the member includes, this method will not make API calls.

Note

If this object was created as part of another object’s includes then this will return None. This is due to having no relationship data.

Returns:

The list of members of the scanlation group.

Return type:

Optional[List[User]]

await delete() None[source]#

This function is a coroutine.

This method will delete the current scanlation group.

Raises:
  • Forbidden – You are not authorized to delete this scanlation group.

  • NotFound – The scanlation group cannot be found, likely due to an incorrect ID.

await follow() None[source]#

This function is a coroutine.

This method will follow the current scanlation group.

Raises:

NotFound – The scanlation group cannot be found, likely due to an incorrect ID.

await unfollow() None[source]#

This function is a coroutine.

This method will unfollow the current scanlation group.

Raises:

NotFound – The scanlation group cannot be found, likely due to an incorrect ID.

await update(*, name: Optional[str] = None, leader: Optional[str] = None, members: Optional[list[str]] = None, website: Optional[str] = ..., irc_server: Optional[str] = ..., irc_channel: Optional[str] = ..., discord: Optional[str] = ..., contact_email: Optional[str] = ..., description: Optional[str] = ..., twitter: Optional[str] = ..., manga_updates: Optional[str] = ..., focused_languages: list[hondana.types.common.LanguageCode] = ..., inactive: Optional[bool] = None, locked: Optional[bool] = None, publish_delay: Optional[Union[str, timedelta]] = ..., version: int) ScanlatorGroup[source]#

This function is a coroutine.

This method will update a scanlation group within the MangaDex API.

Parameters:
  • name (Optional[str]) – The name to update the group with.

  • leader (Optional[str]) – The UUID of the leader to update the group with.

  • members (Optional[str]) – A list of UUIDs relating to the members to update the group with.

  • website (Optional[str]) – The website to update the group with.

  • irc_server (Optional[str]) – The IRC Server to update the group with.

  • irc_channel (Optional[str]) – The IRC Channel to update the group with.

  • discord (Optional[str]) – The discord server to update the group with.

  • contact_email (Optional[str]) – The contact email to update the group with.

  • description (Optional[str]) – The new description to update the group with.

  • twitter (Optional[str]) – The new twitter url to update the group with.

  • manga_updates (Optional[str]) – The URL for this group’s manga updates page, if any.

  • focused_languages (Optional[List[LanguageCode]]) – The new list of language codes to update the group with.

  • inactive (Optional[bool]) – If the group is inactive or not.

  • locked (Optional[bool]) – Update the lock status of this scanlator group.

  • publish_delay (Optional[Union[str, datetime.timedelta]]) – The publishing delay to add to all group releases.

  • version (int) – The version revision of this scanlator group.

Note

The website, irc_server, irc_channel, discord, contact_email, description, twitter, manga_updates, focused_language and publish_delay keys are all nullable in the API. To do so pass None explicitly to these keys.

Note

The publish_delay parameter must match the hondana.utils.MANGADEX_TIME_REGEX pattern or be a valid datetime.timedelta.

Raises:
  • BadRequest – The request body was malformed

  • Forbidden – You are not authorized to update this scanlation group.

  • NotFound – The passed scanlation group ID cannot be found.

Returns:

The group returned from the API after its update.

Return type:

ScanlatorGroup

Tag#

class hondana.Tag[source]#

A class representing a single Tag from MangaDex.

id#

The UUID associated with this tag.

Type:

str

group#

The group (or kind) of tag. e.g. if it is a genre specification, or theme.

Type:

str

version#

Version revision of this tag.

Type:

int

Note

The tag descriptions are currently empty, but seemingly they will be localised descriptions of each one. i.e. [{"en": "some tag description"}]

Note

All tag names currently only have the "en" key attributed to their localization, so we return this by default.

property name: str#

The name of the tag.

Return type:

str

property description: str | None#

The description of the tag, if any.

Return type:

Optional[str]

property url: str#

The URL to this tag. Allows browsing all manga attributed to this tag

Returns:

The URL of the tag.

Return type:

str

relationships#

The relationships of this Tag.

Returns:

The list of relationships this tag has.

Return type:

List[Relationship]

QueryTags#

class hondana.QueryTags(*tags: str, mode: Literal['AND', 'OR'] = 'AND')[source]#

Utility class for creating a Tag based query.

tags#

The tag names you are going to query.

Type:

List[str]

mode#

The logical operation for the tags.

Type:

Literal["AND", "OR"]

Raises:
  • TypeError – The mode specified for the builder is not one of “AND” or “OR”

  • ValueError – The tags passed did not align with MangaDex tags.

Note

The tags passed need to match the local cache of the tags. If you feel this is out of date, you can try the helper method update_tags()

User#

class hondana.User[source]#

A class representing a user from the MangaDex API.

id#

The user’s UUID.

Type:

str

username#

The user’s username.

Type:

str

version#

The user’s version revision.

Type:

int

roles#

The list of roles this person has.

Type:

List[str]

Note

Unlike most other api objects, this type does not have related relationship properties due to not returning a full relationships key.

property url: str#

The URL to this user.

Returns:

The URL of the user.

Return type:

str

await get_scanlator_groups() Optional[list[hondana.scanlator_group.ScanlatorGroup]][source]#

This function is a coroutine.

This method will fetch the scanlator groups of this user from the API.

Returns:

The list of groups for this user, if any.

Return type:

Optional[List[ScanlatorGroup]]

await delete() None[source]#

This function is a coroutine.

This method will delete a user from the MangaDex API.

Raises:
  • Forbidden – The response returned an error due to authentication failure.

  • NotFound – The user specified cannot be found.

class hondana.user.UserInfo[source]#

A helper class for the permission attributes of the logged-in user’s token details.

type#

The type of token we have received.

Type:

Literal[session]

issuer#

The issuer of the token.

Type:

Literal[mangadex.org]

audience#

The target audience for the token.

Type:

Literal[mangadex.org]

issued_at#

When the token was issued.

Type:

datetime.datetime

not_before#

The datetime that the token is valid from.

Type:

datetime.datetime

expires#

When the token expires.

Type:

datetime.datetime

user_id#

The logged-in user’s UUID.

Type:

str

roles#

The list of roles the logged-in user has.

Type:

List[str]

permissions#

The list of permissions this user has.

Type:

List[str]

sid#

At the moment I’m not too sure what this is…

Type:

str

Utilities#

class hondana.utils.Route(verb: str, path: str, **parameters: Any)[source]#

A helper class for instantiating a HTTP method to MangaDex.

Parameters:
  • verb (str) – The HTTP verb you wish to perform, e.g. "POST"

  • path (str) – The prepended path to the API endpoint you with to target. e.g. "/manga/{manga_id}"

  • parameters (Any) – This is a special cased kwargs. Anything passed to these will substitute it’s key to value in the path. E.g. if your path is "/manga/{manga_id}", and your parameters are manga_id="...", then it will expand into the path making "manga/..."

class hondana.utils.CustomRoute(verb: str, base: str, path: str, **parameters: Any)[source]#

A helper class for instantiating a HTTP method to download from MangaDex.

Parameters:
  • verb (str) – The HTTP verb you wish to perform. E.g. "POST"

  • base (str) – The base URL for the download path.

  • path (str) – The prepended path to the API endpoint you with to target. e.g. "/manga/{manga_id}"

  • parameters (Any) – This is a special cased kwargs. Anything passed to these will substitute it’s key to value in the path. E.g. if your path is "/manga/{manga_id}", and your parameters are manga_id="...", then it will expand into the path making "manga/..."

hondana.utils.MANGADEX_TIME_REGEX#

r"^(P([1-9]|[1-9][0-9])D)?(P?([1-9])W)?(P?T(([1-9]|1[0-9]|2[0-4])H)?(([1-9]|[1-5][0-9]|60)M)?(([1-9]|[1-5][0-9]|60)S)?)?$"

This regex pattern follows the ISO-8601 standard (MangaDex uses PHP DateInterval). The pattern is usable but more meant as a guideline for your formatting.

It matches some things like: P1D2W (1 day, two weeks), P1D2WT3H4M (1 day, 2 weeks, 3 hours and 4 minutes)

hondana.utils.MANGADEX_URL_REGEX#

r"(?:http[s]?:\/\/)?mangadex\.org\/(?P<type>title|chapter|author|tag)\/(?P<ID>[a-z0-9]{8}\-[a-z0-9]{4}\-[a-z0-9]{4}\-[a-z0-9]{4}\-[a-z0-9]{12})\/?(?P<title>.*)"

This regex pattern can be used to isolate common elements from a MangaDex URL. This means that Manga, Chapter, Author or Tag urls can be parsed for their type, ID and title.

hondana.utils.php_query_builder(obj: dict[str, Union[str, int, bool, list[str], dict[str, str], NoneType]], /) MultiDict[Union[str, int]][source]#

A helper function that builds a MangaDex (PHP) query string from a mapping.

Parameters:

obj (Mapping[str, Optional[Union[str, int, bool, List[str], Dict[str, str]]]]) – The mapping to build the query string from.

Returns:

A dictionary/mapping type that allows for duplicate keys.

Return type:

multidict.MultiDict

hondana.utils.delta_to_iso(delta: timedelta, /) str[source]#

A helper method to dump a timedelta to an ISO 8601 timedelta string.

Parameters:

delta (datetime.timedelta) – The timedelta to convert.

Returns:

The converted string.

Return type:

str

hondana.utils.iso_to_delta(iso: str, /) timedelta[source]#

A helper method to load a timedelta from an ISO8601 string.

Parameters:

iso (str) – The ISO8601 datetime string to parse.

Raises:

TypeError – If the given string is not a valid ISO8601 string and does not match MANGADEX_TIME_REGEX.

Returns:

The timedelta based on the parsed string.

Return type:

datetime.timedelta

hondana.utils.clean_isoformat(dt: datetime, /) str[source]#

A helper method to cleanly convert a datetime (aware or naive) to a timezone-less ISO8601 string.

Parameters:

dt (datetime.datetime) – The datetime to convert.

Returns:

The ISO8601 string.

Return type:

str

Note

The passed datetime will have its timezone converted to UTC and then have its timezone stripped.

Enumerations#

We provide some enumeration types to avoid the API from being stringly typed in case the strings change in future.

class hondana.query.Order[source]#

Decides the ordering of the query.

ascending#

Sorts the query by key ascending.

descending#

Sorts the query by key descending.

class hondana.ContentRating[source]#

Specifies the content rating of the manga.

safe#

Rated safe.

suggestive#

Rated suggestive.

erotic#

Rated erotic.

pornographic#

Rated pornographic.

class hondana.PublicationDemographic[source]#

Specifies the demographic aim.

shounen#

This manga is aimed at shounen fans.

shoujo#

This manga is aimed at shoujo fans.

josei#

This manga is aimed at josei fans.

seinen#

This manga is aimed at seinen fans.

class hondana.CustomListVisibility[source]#

Specifies the visibility of a custom list.

public#

This custom list is public.

private#

This custom list is private.

class hondana.ReportCategory[source]#

Specifies the category a report belongs to.

manga#

This report is about a manga.

chapter#

This report is about a chapter.

scanlation_group#

This report is about a scanlation group.

user#

This report is about a user.

author#

This report is about an author.

class hondana.MangaStatus[source]#

Specifies the current manga publication status.

ongoing#

This manga is currently ongoing.

completed#

This manga has completed publication.

hiatus#

This manga is currently on hiatus.

cancelled#

This manga has been cancelled.

class hondana.ReadingStatus[source]#

Specifies the current reading status for this manga

reading#

This manga is currently being read.

on_hold#

This manga has been put on hold.

plan_to_read#

This manga is currently being planned to read.

dropped#

This manga was dropped.

re_reading#

This manga is currently being re-read.

completed#

This manga has been completed.

class hondana.MangaState[source]#

The current state of this manga draft.

draft#

This manga is currently in draft.

submitted#

This manga has been submitted.

published#

This manga has been published.

rejected#

This manga was rejected.

class hondana.MangaRelationType[source]#

Specifies the relation type to the parent manga.

monochrome#

The monochrome relation of the manga.

main_story#

The main story relation of the manga.

adapted_from#

The lead manga this one was adapter from.

based_on#

The manga that adapts from this one.

prequel#

The prequel to this manga.

side_story#

A side story to the current manga.

doujinshi#

A doujinshi relation of the current manga.

same_franchise#

A manga from the same franchise.

shared_universe#

A manga from the same universe.

sequel#

A sequel to the current manga.

spin_off#

A spin off of the current manga.

alternate_story#

An alternate story of the current manga.

preserialization#

A preserialization to the current manga.

alternate_version#

An alternate version to the current manga.

class hondana.AuthorReportReason[source]#

Specifies the report reason for author objects.

duplicate_entry#

The author is a duplicate entry.

information_to_correct#

There is incorrect information in the stored data of this author.

other#

Encapsulates misc reporting reasons.

troll_entry#

A misleading or intentionally erroneous entry.

class hondana.ChapterReportReason[source]#

Specifies the report reason for Chapter objects.

credit_page_in_the_middle_of_the_chapter#

The credit page for scan/tl/typeset group is in the middle of the chapter.

dupplicate_upload_from_same_user_or_group#

This scanlator group or user has a duplicate upload for this chapter.

extraneous_political_or_racebaiting_or_offensive_content#

This chapter contains unnecessary content.

fake_or_spam_chapter#

This chapter was created to be fake or spam.

group_lock_evasion#

This chapter was uploaded by a group evading a lock on their uploading capabilities.

images_not_loading#

This chapter has images that will not load.

incorrect_chapter_number#

This chapter’s number is incorrect.

incorrect_group#

This chapter has an incorrect scanlator group assigned.

incorrect_or_duplicate_pages#

This chapter has incorrect or duplicate pages.

incorrect_or_missing_chapter_title#

This chapter has an incorrect or missing title.

incorrect_or_missing_volume_number#

This chapter has an incorrect or missing volume number.

missing_pages#

This chapter has missing pages.

naming_rules_broken#

This chapter breaks the naming rules/conventions.

official_release_or_raw#

This chapter is from an official release or is a direct raw.

other#

Encapsulates miscellaneous report reasons.

pages_out_of_order#

This chapter has pages that are out of order.

released_before_raws_released#

This chapter was released before the source raw.

uploaded_on_wrong_manga#

This chapter has been uploaded on the wrong manga.

watermarked_images#

This chapter has watermarked images.

class hondana.ScanlationGroupReportReason[source]#

Specifies the report reason for Scanlator Group objects.

duplicate_entry#

This scanlator group is a duplicate entry.

group_claim_request#

This report is a request to claim this group.

inactivity_request#

This report is to notify of group inactivity.

information_to_correct#

There is information to correct on this group.

other#

Encapsulates miscellaneous report reasons.

troll_entry#

This group is a troll creation.

class hondana.MangaReportReason[source]#

Specifies the report reason for Manga objects.

duplicate_entry#

This manga is a duplicate entry.

information_to_correct#

This manga has information to be corrected.

other#

Encapsulates miscellaneous report reasons.

troll_entry#

This manga is a troll creation.

class hondana.UserReportReason[source]#

Specifies the report reason for User objects.

offensive_username_or_biography_or_avatar#

This user has an offensive entry on their public profile.

other#

Encapsulates miscellaneous report reasons.

spambot#

This user is a spambot.