frappe-core-utils

Guide correct use of frappe.utils for dates, numbers, strings, validation, and file paths in Frappe v14-v16.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-core-utils-impertio-studio
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frappe-core-utils
Source: https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/core/frappe-core-utils
Command: npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-core-utils-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents production-breaking bugs by ensuring you use Frappe’s utility functions instead of Python stdlib equivalents for date/time, numbers, strings, validation, and file-path operations.

Core Features & Use Cases

  • Correct timezone- and locale-aware utilities for date/time parsing, formatting, and relative dates in Frappe v14–v16.
  • Safe conversions and money formatting using flt, cint, rounded, safe_div, fmt_money, and money_in_words to avoid None/empty crashes and rounding/division issues.
  • Validated strings and safe paths for email/URL/JSON checks and multi-tenant-safe filesystem and site path resolution.

Quick Start

Ask: “In a Frappe Server Script, how do I compute a date difference in days, safely calculate a percentage without divide-by-zero, and format a currency amount using frappe.utils without any imports?”

Frequently Asked Questions about frappe-core-utils

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely calculate percentages and format currency in Frappe Server Scripts without importing Python stdlib?▼

To safely calculate percentages and format currency in Frappe Server Scripts, use built-in frappe.utils functions like safe_div, flt, and fmt_money instead of Python stdlib to prevent divide-by-zero and None crashes.

Why does date calculation in Frappe produce incorrect timezone offsets across different sites?▼

Date calculation in Frappe produces incorrect timezone offsets when using Python stdlib datetime instead of frappe.utils, which natively respects site-specific timezones and locales across multi-tenant deployments.

How do I validate email strings and resolve safe file paths in Frappe v14?▼

To validate email strings and resolve safe file paths in Frappe v14, use frappe.utils validation functions and site path resolution utilities to ensure multi-tenant-safe filesystem operations.

Can I use standard Python math and string functions for data processing in Frappe whitelisted methods?▼

You should not use standard Python math and string functions in Frappe whitelisted methods because frappe.utils provides safe conversion functions like cint and rounded that handle empty values and locale-specific formatting.

What is the best way to avoid production failures when handling date parsing in Frappe v16?▼

The best way to avoid production failures when handling date parsing in Frappe v16 is using frappe.utils for locale-aware parsing and relative date formatting instead of Python stdlib equivalents.

When should I not use Python's built-in os.path for filesystem operations in Frappe?▼

You should not use Python's built-in os.path for filesystem operations in Frappe when running multi-tenant sites, as frappe.utils provides multi-tenant-safe filesystem and site path resolution.