webmentions.storage package

Subpackages

Module contents

class webmentions.storage.WebmentionsStorage[source]

Bases: ABC

Base class for Webmention storage backends.

abstract delete_webmention(source: str, target: str, direction: WebmentionDirection) Any | None[source]

Mark a Webmention as deleted.

Parameters:
  • source – The source URL of the Webmention

  • target – The target URL of the Webmention

  • direction – The direction of the Webmention (inbound or outbound)

mark_sent(source: str, target: str) None[source]

Mark a Webmention as sent.

Parameters:
  • source – The source URL of the Webmention

  • target – The target URL of the Webmention

abstract retrieve_webmentions(resource: str, direction: WebmentionDirection) list[Webmention][source]

Retrieve the stored Webmentions for a given URL.

Parameters:
  • resource – The URL of the resource associated to the Webmentions

  • direction – The direction of the Webmentions (inbound or outbound)

Returns:

A list of Webmentions

abstract store_webmention(mention: Webmention) Any[source]

Store a Webmention.

Parameters:

mention – The Webmention to store