Python Filename Sanitization with Fallback

Community

Turn any title into a safe, valid filename.

Authorngpestelos
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill tackles the challenge of generating safe, filesystem-compatible filenames from user-provided titles, especially when titles contain emoji, punctuation, or whitespace. It adds a metadata-driven fallback to guarantee filenames always include alphanumeric content and remain descriptive for indexing.

Core Features & Use Cases

  • Sanitizes titles to remove invalid characters while preserving meaning where possible.
  • Validates output to ensure the resulting filename contains alphanumeric characters.
  • Metadata-driven fallback leverages author, date, and category to craft descriptive, unique names when sanitization would produce invalid results.
  • Deterministic & backward-compatible: same input and metadata produce the same output; existing valid filenames are unchanged.

Quick Start

Use the sanitize_filename function to convert a document title into a safe filename, providing optional metadata for fallback. Command example: sanitize_filename("…", {"author": "User", "saved_at": "2025-12-08", "category": "tweet"})

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: Python Filename Sanitization with Fallback
Download link: https://github.com/ngpestelos/readwise-mcp-server/archive/main.zip#python-filename-sanitization-with-fallback

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.