Skip to content

ao3_sync.api.resources.BookmarksApi

API for handling AO3 bookmarks

Parameters:

Name Type Description Default
client AO3ApiClient

AO3ApiClient instance

required

Attributes:

Name Type Description
URL_PATH str

URL path for bookmarks

download(bookmarks, formats=DEFAULT_DOWNLOAD_FORMATS, after_item_sync=None)

Downloads the work download files for the given bookmarks.

Parameters:

Name Type Description Default
bookmarks list[Bookmark]

List of bookmarks to download

required
formats list[DownloadFormat]

Formats to download. Defaults to DEFAULT_DOWNLOAD_FORMATS

DEFAULT_DOWNLOAD_FORMATS

fetch_page(page, sort_by=DEFAULT_BOOKMARKS_SORT_OPTION, query_params=None)

Gets a page of bookmarks for the user.

Parameters:

Name Type Description Default
query_params dict

Query parameters for bookmarks

None

Returns:

Name Type Description
bookmarks Bookmark

List of bookmarks. Ordered from newest to oldest.

fetch_page_count()

Gets the number of bookmark pages for the user.

Returns:

Name Type Description
num_pages int

Number of bookmark pages

fetch_pages(start_page=1, end_page=None, sort_by=DEFAULT_BOOKMARKS_SORT_OPTION, query_params=None)

Gets a list of bookmarks for the user.

If end_page is not provided, it will download all bookmarks from start_page to the last page.

Parameters:

Name Type Description Default
start_page int

Starting page of bookmarks to download. Defaults to 1

1
end_page int

Ending page of bookmarks to download. Defaults to None

None
query_params dict

Query parameters for bookmarks

None

Returns:

Name Type Description
bookmarks Bookmark

List of bookmarks. Ordered from newest to oldest.

sync(start_page=1, end_page=None, sort_by=DEFAULT_BOOKMARKS_SORT_OPTION, query_params=None, formats=DEFAULT_DOWNLOAD_FORMATS)

Downloads the user's bookmarks from AO3.

Parameters:

Name Type Description Default
start_page int

Starting page of bookmarks to download. Defaults to 1

1
end_page int

Ending page of bookmarks to download. Defaults to None

None
query_params dict

Query parameters for bookmarks

None
formats list[DownloadFormat]

Formats to download. Defaults to DEFAULT_DOWNLOAD_FORMATS

DEFAULT_DOWNLOAD_FORMATS