.. contents:: **pathvalidate-cli**
:backlinks: top
:depth: 2
Summary
============================================
``pathvalidate-cli`` is a command line interface for `pathvalidate <https://github.com/thombashi/pathvalidate>`__ library.
The tool can sanitize/validate strings such as file-names/file-paths.
|PyPI pkg ver| |Supported Python ver| |CI status| |CodeQL|
.. |PyPI pkg ver| image:: https://badge.fury.io/py/pathvalidate-cli.svg
:target: https://badge.fury.io/py/pathvalidate-cli
:alt: PyPI package version
.. |Supported Python ver| image:: https://img.shields.io/pypi/pyversions/pathvalidate-cli.svg
:target: https://pypi.org/project/pathvalidate-cli
:alt: Supported Python versions
.. |CI status| image:: https://github.com/thombashi/pathvalidate-cli/actions/workflows/ci.yml/badge.svg
:target: https://github.com/thombashi/pathvalidate-cli/actions/workflows/ci.yml
:alt: CI status of Linux/macOS/Windows
.. |CodeQL| image:: https://github.com/thombashi/pathvalidate-cli/actions/workflows/github-code-scanning/codeql/badge.svg
:target: https://github.com/thombashi/pathvalidate-cli/actions/workflows/github-code-scanning/codeql
:alt: 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]
--security-check Enable security checks.
-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.
Dependencies
============================================
Python 3.9+
Related Project
============================================
- `pathvalidate <https://github.com/thombashi/pathvalidate>`__
Raw data
{
"_id": null,
"home_page": "https://github.com/thombashi/pathvalidate-cli",
"name": "pathvalidate-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "file, path, validate, sanitize",
"author": "Tsuyoshi Hombashi",
"author_email": "tsuyoshi.hombashi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/13/e7/191c752d5b2a72f0864355d205590d530d249a9671bf06de2a29bbcddf78/pathvalidate_cli-0.1.1.tar.gz",
"platform": null,
"description": ".. contents:: **pathvalidate-cli**\n :backlinks: top\n :depth: 2\n\n\nSummary\n============================================\n\n``pathvalidate-cli`` is a command line interface for `pathvalidate <https://github.com/thombashi/pathvalidate>`__ library.\nThe tool can sanitize/validate strings such as file-names/file-paths.\n\n|PyPI pkg ver| |Supported Python ver| |CI status| |CodeQL|\n\n.. |PyPI pkg ver| image:: https://badge.fury.io/py/pathvalidate-cli.svg\n :target: https://badge.fury.io/py/pathvalidate-cli\n :alt: PyPI package version\n\n.. |Supported Python ver| image:: https://img.shields.io/pypi/pyversions/pathvalidate-cli.svg\n :target: https://pypi.org/project/pathvalidate-cli\n :alt: Supported Python versions\n\n.. |CI status| image:: https://github.com/thombashi/pathvalidate-cli/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/thombashi/pathvalidate-cli/actions/workflows/ci.yml\n :alt: CI status of Linux/macOS/Windows\n\n.. |CodeQL| image:: https://github.com/thombashi/pathvalidate-cli/actions/workflows/github-code-scanning/codeql/badge.svg\n :target: https://github.com/thombashi/pathvalidate-cli/actions/workflows/github-code-scanning/codeql\n :alt: CodeQL\n\n\nInstallation\n============================================\n::\n\n pip install pathvalidate-cli\n\n\nUsage\n============================================\n\nSanitize file paths\n--------------------------------------------\n\n::\n\n $ pathvalidate sanitize 'fi:l*e/p\"a?t>h|.t<xt'\n file/path.txt\n $ pathvalidate --filename sanitize 'fi:l*e/p\"a?t>h|.t<xt'\n filepath.txt\n\nValidate file paths\n--------------------------------------------\n\n::\n\n $ pathvalidate validate file/path.txt\n $ \n $ pathvalidate validate 'fi:l*e/p\"a?t>h|.t<xt'\n [PV1100] invalid characters found: invalids=(':', '*', '\"', '?', '>', '|', '<'), value='fi:l*e/p\"a?t>h|.t<xt', platform=Windows\n\nCommand Help\n--------------------------------------------\n\n::\n\n Usage: pathvalidate [OPTIONS] COMMAND [ARGS]...\n\n Options:\n --version Show the version and exit.\n --debug For debug print.\n -q, --quiet Suppress execution log messages.\n --filename Consider inputs as filenames.\n --max-len, --max-bytes BYTES Maximum byte counts of file paths. -1: same\n value as the platform limitation. [default:\n -1]\n --platform PLATFORM Target platform name (case-insensitive). Valid\n platform specifiers are Linux/Windows/macOS.\n Valid special values are: auto, universal,\n POSIX (a) auto: automatically detects the\n execution platform. (b) universal: platform\n independent. (c) POSIX: POSIX-compliant\n platform. [default: universal]\n --security-check Enable security checks.\n -v, --verbose Verbosity level [default: 0]\n -h, --help Show this message and exit.\n\n Commands:\n error Print error reasons.\n sanitize Sanitize file paths.\n validate Validate file paths.\n\n\nDependencies\n============================================\nPython 3.9+\n\n\nRelated Project\n============================================\n\n- `pathvalidate <https://github.com/thombashi/pathvalidate>`__\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "pathvalidate-cli is a command line interface for pathvalidate library.",
"version": "0.1.1",
"project_urls": {
"Changelog": "https://github.com/thombashi/pathvalidate-cli/releases",
"Homepage": "https://github.com/thombashi/pathvalidate-cli",
"Source": "https://github.com/thombashi/pathvalidate-cli",
"Tracker": "https://github.com/thombashi/pathvalidate-cli/issues"
},
"split_keywords": [
"file",
" path",
" validate",
" sanitize"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "28e0bde160956a0304da35e0ec5019324afa103c4c147aed7b1b17e69bddefe9",
"md5": "839004e155c0c20411c167f653be5b56",
"sha256": "368d90aa70c0c19836559131534274b4b9c993371ec4a53eee01ed486fc7b9d9"
},
"downloads": -1,
"filename": "pathvalidate_cli-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "839004e155c0c20411c167f653be5b56",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7804,
"upload_time": "2025-01-03T15:45:15",
"upload_time_iso_8601": "2025-01-03T15:45:15.498528Z",
"url": "https://files.pythonhosted.org/packages/28/e0/bde160956a0304da35e0ec5019324afa103c4c147aed7b1b17e69bddefe9/pathvalidate_cli-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13e7191c752d5b2a72f0864355d205590d530d249a9671bf06de2a29bbcddf78",
"md5": "7ebc0874c152bb3b464eb8e9968fef2a",
"sha256": "e880bc84abd87055c55785d0809a8bff3c8fc7df81fb7eff359057154258e079"
},
"downloads": -1,
"filename": "pathvalidate_cli-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "7ebc0874c152bb3b464eb8e9968fef2a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 11910,
"upload_time": "2025-01-03T15:45:16",
"upload_time_iso_8601": "2025-01-03T15:45:16.888836Z",
"url": "https://files.pythonhosted.org/packages/13/e7/191c752d5b2a72f0864355d205590d530d249a9671bf06de2a29bbcddf78/pathvalidate_cli-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-03 15:45:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thombashi",
"github_project": "pathvalidate-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pathvalidate-cli"
}