anki.exporting
==============

.. py:module:: anki.exporting


Classes
-------

.. autoapisummary::

   anki.exporting.Exporter
   anki.exporting.TextCardExporter
   anki.exporting.TextNoteExporter
   anki.exporting.AnkiExporter
   anki.exporting.AnkiPackageExporter
   anki.exporting.AnkiCollectionPackageExporter
   anki.exporting.AnkiCollectionPackage21bExporter


Functions
---------

.. autoapisummary::

   anki.exporting.exporters


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

.. py:class:: Exporter(col: anki.collection.Collection, did: anki.decks.DeckId | None = None, cids: list[anki.cards.CardId] | None = None)

   .. py:attribute:: includeHTML
      :type:  bool | None
      :value: None



   .. py:attribute:: ext
      :type:  str | None
      :value: None



   .. py:attribute:: includeTags
      :type:  bool | None
      :value: None



   .. py:attribute:: includeSched
      :type:  bool | None
      :value: None



   .. py:attribute:: includeMedia
      :type:  bool | None
      :value: None



   .. py:attribute:: col


   .. py:attribute:: did
      :value: None



   .. py:attribute:: cids
      :value: None



   .. py:method:: key(col: anki.collection.Collection) -> str
      :staticmethod:



   .. py:method:: doExport(path) -> None


   .. py:method:: exportInto(path: str) -> None


   .. py:method:: processText(text: str) -> str


   .. py:method:: escapeText(text: str) -> str

      Escape newlines, tabs, CSS and quotechar.



   .. py:method:: stripHTML(text: str) -> str


   .. py:method:: cardIds() -> Any


.. py:class:: TextCardExporter(col)

   Bases: :py:obj:`Exporter`


   .. py:attribute:: ext
      :value: '.txt'



   .. py:attribute:: includeHTML
      :value: True



   .. py:method:: key(col: anki.collection.Collection) -> str
      :staticmethod:



   .. py:method:: doExport(file) -> None


.. py:class:: TextNoteExporter(col: anki.collection.Collection)

   Bases: :py:obj:`Exporter`


   .. py:attribute:: ext
      :value: '.txt'



   .. py:attribute:: includeTags
      :value: True



   .. py:attribute:: includeHTML
      :value: True



   .. py:attribute:: includeID
      :value: False



   .. py:method:: key(col: anki.collection.Collection) -> str
      :staticmethod:



   .. py:method:: doExport(file: io.BufferedWriter) -> None


.. py:class:: AnkiExporter(col: anki.collection.Collection)

   Bases: :py:obj:`Exporter`


   .. py:attribute:: ext
      :value: '.anki2'



   .. py:attribute:: includeSched
      :type:  bool | None
      :value: False



   .. py:attribute:: includeMedia
      :value: True



   .. py:method:: key(col: anki.collection.Collection) -> str
      :staticmethod:



   .. py:method:: deckIds() -> list[anki.decks.DeckId]


   .. py:method:: exportInto(path: str) -> None


   .. py:method:: postExport() -> None


   .. py:method:: removeSystemTags(tags: str) -> str


.. py:class:: AnkiPackageExporter(col: anki.collection.Collection)

   Bases: :py:obj:`AnkiExporter`


   .. py:attribute:: ext
      :value: '.apkg'



   .. py:method:: key(col: anki.collection.Collection) -> str
      :staticmethod:



   .. py:method:: exportInto(path: str) -> None


   .. py:method:: doExport(z: zipfile.ZipFile, path: str) -> dict[str, str]


   .. py:method:: prepareMedia() -> None


.. py:class:: AnkiCollectionPackageExporter(col)

   Bases: :py:obj:`AnkiPackageExporter`


   .. py:attribute:: ext
      :value: '.colpkg'



   .. py:attribute:: verbatim
      :value: True



   .. py:attribute:: includeSched
      :value: None



   .. py:attribute:: LEGACY
      :value: True



   .. py:method:: key(col: anki.collection.Collection) -> str
      :staticmethod:



   .. py:method:: exportInto(path: str) -> None

      Export collection. Caller must re-open afterwards.



.. py:class:: AnkiCollectionPackage21bExporter(col)

   Bases: :py:obj:`AnkiCollectionPackageExporter`


   .. py:attribute:: LEGACY
      :value: False



   .. py:method:: key(_col: anki.collection.Collection) -> str
      :staticmethod:



.. py:function:: exporters(col: anki.collection.Collection) -> list[tuple[str, Any]]

