{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/6"}],"enrichment":{"capability":"Removes or replaces problematic characters from filenames while preserving the original name and non-ASCII characters whenever possible, using a blacklist approach.","skillfed_tags":["filename-handling","abandoned-but-stable"],"use_cases":["Sanitize user-uploaded filenames in web applications before storing them to disk.","Clean filenames from external data sources or APIs while retaining non-ASCII characters for international names.","Prepare filenames for cross-platform file operations without forcing ASCII-only names.","Handle reserved filesystem names (like NUL or CON on Windows) in batch file processing.","Validate and clean filenames in data import pipelines where preserving the original name is important."],"what_it_does":"sanitize-filename is a lightweight, dependency-free library that cleans filenames by removing or replacing characters that are problematic for filesystems. It uses a blacklist strategy\u2014filtering out forbidden characters rather than allowing only safe ones\u2014which means it preserves the original filename and non-ASCII characters as much as possible. This makes it useful when you want to keep user-supplied or original filenames intact while still avoiding filesystem errors.\n\nThe package handles common gotchas like reserved names (NUL, CON, etc.), leading/trailing dots, and path separators. However, the documentation explicitly warns that blacklist-based sanitization is inherently less safe than whitelist approaches; the authors recommend creating safe filenames yourself or using a whitelist strategy when security is paramount. This package is best suited for cases where preserving the original filename is a priority and you accept the trade-off in safety.","worth_installing":"Yes, if you need quick filename sanitization and accept the blacklist trade-off. The package is simple, dependency-free, and handles most common cases well. However, the project is abandoned (last release April 2020), so it will not receive security updates or bug fixes. Use it for non-critical applications or where you can audit and maintain the code yourself if needed."},"id":"sanitize-filename","links":{"html":"https://skillfed.io/packages/sanitize-filename","md":"https://skillfed.io/packages/sanitize-filename.md","pypi":"https://pypi.org/project/sanitize-filename/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2020-04-24","license_spdx":null,"license_treatment":"permissive","name":"sanitize-filename","python_support":"supports_current","summary":"A permissive filename sanitizer."},"popularity":{"monthly_downloads":351053,"position":7325,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.2.0"}
