bovine.utils

class bovine.utils.JrdData(subject: str | None = None, links: list[bovine.utils.JrdLink] = <factory>)[source]

Dataclass representing a JRD Object

See RFC 7033

build()[source]

Transforms JrdData to dict

Dataclass representing a JRD link

See RFC 7033

build()[source]

Transforms the JrdLink into a dict

bovine.utils.activity_pub_object_id_from_html_body(body: str) str | None[source]

Determines the object identifier from the html body by parsing it and looking for link tags with rel=”alternate” and type application/activity+json

bovine.utils.now_isoformat() str[source]

Returns now in Isoformat, e.g. “2023-05-31T18:11:35Z”, to be used as the value of published

bovine.utils.parse_fediverse_handle(account: str) Tuple[str, str | None][source]

Splits fediverse handle in name and domain Supported forms are:

  • user@domain -> (user, domain)

  • @user@domain -> (user, domain)

  • acct:user@domain -> (user, domain)

bovine.utils.webfinger_response_json(account: str, url: str) dict[source]

helper to generate a webfinger response