NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #649 most downloaded on PyPI
pathvalidate is a Python library to sanitize/validate a string such as filenames/file-paths/etc.
Last release 1 years ago
15 Jun 2025
Release timing varies
gaps range from 2 weeks to 11 months
Most releases are documented
notes for 38 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
84 releases · first in 2016
Modify to use repr() for value formatting in error messages and validation descriptions
repr() for value formatting in error messages and validation descriptionsFull Changelog: v3.3.0...v3.3.1
repr() for value formatting in error messages and validation descriptionsFull Changelog: https://github.com/thombashi/pathvalidate/compare/v3.3.0...v3.3.1
[Changes][v3.3.1]
<a id="v3.3.0"></a>
Add value to the INVALID_LENGTH validation error
value to the INVALID_LENGTH validation errorinvalids value of INVALID_CHARACTER is uniqueFull Changelog: v3.2.3...v3.3.0
One column per quarter.
value to the INVALID_LENGTH validation errorinvalids value of INVALID_CHARACTER is uniqueFull Changelog: https://github.com/thombashi/pathvalidate/compare/v3.2.3...v3.3.0
[Changes][v3.3.0]
<a id="v3.2.3"></a>
Fix dot-files validation by @thombashi in #60 (Thanks to @slingshotvfx)
Full Changelog: v3.2.2...v3.2.3
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v3.2.2...v3.2.3
[Changes][v3.2.3]
<a id="v3.2.2"></a>
Fix the detection logic of the reservation words for the file name on Windows: #57 (Thanks to @jplarocque )
Full Changelog: v3.2.1...v3.2.2
Test Python 3.12 in CIs by @MatthieuDartiailh in #40
sanitize_filename truncation by @7x11x13 in #48platform argument is windows or universal, filepaths ending with a space or a period should be detected as an errorplatform="windows" or platform="universal" on Python 3.12 and belowFull Changelog: v3.2.0...v3.2.1
Add reserved_name_handler argument to sanitize_filename function and sanitize_filepath function
reserved_name_handler argument to sanitize_filename function and sanitize_filepath functionNullValueHandler class and ReservedNameHandler classfs_encoding property and byte_count property to ValidationError classadditional_reserved_names argument to validate/sanitize functions to allow custom reserved namesValidationError.__str__ methodFull Changelog: v3.1.0...v3.2.0
Fix validation error messages to show the target-platform properly: #34 (Thanks to @matanster)
target-platform properly: #34 (Thanks to @matanster)validate_filename #35 (Thanks to @hXtreme)description property to ErrorReason classas_slog method to ValidationError classdocs extrasValidationError.reason from Optional[ErrorReason] to ErrorReason[build-system]Full Changelog: v3.0.0...v3.1.0
Trim heading spaces in Windows by @eggplants in #28
validate_unprintable_char functionvalidate_after_sanitize keyword argument to sanitize_filename and sanitize_filepath functionsErrorReasonzip_safe=False to setuppathvalidate.Platform type as platform argumentsHandler to NullValueHandlerInvalidLengthError to use ValidationErrorFileNameValidator and FilePathValidator classes from the package rootFileNameSanitizer and FilePathSanitizer classes
min_lenvalidatorFull Changelog: v2.5.2...v3.0.0
Add support for Python 3.11: #22 (Thanks to @hegjon )
Full Changelog: v2.5.1...v2.5.2
Full Changelog: https://github.com/thombashi/pathvalidate/compare/v2.5.1...v2.5.2
[Changes][v2.5.2]
<a id="v2.5.1"></a>
Add DeprecationWarning to deprecated functions
__all__ by @eggplants in #24DeprecationWarning to deprecated functionsFull Changelog: v2.5.0...v2.5.1
__all__ by @eggplants in #24DeprecationWarning to deprecated functionsFull Changelog: https://github.com/thombashi/pathvalidate/compare/v2.5.0...v2.5.1
[Changes][v2.5.1]
<a id="v2.5.0"></a>
Add null_value_handler argument to sanitize_filename/sanitize_filepath functions: #20 (Thanks to @ mkbloke)
null_value_handler argument to sanitize_filename/sanitize_filepath functions: #20 (Thanks to @
mkbloke)AbstractSanitizer/AbstractValidator classes to import pathreplace_ansi_escape functionsetup-ci target to Makefilemin_len/max_len to use default values when assigned minus values[Changes][v2.5.0]
<a id="v2.4.1"></a>
Fix filename validations that include '\' (backslash) on other than Windows: #18 (Thanks to @Traktormaster)
'\' (backslash) on other than Windows: #18 (Thanks to @Traktormaster)[Changes][v2.4.1]
<a id="v2.4.0"></a>
Add exclude_symbols argument to replace_symbol function
exclude_symbols argument to replace_symbol functionsdist package binary (Thanks to @hegjon)[Changes][v2.4.0]
<a id="v2.3.2"></a>
Fix to disallow file name/path that only white spaces for universal platform
universal platform[Changes][v2.3.2]
<a id="v2.3.1"></a>
Modify to accept file name/path that consists only whitespaces: #15 (Thank to @Traktormaster)
[Changes][v2.3.1]
<a id="v2.3.0"></a>
Change not to process for "."/".." by sanitization functions: #13 (Thanks to @ProfElectric)
"."/".." by sanitization functions: #13 (Thanks to @ProfElectric)sanitize_filepath in defaultsanitize_filepath[Changes][v2.3.0]
<a id="v2.2.2"></a>
Improve file path validation for Windows platform: #12 (Thanks to @bschollnick)
__str__ method"."/".."NullNameError to ValidationError of validate_pathtype[Changes][v2.2.2]
<a id="v2.2.1"></a>
Fix to include py.typed to the package
py.typed to the package[Changes][v2.2.1]
<a id="v2.2.0"></a>
Add a reserved keyword for macOS
POSIX as a platformvalidate_filepath_arg/sanitize_filepath_arg to 'auto': #11 (Thanks to @freelanceAndy)[Changes][v2.2.0]
<a id="v2.1.0"></a>
Add check_reserved argument to validate/sanitize functions
check_reserved argument to validate/sanitize functions'/' as a reserved file path for Linux/macOSmax_len value check for file namesdev extras_require[Changes][v2.1.0]
<a id="v2.0.0"></a>
Nothing published for this version
Change to be more strict validation for absolute paths
[Changes][v2.0.0]
<a id="v1.1.0"></a>
Nothing published for this version
Modify validate/sanitize functions for argparse
argparseclickdev extras[Changes][v1.1.0]
<a id="v1.0.0"></a>
Modify to use Python 3 functionality
extras_require[Changes][v1.0.0]
<a id="v0.29.1"></a>
Fix file path length validation: #10 (Thanks to @UncleGoogle)
.asc files of packages to PyPI[Changes][v0.29.1]
<a id="v0.29.0"></a>
Add filename/filepath validators for argparse/click
argparse/click[Changes][v0.29.0]
<a id="v0.28.2"></a>
Fix to properly escape special chars for validation error messages: #9 (Thanks to @UncleGoogle)
[Changes][v0.28.2]
<a id="v0.28.0"></a>
Nothing published for this version
- Drop support for Python 3.4 [Changes][v0.28.0]
[Changes][v0.28.0]
<a id="v0.26.0"></a>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for NTFS reserved names
[Changes][v0.26.0]
<a id="v0.25.0"></a>
Add CLOCK$ as a reserved filename for Windows platform: #8 (Thanks to @sparr)
Improve error message readability
[Changes][v0.24.1]
<a id="v0.24.0"></a>
Add is_valid_filename/is_valid_filepath function
is_valid_filename/is_valid_filepath functionFileNameSanitizer/FilePathSanitizer classes[Changes][v0.24.0]
<a id="v0.23.0"></a>
Nothing published for this version
Improve sanitization/validation for files
. and .. as reserved keywords for filesmax_filename_lenInvalidCharWindowsError into InvalidCharErrorReservedNameError instead of InvalidReservedNameErrorFileSanitizer from platform_name to platformplatform_name to platform[Changes][v0.23.0]
<a id="v0.22.0"></a>
Add universal (platform independent) filename/filepath sanitization/validation
[Changes][v0.22.0]
<a id="v0.21.1"></a>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for PathLike object
[Changes][v0.21.1]
<a id="v0.18.0"></a>
Nothing published for this version
Nothing published for this version
Add validations/sanitizations for unprintable characters
[Changes][v0.18.0]
<a id="v0.15.0"></a>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
pathvalidate functions are expected to passing unicode strings.
[Changes][v0.15.0]
<a id="v0.14.0"></a>
Nothing published for this version
Change max file name/path length to configurable
[Changes][v0.14.0]
<a id="v0.13.0"></a>
Add JavaScript validator/sanitizer
[Changes][v0.13.0]
<a id="v0.11.0"></a>
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →