betty.link - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# Source code for betty.link

    """
    An API for linking to web resources.
    """

    from abc import ABC, abstractmethod

    from betty.locale.localizable import Localizable

    class Link(ABC):
        """
        A link to a web resource.
        """

        @property
        @abstractmethod
        def url(self) -> str:
            """
            The absolute URL the link points to.
            """
            pass

        @property
        @abstractmethod
        def label(self) -> Localizable:
            """
            The human-readable short link label.
            """
            pass