Internals Reference¶
This page contains reference to this package’s internals.
Classes¶
- [source]final class ntfy_api.__version__._version_info(major: int, minor: int, micro: int, pre: int, post: int, dev: int)¶
Bases:
tuple
[int
,int
,int
,int
,int
,int
]A version tuple implementation in many ways similar to
sys.version_info
. Acts as a singleton.Composed of
major()
,minor()
,micro()
,pre()
,post()
, anddev()
versions (in that order).
- [source]class ntfy_api.filter._Filter¶
A slightly modified version of
_Message
that is used to handle formatting.
- [source]class ntfy_api.message._ReceivedAttachment(name: str, url: str, type: str | None = None, size: int | None = None, expires: int | None = None)¶
Bases:
ReceivedAttachment
,WrappingDataclass
Private implementation of the
ReceivedAttachment
protocol.
- [source]class ntfy_api.message._ReceivedMessage(id: str, time: int, event: Event, topic: str, message: str | None = None, expires: int | None = None, title: str | None = None, tags: tuple[Tag, ...] | None = None, priority: Priority | None = None, click: str | None = None, actions: tuple[ReceivedViewAction | ReceivedBroadcastAction | ReceivedHTTPAction, ...] | None = None, attachment: ReceivedAttachment | None = None, icon: str | None = None, content_type: str | None = None)¶
Bases:
ReceivedMessage
,WrappingDataclass
Private implementation of the
ReceivedMessage
protocol.- Parameters:
tags¶ (tuple[Tag, ...] | None) – List of tags that may map to emojis.
click¶ (str | None) – Website opened when notification is clicked.
actions¶ (tuple[ReceivedAction, ...] | None) – Action buttons that can be displayed.
attachment¶ (ReceivedAttachment | None) – Details about an attachment if present.
- ivar actions: tuple[ReceivedViewAction | ReceivedBroadcastAction | ReceivedHTTPAction, ...] | None¶
See the
actions
parameter.
- ivar attachment: ReceivedAttachment | None¶
See the
attachment
parameter.
- ivar content_type: str | None¶
See the
content_type
parameter.
- [source]class ntfy_api._internals.URL(scheme: str, netloc: str, path: str, params: str, query: str, fragment: str)¶
Internal URL handling for ntfy API endpoints.
- Parameters:
scheme¶ (str) – The URL scheme (e.g.,
scheme
inscheme://netloc/path;parameters?query#fragment
).netloc¶ (str) – The URL netloc (e.g.,
netloc
inscheme://netloc/path;parameters?query#fragment
).path¶ (str) – The URL path (e.g.,
path
inscheme://netloc/path;parameters?query#fragment
).params¶ (str) – The URL params (e.g.,
params
inscheme://netloc/path;parameters?query#fragment
).query¶ (str) – The URL query (e.g.,
query
inscheme://netloc/path;parameters?query#fragment
).fragment¶ (str) – The URL fragment (e.g.,
fragment
inscheme://netloc/path;parameters?query#fragment
).
- [source]method unparse(endpoint: str | Iterable[str] | None = None, scheme: tuple[str, str] | None = None) str ¶
Reconstruct the full URL string.
- Parameters:
endpoint¶ (str | Iterable[str] | None, optional) – An endpoint to be appended to the path before parsing.
scheme¶ (tuple[str, str] | None, optional) – A scheme two-tuple (insecure, secure) to be used instead of the existing scheme. Which version is used (insecure vs secure) will be decided based on the current scheme’s security status.
- Returns:
The constructed URL.
- Return type:
- [source]class ntfy_api._internals.WrappingDataclass¶
A special dataclass type that allows for its attributes to be annotated with wrapper types.
- [source]classmethod from_json(data: Mapping[str, Any]) Self ¶
Parse a new
WrappingDataclass
instance from the given data.Note
data
is not modified when wrappers (if any) are applied. Instead, a shallow copy of the mapping is created and used. Keep in mind that, because it is a shallow copy, the wrappers may still modify the mapping values in-place.- Parameters:
- Returns:
The parsed
WrappingDataclass
instance.- Return type:
Type Variables¶
- typevar ntfy_api._internals._T = TypeVar('_T')¶