Skip to main contentModule format
Source - ExpirationStatus
- Classification of a date-based expiration relative to today.
- EXPIRING_SOON_DAYS
- Number of days before expiration to flag as “expiring soon”.
- check_expiration
- Parse a YYYY-MM-DD date string and classify it as expired / expiring soon / active.
- cmp_ignore_case
- Case-insensitive string comparison for sorting (no allocation).
- contains_ignore_case
- Case-insensitive substring check without allocation.
Assumes
needle is already lowercase. - format_date
- Format a date string to a more readable format
- format_optional
- Format an optional string, returning a default if None
- format_phone
- Format a phone number for display
Handles various input formats and normalizes to (XXX) XXX-XXXX
- strip_html
- Strip HTML tags from a string.
Useful for cleaning up requirement text from the API.
- strip_url_scheme
- Strip the URL scheme (http:// or https://) from a URL for display.
- truncate
- Truncate a string to a maximum length, adding ellipsis if needed.
Handles tabs by replacing with spaces and trims whitespace.
- wrap_text
- Word-wrap text into lines of at most
width characters, breaking at word boundaries.