Skip to main content

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.

PyPI package version Supported Python versions CI status of Linux/macOS/Windows CodeQL

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

pathvalidate_cli-0.2.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathvalidate_cli-0.2.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for pathvalidate_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9998f4379d29ff65de4808a8a0e6ef75d94a1e6e40659ff984fa50ba0eb90b80
MD5 49d01b3c9e38de603ecd36cb30a883e5
BLAKE2b-256 ee44da50d316972f3529feda970df1edba8b778b38abb4765c4f314db56bfba7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pathvalidate_cli-0.2.1.tar.gz:

Publisher: release.yml on thombashi/pathvalidate-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pathvalidate_cli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pathvalidate_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1d09ec1f71a00a7bcd92662d4f4eec079f8b4d3bd37dd06cbed824b1ceb9b00
MD5 572fe8a926c12afb79dd8313e8c79bc0
BLAKE2b-256 58e431d5fb6d159ac7f68e3f763ba43109c9a1697689d1f0bdba751a6e3ec1ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for pathvalidate_cli-0.2.1-py3-none-any.whl:

Publisher: release.yml on thombashi/pathvalidate-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page