Frappe Core Utils logo

Frappe Core Utils

Organization
Impertio-Studio
frappe-core-utils

Use when working with utility functions in Frappe v14-v16. Covers frappe.utils.* for date/time, number/money, string, validation, and file path operations. Prevents reinventing stdlib alternatives that break timezone awareness, locale formatting, or multi-tenancy. Keywords: frappe.utils, nowdate, flt, cint, fmt_money, getdate,, date calculation, format number, money format, validate email, how to calculate days between. add_days, date_diff, validate_email, pretty_date, get_files_path.

Overview

PublisherImpertio-Studio
RepositoryFrappe_Claude_Skill_Package
Skill namefrappe-core-utils
Stars
180
Forks
53
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Impertio-Studio on GitHub. Read the source before you install it.

Installation

Install the Frappe Core Utils AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git /tmp/Frappe_Claude_Skill_Package
mkdir -p .claude/skills
cp -r /tmp/Frappe_Claude_Skill_Package/skills/source/core/frappe-core-utils .claude/skills/frappe-core-utils
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Frappe Core Utils in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Frappe Core Utils on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Frappe Core Utils is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Frappe Utility Functions

Quick Reference: Python

NeedFunctionReturns
Current datenowdate() / today()datetime.date
Current datetimenow_datetime()datetime.datetime
Parse date stringgetdate(str)datetime.date
Parse datetime stringget_datetime(str)datetime.datetime
Add daysadd_days(date, n)datetime.date
Add monthsadd_months(date, n)datetime.date
Date differencedate_diff(end, start)int (days)
Format for userformat_date(dt)str (user locale)
Relative timepretty_date(dt)str ("2 hours ago")
Safe floatflt(val, precision)float
Safe intcint(val)int
Safe stringcstr(val)str
Safe boolsbool(val)bool
Safe divisionsafe_div(a, b)float [v15+]
Money formatfmt_money(amt, currency)str
Money in wordsmoney_in_words(amt, cur)str
Strip HTMLstrip_html(text)str
List to prosecomma_and(items)str ("a, b, and c")
Validate emailvalidate_email_address(e)str or ""
Validate URLvalidate_url(url)bool
Parse JSONparse_json(s)Any
Files pathget_files_path(is_private)str
Site pathget_site_path(*parts)str
Unique listunique(seq)list
Hashgenerate_hash(s, length)str

ALL imports: from frappe.utils import nowdate, flt, ... in controllers/whitelisted methods. In Server Scripts: Use frappe.utils.nowdate() directly — NO import statements allowed.


Decision Tree: "Which function do I use?"

Need a date/time value?
├─ Current date → nowdate() or today()
├─ Current datetime → now_datetime()
├─ Parse a string → getdate() or get_datetime()
├─ Add/subtract time → add_days(), add_months(), add_to_date()
├─ Difference → date_diff() (days), month_diff(), time_diff_in_seconds()
├─ Period boundary → get_first_day(), get_last_day(), get_quarter_start()
└─ Display to user → format_date(), format_datetime(), pretty_date()

Need a number?
├─ Convert safely → flt(), cint(), cstr(), sbool()
├─ Round → rounded() (banker's rounding)
├─ Safe divide → safe_div(a, b, default=0) [v15+]
├─ Format money → fmt_money(amount, currency)
└─ Money to words → money_in_words(amount, currency)

Need string processing?
├─ HTML → strip_html(), escape_html(), is_html()
├─ Join list → comma_and(), comma_or(), comma_sep()
├─ Markdown ↔ HTML → to_markdown(), md_to_html()
└─ Mask sensitive → mask_string(input, show_first=4) [v16+]

Need validation?
├─ Email → validate_email_address(email, throw=False)
├─ URL → validate_url(url, valid_schemes=["https"])
├─ Phone → validate_phone_number(phone, throw=False)
├─ JSON → validate_json_string(s)
└─ IBAN → validate_iban(iban) [v16+]

Need file/path?
├─ Public files → get_files_path()
├─ Private files → get_files_path(is_private=True)
├─ Site directory → get_site_path("private", "backups")
├─ Bench root → get_bench_path()
└─ File size → get_file_size(path, format=True)

Critical Anti-Patterns

NEVER use Python stdlib when frappe.utils exists

NEVER (stdlib)ALWAYS (frappe.utils)Why
datetime.datetime.now()now_datetime()Ignores system timezone
datetime.date.today()nowdate()Ignores system timezone
float(val)flt(val, precision)Crashes on None/empty
int(val)cint(val)Crashes on None/empty
round(val, 2)rounded(val, 2)Inconsistent rounding
val1 / val2safe_div(val1, val2)ZeroDivisionError [v15+]
json.loads(s)parse_json(s)Crashes on None/empty
json.dumps(obj)frappe.as_json(obj)Inconsistent serialization
"{:,.2f}".format(a)fmt_money(a, currency)Ignores locale/currency
os.path.join(...)get_site_path(...)Breaks multi-tenancy
", ".join(items)comma_and(items)No localized "and"
dt.strftime(fmt)format_date(dt)Ignores user preference
re.sub(r'<.*?>', '', h)strip_html(h)Misses edge cases

Server Script Sandbox

python
# ❌ NEVER in Server Scripts
from frappe.utils import nowdate, flt
import json

# ✅ ALWAYS in Server Scripts (no imports allowed)
today = frappe.utils.nowdate()
amount = frappe.utils.flt(doc.amount, 2)
data = frappe.parse_json(doc.json_field)

JavaScript Quick Reference

NeedFunction
Escape HTMLfrappe.utils.escape_html(txt)
HTML to textfrappe.utils.html2text(html)
Check if HTMLfrappe.utils.is_html(txt)
Parse JSONfrappe.utils.parse_json(str)
Validate URLfrappe.utils.is_url(txt)
Title casefrappe.utils.to_title_case(str)
Join with "and"frappe.utils.comma_and(list)
Unique arrayfrappe.utils.unique(list)
Copy clipboardfrappe.utils.copy_to_clipboard(txt)
Scroll to elementfrappe.utils.scroll_to(el)
Is mobilefrappe.utils.is_mobile()
Throttlefrappe.utils.throttle(fn, delay)
Debouncefrappe.utils.debounce(fn, delay)
Format valuefrappe.format(value, df, options, doc)
Duration displayfrappe.utils.get_formatted_duration(secs)

Version Differences

Functionv14v15v16
safe_div()--AddedYes
duration_to_seconds()--AddedYes
guess_date_format()--AddedYes
validate_duration_format()--AddedYes
mask_string()----Added
validate_iban()----Added
validate_name()----Added
safe_json_loads()----Added
groupby_metric()----Added
Core functionsYesYesYes

Reference Files

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Frappe Core Utils AI skill do?

Use when working with utility functions in Frappe v14-v16. Covers frappe.utils.* for date/time, number/money, string, validation, and file path operations. Prevents reinventing stdlib alternatives that break timezone awareness, locale formatting, or multi-tenancy. Keywords: frappe.utils, nowdate, flt, cint, fmt_money, getdate,, date calculation, format number, money format, validate email, how to calculate days between. add_days, date_diff, validate_email, pretty_date, get_files_path.

Why use Frappe Core Utils on TypingMind?

Because you install it once and use it with any model. Frappe Core Utils is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Frappe Core Utils in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/core/frappe-core-utils. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Frappe Core Utils?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Frappe Core Utils?

As many as you like. As long as a model supports skills, you can use Frappe Core Utils with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Frappe Core Utils AI skill free?

Yes. It is published on GitHub by Impertio-Studio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇