core.database
=============

.. py:module:: core.database

.. autoapi-nested-parse::

   Database module for the auto-archiver that defines the interface for implementing database modules
   in the media archiving framework.





Module Contents
---------------

.. py:class:: Database

   Bases: :py:obj:`auto_archiver.core.BaseModule`


   Base class for implementing database modules in the media archiving framework.

   Subclasses must implement the `fetch` and `done` methods to define platform-specific behavior.


   .. py:method:: started(item: auto_archiver.core.Metadata) -> None

      signals the DB that the given item archival has started



   .. py:method:: failed(item: auto_archiver.core.Metadata, reason: str) -> None

      update DB accordingly for failure



   .. py:method:: aborted(item: auto_archiver.core.Metadata) -> None

      abort notification if user cancelled after start



   .. py:method:: fetch(item: auto_archiver.core.Metadata) -> Union[auto_archiver.core.Metadata, bool]

      check and fetch if the given item has been archived already, each database should handle its own caching, and configuration mechanisms



   .. py:method:: done(item: auto_archiver.core.Metadata, cached: bool = False) -> None
      :abstractmethod:


      archival result ready - should be saved to DB



