Readarr

Note

An asynchronous version of this client is available as AsyncReadarr. The API is identical, but all methods are coroutines and must be awaited.

class pyarr._sync.readarr.Readarr(host: str, api_key: str, port: int = 8787, tls: bool = True, base_path: str = '', request_timeout: int | None = None, api_ver: str | None = None)[source]

Readarr API client.

Author

class pyarr._sync.readarr.author.Author(handler: RequestHandler)[source]

Author actions for Readarr.

get(item_id: int | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns authors by ID or all authors.

Parameters:

item_id (int | None, optional) – Database ID for author. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(author: dict[str, Any], root_dir: str, quality_profile_id: int, metadata_profile_id: int, monitored: bool = True, author_monitor: str = 'none', author_search_for_missing_books: bool = False) dict[str, Any][source]

Adds an author based on data from lookup.

Parameters:
  • author (JsonObject) – An author object from lookup().

  • root_dir (str) – Directory for books to be stored.

  • quality_profile_id (int) – Quality profile ID.

  • metadata_profile_id (int) – Metadata profile ID.

  • monitored (bool, optional) – Should the author be monitored. Defaults to True.

  • author_monitor (str, optional) – Monitor type. Defaults to β€œnone”.

  • author_search_for_missing_books (bool, optional) – Search for missing books. Defaults to False.

Returns:

Dictionary of added record.

Return type:

JsonObject

update(item_id: int, data: dict[str, Any]) dict[str, Any][source]

Update the given author.

Parameters:
  • item_id (int) – Author database ID to update.

  • data (JsonObject) – Parameters to update author.

Returns:

Dictionary with updated record.

Return type:

JsonObject

delete(item_id: int, delete_files: bool = False, import_list_exclusion: bool = False) None[source]

Delete the author with the given ID.

Parameters:
  • item_id (int) – Database ID for author.

  • delete_files (bool, optional) – Delete folder and files. Defaults to False.

  • import_list_exclusion (bool, optional) – Add exclusion. Defaults to False.

lookup(term: str) list[dict[str, Any]][source]

Searches for new authors using a term.

Parameters:

term (str) – Author name or book.

Returns:

List of dictionaries with items.

Return type:

JsonArray

Book

class pyarr._sync.readarr.book.Book(handler: RequestHandler)[source]

Book actions for Readarr.

get(item_id: int | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns books by ID or all books.

Parameters:

item_id (int | None, optional) – Database ID for book. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(book: dict[str, Any], root_dir: str, quality_profile_id: int, metadata_profile_id: int, monitored: bool = True, search_for_new_book: bool = False, author_monitor: str = 'all', author_search_for_missing_books: bool = False) dict[str, Any][source]

Add a new book and its associated author.

Parameters:
  • book (JsonObject) – A book object from lookup().

  • root_dir (str) – The root directory for the books to be saved.

  • quality_profile_id (int) – Quality profile ID.

  • metadata_profile_id (int) – Metadata profile ID.

  • monitored (bool, optional) – Monitor the book. Defaults to True.

  • search_for_new_book (bool, optional) – Look for new books. Defaults to False.

  • author_monitor (str, optional) – Author monitor type. Defaults to β€œall”.

  • author_search_for_missing_books (bool, optional) – Search missing books. Defaults to False.

Returns:

A copy of the added book.

Return type:

JsonObject

update(book: dict[str, Any], editions: list[dict[str, Any]]) dict[str, Any][source]

Update the given book.

Parameters:
  • book (JsonObject) – All parameters to update book.

  • editions (JsonArray) – List of editions to update.

Returns:

Dictionary with updated record.

Return type:

JsonObject

monitor(book_ids: list[int], monitored: bool = True) list[dict[str, Any]][source]

Update book monitored status.

Parameters:
  • book_ids (list[int]) – All book IDs to be updated.

  • monitored (bool, optional) – True or False. Defaults to True.

Returns:

list of dictionaries containing updated records.

Return type:

JsonArray

delete(item_id: int, delete_files: bool = False, import_list_exclusion: bool = False) None[source]

Delete the book with the given ID.

Parameters:
  • item_id (int) – Database ID for book.

  • delete_files (bool, optional) – Delete folder and files. Defaults to False.

  • import_list_exclusion (bool, optional) – Add exclusion. Defaults to False.

lookup(term: str) list[dict[str, Any]][source]

Search for a book to add to the database.

Parameters:

term (str) – Search term.

Returns:

List of dictionaries with items.

Return type:

JsonArray

Edition

class pyarr._sync.readarr.edition.Edition(handler: RequestHandler)[source]

Edition actions for Readarr.

get(book_id: int) list[dict[str, Any]][source]

Get editions for a specific book.

Parameters:

book_id (int) – Database ID of book.

Returns:

List of dictionaries with items.

Return type:

JsonArray

Metadata Profile

class pyarr._sync.readarr.metadata_profile.MetadataProfile(handler: RequestHandler)[source]

Metadata profile actions for Readarr.

get(item_id: int | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns metadata profiles by ID or all profiles.

Parameters:

item_id (int | None, optional) – Database ID for profile. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(name: str, min_popularity: int, skip_missing_date: bool, skip_missing_isbn: bool, skip_parts_and_sets: bool, skip_series_secondary: bool, allowed_languages: str, min_pages: int) dict[str, Any][source]

Add a metadata profile.

Parameters:
  • name (str) – Name of the profile.

  • min_popularity (int) – Minimum popularity.

  • skip_missing_date (bool) – Skip missing dates.

  • skip_missing_isbn (bool) – Skip missing ISBN.

  • skip_parts_and_sets (bool) – Skip parts and sets.

  • skip_series_secondary (bool) – Skip series secondary.

  • allowed_languages (str) – List of allowed languages.

  • min_pages (int) – Minimum pages.

Returns:

Dictionary of added record.

Return type:

JsonObject

delete(item_id: int) None[source]

Delete a metadata profile by ID.

Parameters:

item_id (int) – Database ID for profile.

Release Profile

class pyarr._sync.readarr.release_profile.ReleaseProfile(handler: RequestHandler)[source]

Release profile actions for Readarr.

get(item_id: int | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns release profiles by ID or all profiles.

Parameters:

item_id (int | None, optional) – Database ID for profile. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(ignored: list, required: list, indexer_id: int = 0, tags: list[int] | None = None, enabled: bool = True, include_preferred_when_renaming: bool = False) dict[str, Any][source]

Add a release profile.

Parameters:
  • ignored (list) – List of terms to ignore.

  • required (list) – List of terms required.

  • indexer_id (int, optional) – ID for preferred indexer. Defaults to 0.

  • tags (list[int] | None, optional) – List of tag IDs. Defaults to None.

  • enabled (bool, optional) – Enable profile. Defaults to True.

  • include_preferred_when_renaming (bool, optional) – Include preferred when renaming. Defaults to False.

Returns:

Dictionary of added record.

Return type:

JsonObject

delete(item_id: int) None[source]

Delete a release profile by ID.

Parameters:

item_id (int) – Database ID for profile.

Delay Profile

class pyarr._sync.readarr.delay_profile.DelayProfile(handler: RequestHandler)[source]

Delay profile actions for Readarr.

get(item_id: int | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns delay profiles by ID or all profiles.

Parameters:

item_id (int | None, optional) – Database ID for profile. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(tags: list[int], preferred_protocol: str = 'usenet', usenet_delay: int = 0, torrent_delay: int = 0, bypass_if_highest_quality: bool = False, bypass_if_above_custom_format_score: bool = False, minimum_custom_format_score: int = 0) dict[str, Any][source]

Add a delay profile.

Parameters:
  • tags (list[int]) – List of tag IDs.

  • preferred_protocol (str, optional) – Preferred protocol. Defaults to β€œusenet”.

  • usenet_delay (int, optional) – Usenet delay. Defaults to 0.

  • torrent_delay (int, optional) – Torrent delay. Defaults to 0.

  • bypass_if_highest_quality (bool, optional) – Bypass if highest quality. Defaults to False.

  • bypass_if_above_custom_format_score (bool, optional) – Bypass if above score. Defaults to False.

  • minimum_custom_format_score (int, optional) – Minimum score. Defaults to 0.

Returns:

Dictionary of added record.

Return type:

JsonObject

delete(item_id: int) None[source]

Delete a delay profile by ID.

Parameters:

item_id (int) – Database ID for profile.

Manual Import

class pyarr._sync.readarr.manual_import.ManualImport(handler: RequestHandler)[source]

Manual import actions for Readarr.

get(folder: str, download_id: str | None = None, author_id: int | None = None, filter_existing_files: bool = True, replace_existing_files: bool = True) list[dict[str, Any]][source]

Gets a manual import list.

Parameters:
  • folder (str) – Folder name.

  • download_id (str | None, optional) – Download ID. Defaults to None.

  • author_id (int | None, optional) – Author Database ID. Defaults to None.

  • filter_existing_files (bool, optional) – Filter files. Defaults to True.

  • replace_existing_files (bool, optional) – Replace files. Defaults to True.

Returns:

List of dictionaries with items.

Return type:

JsonArray

update(data: dict[str, Any]) dict[str, Any][source]

Update a manual import.

Parameters:

data (JsonObject) – Data containing changes.

Returns:

Dictionary of updated record.

Return type:

JsonObject