pathvalidate-cli is a command line interface for pathvalidate library.
Project description
Summary
pathvalidate-cli is a command line interface for pathvalidate library. The tool can sanitize/validate strings such as file-names/file-paths.
Installation
pip install pathvalidate-cli
Usage
Sanitize file paths
$ pathvalidate sanitize 'fi:l*e/p"a?t>h|.t<xt' file/path.txt $ pathvalidate --filename sanitize 'fi:l*e/p"a?t>h|.t<xt' filepath.txt
Validate file paths
$ pathvalidate validate file/path.txt
$
$ pathvalidate validate 'fi:l*e/p"a?t>h|.t<xt'
[PV1100] invalid characters found: invalids=(':', '*', '"', '?', '>', '|', '<'), value='fi:l*e/p"a?t>h|.t<xt', platform=Windows
Command Help
Usage: pathvalidate [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--debug For debug print.
-q, --quiet Suppress execution log messages.
--filename Consider inputs as filenames.
--max-len, --max-bytes BYTES Maximum byte counts of file paths. -1: same
value as the platform limitation. [default:
-1]
--platform PLATFORM Target platform name (case-insensitive). Valid
platform specifiers are Linux/Windows/macOS.
Valid special values are: auto, universal,
POSIX (a) auto: automatically detects the
execution platform. (b) universal: platform
independent. (c) POSIX: POSIX-compliant
platform. [default: universal]
-v, --verbose Verbosity level [default: 0]
-h, --help Show this message and exit.
Commands:
error Print error reasons.
sanitize Sanitize file paths.
validate Validate file paths.
Usage: pathvalidate validate [OPTIONS] [FILEPATHS]...
Validate file paths.
Options:
--min-len, --min-bytes BYTES Minimum byte counts of file paths. [default:
1]
--no-check-reserved TEXT Disable reserved name check.
-h, --help Show this message and exit.
Usage: pathvalidate sanitize [OPTIONS] [FILEPATHS]...
Sanitize file paths.
Options:
--replacement-text TEXT Replacement text for invalid characters. Defaults
to an empty string (remove invalid strings).
[default: ""]
--normalize Normalize the path.
--validate-after-sanitize Execute validation after sanitization.
-h, --help Show this message and exit.
Dependencies
Python 3.9+
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathvalidate_cli-0.2.1.tar.gz.
File metadata
- Download URL: pathvalidate_cli-0.2.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9998f4379d29ff65de4808a8a0e6ef75d94a1e6e40659ff984fa50ba0eb90b80
|
|
| MD5 |
49d01b3c9e38de603ecd36cb30a883e5
|
|
| BLAKE2b-256 |
ee44da50d316972f3529feda970df1edba8b778b38abb4765c4f314db56bfba7
|
Provenance
The following attestation bundles were made for pathvalidate_cli-0.2.1.tar.gz:
Publisher:
release.yml on thombashi/pathvalidate-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathvalidate_cli-0.2.1.tar.gz -
Subject digest:
9998f4379d29ff65de4808a8a0e6ef75d94a1e6e40659ff984fa50ba0eb90b80 - Sigstore transparency entry: 238724934
- Sigstore integration time:
-
Permalink:
thombashi/pathvalidate-cli@01069c2260cc62a966111cc3b8211aa37554fcee -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/thombashi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01069c2260cc62a966111cc3b8211aa37554fcee -
Trigger Event:
push
-
Statement type:
File details
Details for the file pathvalidate_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pathvalidate_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1d09ec1f71a00a7bcd92662d4f4eec079f8b4d3bd37dd06cbed824b1ceb9b00
|
|
| MD5 |
572fe8a926c12afb79dd8313e8c79bc0
|
|
| BLAKE2b-256 |
58e431d5fb6d159ac7f68e3f763ba43109c9a1697689d1f0bdba751a6e3ec1ac
|
Provenance
The following attestation bundles were made for pathvalidate_cli-0.2.1-py3-none-any.whl:
Publisher:
release.yml on thombashi/pathvalidate-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathvalidate_cli-0.2.1-py3-none-any.whl -
Subject digest:
d1d09ec1f71a00a7bcd92662d4f4eec079f8b4d3bd37dd06cbed824b1ceb9b00 - Sigstore transparency entry: 238724936
- Sigstore integration time:
-
Permalink:
thombashi/pathvalidate-cli@01069c2260cc62a966111cc3b8211aa37554fcee -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/thombashi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@01069c2260cc62a966111cc3b8211aa37554fcee -
Trigger Event:
push
-
Statement type: