sponsorkit.nag
The nag helper: decide when to show a gentle "please support" message.
On this page
import sponsorkit.nagThe nag helper: decide when to show a gentle "please support" message.
Exports#
| Name | Kind | Summary |
|---|---|---|
Nag | class | A named nag created by Sponsorkit.nag(). |
parse_duration() | function | Parse an ISO-8601 duration (P7D, PT12H, P1W…); a timedelta passes through. |
Functions#
parse_duration()#
def parse_duration(value: str | timedelta | float | int) -> timedeltaParse an ISO-8601 duration (P7D, PT12H, P1W…); a timedelta passes through.
Numbers are seconds. Years count as 365 days and months as 30 days. Raises SponsorkitError("invalid_config") for anything else.
Also exported as sponsorkit.parse_duration.