Aller au contenu

Assets & Branding

Ce contenu n’est pas encore disponible dans votre langue.

AppriseAsset defines the global execution context for an Apprise session.

It is not limited to branding or theming. An asset instance influences behaviour across:

  • All notification plugins
  • All delivery threads
  • Persistent storage and key material
  • Global safety boundaries (log redaction and recursion protection)

Under usual conditions, an asset is created once and then passed into Apprise(...) during it’s instantiation.

from apprise import Apprise, AppriseAsset
asset = AppriseAsset(app_id="My Application", theme="default")
apobj = Apprise(asset=asset)

If no asset is provided, Apprise creates a default one.

  • Created once, typically at application startup
  • Shared across all loaded plugins and configuration processing
  • Intended to be treated as immutable for the lifetime of an Apprise instance

Mutating an asset after it has been bound to Apprise can produce inconsistent results across plugins.

AppriseAsset.__init__() accepts a small number of explicit arguments, plus **kwargs.

  • The explicit arguments (plugin_paths, storage_*, timezone) are validated and normalised.
  • **kwargs can override any existing asset attribute, and will raise if an invalid key is provided.

This is intentional. It prevents configuration files from quietly setting unknown fields and it keeps the surface area strict.


This table documents the actual defaults from the implementation, plus where each field is used. Fields prefixed with _ or __ are intentionally not configuration-file addressable.

FieldTypeDefaultUsed byNotes
app_idstrApprisePlugin headers, key generation namesUsed as a human-facing application identifier and as a default name in PGP key generation.
app_descstrApprise NotificationsMetadata / PresentationUsed by tooling and services that display an application description.
app_urlstrhttps://github.com/caronc/appriseMetadata / PresentationProvider URL exposed in docs and some plugin metadata.
themestrdefaultIcon URL/path resolutionDrives {THEME} substitution for icon lookup.
default_extensionstr.pngIcon URL/path resolutionUsed when extension is not provided to image_url() or image_path().
default_image_sizeNotifyImageSizeXY_256Icon URL resolutionUsed when size is omitted.
image_url_maskstrGitHub raw URLimage_url()Produces a themed image URL for NotifyType + size.
image_url_logostrGitHub raw URLimage_url(logo=True)Used for the application logo.
image_path_maskstrlocal assets/themes/...image_path() / image_raw()Used for local icon resolution and raw bytes loading.
FieldTypeDefaultUsed byNotes
html_notify_mapdict[NotifyType,str]type→hex mapcolor()Default colour mapping for HTML-capable services.
default_html_colorstr#888888color()Used when a mapping is missing.
ascii_notify_mapdict[NotifyType,str]type→token mapascii()Default ASCII tokens for text-only contexts.
default_ascii_charsstr[?]ascii()Used when a mapping is missing.
FieldTypeDefaultUsed byNotes
body_formatNotifyFormatNoneNoneFormatting pipeline If None, no pre-formatting is applied by default.
interpret_emojisboolNoneNoneMessage pre-processing. If None, it defers to per-service configuration (for example, emojis=yes at the URL level).
interpret_escapesboolFalseMessage pre-processingEnables \n, \t, etc. prior to sending.
encodingstrutf-8Encoding and saltUsed when encoding storage_salt provided as a string.
FieldTypeDefaultUsed byNotes
async_modeboolTrueDelivery orchestrationControls concurrent vs sequential dispatch.
FieldTypeDefaultUsed byNotes
plugin_pathslist[str][]Custom plugin loadingTriggers module detection at asset initialisation time.
FieldTypeDefaultUsed byNotes
storage_path`strNone`NonePersistentStore root. If unset, Apprise operates memory-only for storage-backed features.
storage_modePersistentStoreModeautoPersistentStore behaviourauto, flush, memory.
storage_idlenint8Namespace generationControls how long generated namespace directories are.
storage_saltbytesb""Namespace generationProvides optional salting for namespace generation, string values are encoded using encoding.
FieldTypeDefaultUsed byNotes
pgp_autogenboolTruePGP controllerEnables auto-generation of PGP keys when storage allows it and no key is provided.
pem_autogenboolTruePEM controllerEnables auto-generation of PEM keys when storage allows it and no key is provided.
FieldTypeDefaultUsed byNotes
secure_loggingboolTrueLogging pipelineAdds overhead to redact secrets from logs, recommended to keep enabled.
_recursionint0Apprise API recursion guardPrevents loops when one Apprise API instance calls another.
_uidstrrandom UUID4Correlation / identityInternal identifier, intended for internal correlation.
_tzinfotzinfosystem tzTime-based behaviourThe resolved timezone object used by plugins that need localised timestamps.

Configures the Apprise instance to use an altered branding.

from apprise import AppriseAsset
asset = AppriseAsset(
app_id="StatsBot",
app_desc="Metrics Aggregation Service",
app_url="https://example.com",
)

Apprise resolves icons using configurable masks.

asset = AppriseAsset(
image_path_mask="/icons/{THEME}/{TYPE}-{XY}{EXTENSION}",
image_url_mask="https://cdn.example.com/{TYPE}-{XY}{EXTENSION}",
)
TokenDescription
{THEME}Active theme
{TYPE}info, success, warning, failure
{XY}Image size
{EXTENSION}File extension

When enabled, secrets are redacted from all logging output.

asset = AppriseAsset(secure_logging=True)

Disabling this is strongly discouraged outside isolated environments.

The asset internally tracks recursion depth to prevent notification loops, particularly when Apprise instances interact with one another.

The following fields cannot be set via configuration files:

  • plugin_paths
  • storage_*
  • Internal flags prefixed with _

These must be provided programmatically to prevent untrusted code execution.