pax_global_header 0000666 0000000 0000000 00000000064 14735767125 0014533 g ustar 00root root 0000000 0000000 52 comment=3310f98a5572ad78efaefaac2f95d63bb9bd6fca
pathvalidate-3.2.3/ 0000775 0000000 0000000 00000000000 14735767125 0014206 5 ustar 00root root 0000000 0000000 pathvalidate-3.2.3/.github/ 0000775 0000000 0000000 00000000000 14735767125 0015546 5 ustar 00root root 0000000 0000000 pathvalidate-3.2.3/.github/FUNDING.yml 0000664 0000000 0000000 00000001142 14735767125 0017361 0 ustar 00root root 0000000 0000000 # These are supported funding model platforms
github: thombashi
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: thombashi
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
pathvalidate-3.2.3/.github/dependabot.yml 0000664 0000000 0000000 00000000250 14735767125 0020373 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions-dependencies:
patterns: ["*"]
pathvalidate-3.2.3/.github/workflows/ 0000775 0000000 0000000 00000000000 14735767125 0017603 5 ustar 00root root 0000000 0000000 pathvalidate-3.2.3/.github/workflows/ci.yml 0000664 0000000 0000000 00000011125 14735767125 0020721 0 ustar 00root root 0000000 0000000 name: CI
on:
push:
branches:
- master
paths-ignore:
- ".gitignore"
- "README.rst"
pull_request:
paths-ignore:
- ".gitignore"
- "README.rst"
permissions:
contents: read
jobs:
build-package:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-build-pkg
cancel-in-progress: true
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- run: make build
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
build-docs:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-build-docs
cancel-in-progress: true
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- run: make docs
lint:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-lint
cancel-in-progress: true
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- run: make check
unit-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: windows-latest
python-version: "3.11"
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-unit-test-${{ matrix.os }}-${{ matrix.python-version }}
cancel-in-progress: true
timeout-minutes: 20
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
if: ${{ matrix.os == 'ubuntu-latest' }}
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- name: Run tests
env:
PYTEST_DISCORD_WEBHOOK: ${{ secrets.PYTEST_DISCORD_WEBHOOK }}
REPORT_OUTPUT: md_report.md
run: |
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
tox -e cov -- --md-report-output "${REPORT_OUTPUT}"
- run: ls -alR
if : ${{ matrix.os != 'windows-latest' }}
- name: Output reports to the job summary when tests fail
if: failure()
shell: bash
run: |
if [ -f "$REPORT_FILE" ]; then
echo "Failed Test Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
else
echo "No failed tests to report"
fi
- name: Install coveralls
run: python -m pip install --upgrade --disable-pip-version-check coveralls tomli
- name: Upload coverage data to coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: coveralls
coveralls:
name: Indicate completion to coveralls.io
needs: unit-test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- run: pip3 install --upgrade coveralls
- name: Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --finish
pathvalidate-3.2.3/.github/workflows/on_push_default_branch.yml 0000664 0000000 0000000 00000004410 14735767125 0025021 0 ustar 00root root 0000000 0000000 name: Publish to TestPyPI and Sign with Sigstore
on:
push:
branches:
- master
paths-ignore:
- ".gitignore"
- "README.rst"
permissions:
contents: read
jobs:
build-wheel-package:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-build
cancel-in-progress: true
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- run: make build
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
publish-package:
needs: build-wheel-package
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-publish-pkg
cancel-in-progress: true
timeout-minutes: 10
environment:
name: testpypi
url: https://test.pypi.org/p/pathvalidate
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
sign-package:
needs: publish-package
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-sign-pkg
cancel-in-progress: true
timeout-minutes: 10
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- uses: actions/upload-artifact@v4
with:
name: sigstore
path: ./dist/*
pathvalidate-3.2.3/.github/workflows/permissions_advisor.yml 0000664 0000000 0000000 00000001036 14735767125 0024430 0 ustar 00root root 0000000 0000000 name: Permissions Advisor
permissions:
actions: read
on:
workflow_dispatch:
inputs:
name:
description: 'The name of the workflow file to analyze'
required: true
type: string
count:
description: 'How many last runs to analyze'
required: false
type: number
default: 10
jobs:
advisor:
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/advisor@v1
with:
name: ${{ inputs.name }}
count: ${{ inputs.count }}
pathvalidate-3.2.3/.github/workflows/release.yml 0000664 0000000 0000000 00000003357 14735767125 0021756 0 ustar 00root root 0000000 0000000 name: Build and publish the new version to PyPI
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
jobs:
build-package:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- run: make build
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
publish-package:
needs: build-package
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: pypi
url: https://pypi.org/p/pathvalidate
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
generate-relese:
needs: publish-package
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Generate a GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*
pathvalidate-3.2.3/.gitignore 0000664 0000000 0000000 00000002574 14735767125 0016206 0 ustar 00root root 0000000 0000000 # Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# User settings
_sandbox/
bin/
*_profile
Untitled.ipynb
pathvalidate-3.2.3/.readthedocs.yaml 0000664 0000000 0000000 00000000331 14735767125 0017432 0 ustar 00root root 0000000 0000000 version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
sphinx:
configuration: docs/conf.py
formats:
- epub
python:
install:
- method: pip
path: .
extra_requirements:
- docs
pathvalidate-3.2.3/CHANGELOG.md 0000664 0000000 0000000 00000053750 14735767125 0016031 0 ustar 00root root 0000000 0000000
# [v3.2.2](https://github.com/thombashi/pathvalidate/releases/tag/v3.2.2) - 2025-01-01
- Fix the detection logic of the reservation words for the file name on Windows: [#57](https://github.com/thombashi/pathvalidate/issues/57) (Thanks to [@jplarocque](https://github.com/jplarocque))
- Drop support for Python 3.7/3.8
- Refactor type annotations
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.2.1...v3.2.2
[Changes][v3.2.2]
# [v3.2.1](https://github.com/thombashi/pathvalidate/releases/tag/v3.2.1) - 2024-08-23
## What's Changed
* Test Python 3.12 in CIs by [@MatthieuDartiailh](https://github.com/MatthieuDartiailh) in [#40](https://github.com/thombashi/pathvalidate/pull/40)
* Bump actions/setup-python from 4 to 5 by [@dependabot](https://github.com/dependabot) in [#36](https://github.com/thombashi/pathvalidate/pull/36)
* Bump actions/upload-artifact from 3 to 4 by [@dependabot](https://github.com/dependabot) in [#38](https://github.com/thombashi/pathvalidate/pull/38)
* Bump actions/download-artifact from 3 to 4 by [@dependabot](https://github.com/dependabot) in [#37](https://github.com/thombashi/pathvalidate/pull/37)
* Fix CI by [@thombashi](https://github.com/thombashi) in [#41](https://github.com/thombashi/pathvalidate/pull/41)
* Update the CI workflow to include a job that publishes packages to TestPyPI by [@thombashi](https://github.com/thombashi) in [#42](https://github.com/thombashi/pathvalidate/pull/42)
* Fix coverage report by [@thombashi](https://github.com/thombashi) in [#45](https://github.com/thombashi/pathvalidate/pull/45)
* Fix `sanitize_filename` truncation by [@7x11x13](https://github.com/7x11x13) in [#48](https://github.com/thombashi/pathvalidate/pull/48)
* Fix validation functions of filepaths by [@thombashi](https://github.com/thombashi) in [#55](https://github.com/thombashi/pathvalidate/pull/55)
- If `platform` argument is `windows` or `universal`, filepaths ending with a space or a period should be detected as an error
- Fix POSIX-style absolute paths were not detected as errors with `platform="windows"` or `platform="universal"` on Python 3.12 and below
* Add support for Python 3.13 by [@thombashi](https://github.com/thombashi) in [#56](https://github.com/thombashi/pathvalidate/pull/56)
* Improve type annotations
* Add a build and publish workflow
* Add Sigstore signatures to release assets
* Update copyright year to include the last update year: [#54](https://github.com/thombashi/pathvalidate/issues/54) (Thanks to [@Flimm](https://github.com/Flimm))
* Add CHANGELOG
## New Contributors
* [@MatthieuDartiailh](https://github.com/MatthieuDartiailh) made their first contribution in [#40](https://github.com/thombashi/pathvalidate/pull/40)
* [@dependabot](https://github.com/dependabot) made their first contribution in [#36](https://github.com/thombashi/pathvalidate/pull/36)
* [@7x11x13](https://github.com/7x11x13) made their first contribution in [#48](https://github.com/thombashi/pathvalidate/pull/48)
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.2.0...v3.2.1
[Changes][v3.2.1]
# [v3.2.0](https://github.com/thombashi/pathvalidate/releases/tag/v3.2.0) - 2023-09-17
- Add `reserved_name_handler` argument to `sanitize_filename` function and `sanitize_filepath` function
- Add `NullValueHandler` class and `ReservedNameHandler` class
- Add `fs_encoding` property and `byte_count` property to `ValidationError` class
- Add `additional_reserved_names` argument to validate/sanitize functions to allow custom reserved names
- Modify the return value format of `ValidationError.__str__` method
- Improve type annotations
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.1.0...v3.2.0
[Changes][v3.2.0]
# [v3.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v3.1.0) - 2023-07-16
- Fix validation error messages to show the `target-platform` properly: [#34](https://github.com/thombashi/pathvalidate/issues/34) (Thanks to [@matanster](https://github.com/matanster))
- Fix README: out of date with the actual error generated by `validate_filename` [#35](https://github.com/thombashi/pathvalidate/issues/35) (Thanks to [@hXtreme](https://github.com/hXtreme))
- Add `description` property to `ErrorReason` class
- Add `as_slog` method to `ValidationError` class
- Add `docs` extras
- Change the type of the return value of `ValidationError.reason` from `Optional[ErrorReason]` to `ErrorReason`
- Update `[build-system]`
- Drop support for Python 3.6
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.0.0...v3.1.0
[Changes][v3.1.0]
# [v3.0.0](https://github.com/thombashi/pathvalidate/releases/tag/v3.0.0) - 2023-05-22
## What's Changed
- Trim heading spaces in Windows by [@eggplants](https://github.com/eggplants) in [#28](https://github.com/thombashi/pathvalidate/pull/28)
- Consider filesystem encoding for length calculations: [#26](https://github.com/thombashi/pathvalidate/issues/26) (Thanks to [@virlos](https://github.com/virlos))
- Fix type model: [#29](https://github.com/thombashi/pathvalidate/issues/29) (Thanks to [@rogalski](https://github.com/rogalski))
- Fix sanitizing of filenames that only consist of whitespaces and periods
- Add `validate_unprintable_char` function
- Add `validate_after_sanitize` keyword argument to `sanitize_filename` and `sanitize_filepath` functions
- Add error codes to `ErrorReason`
- Add `zip_safe=False` to `setup`
- Modify to accept `pathvalidate.Platform` type as `platform` arguments
- Rename type alias from `Handler` to `NullValueHandler`
- Remove `InvalidLengthError` to use `ValidationError`
- Improve type annotations
- Make it possible to import `FileNameValidator` and `FilePathValidator` classes from the package root
- Change constructor arguments of `FileNameSanitizer` and `FilePathSanitizer` classes
- Remove `min_len`
- Add `validator`
- Remove deprecated functions
- Modify error messages
- Refactoring
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v2.5.2...v3.0.0
[Changes][v3.0.0]
# [v2.5.2](https://github.com/thombashi/pathvalidate/releases/tag/v2.5.2) - 2022-08-20
- Add support for Python 3.11: [#22](https://github.com/thombashi/pathvalidate/issues/22) (Thanks to [@hegjon](https://github.com/hegjon))
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v2.5.1...v2.5.2
[Changes][v2.5.2]
# [v2.5.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.5.1) - 2022-07-31
## What's Changed
* Add `__all__` by [@eggplants](https://github.com/eggplants) in [#24](https://github.com/thombashi/pathvalidate/pull/24)
* Add `DeprecationWarning` to deprecated functions
## New Contributors
* [@eggplants](https://github.com/eggplants) made their first contribution in [#24](https://github.com/thombashi/pathvalidate/pull/24)
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v2.5.0...v2.5.1
[Changes][v2.5.1]
# [v2.5.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.5.0) - 2021-09-26
- Add support for Python 3.10
- Drop support for Python 3.5
- Add `null_value_handler` argument to `sanitize_filename`/`sanitize_filepath` functions: [#20](https://github.com/thombashi/pathvalidate/issues/20) (Thanks to @
mkbloke)
- Add `AbstractSanitizer`/`AbstractValidator` classes to import path
- Add `replace_ansi_escape` function
- Add `setup-ci` target to `Makefile`
- Modify `min_len`/`max_len` to use default values when assigned minus values
[Changes][v2.5.0]
# [v2.4.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.4.1) - 2021-04-03
- Fix filename validations that include `'\'` (backslash) on other than Windows: [#18](https://github.com/thombashi/pathvalidate/issues/18) (Thanks to [@Traktormaster](https://github.com/Traktormaster))
[Changes][v2.4.1]
# [v2.4.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.4.0) - 2021-03-21
- Add `exclude_symbols` argument to `replace_symbol` function
- Fix permissions of files included in `sdist` package binary (Thanks to [@hegjon](https://github.com/hegjon))
[Changes][v2.4.0]
# [v2.3.2](https://github.com/thombashi/pathvalidate/releases/tag/v2.3.2) - 2021-01-03
- Fix to disallow file name/path that only white spaces for `universal` platform
[Changes][v2.3.2]
# [v2.3.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.3.1) - 2020-12-13
- Modify to accept file name/path that consists only whitespaces: [#15](https://github.com/thombashi/pathvalidate/issues/15) (Thank to [@Traktormaster](https://github.com/Traktormaster))
[Changes][v2.3.1]
# [v2.3.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.3.0) - 2020-05-03
- Change not to process for `"."`/`".."` by sanitization functions: [#13](https://github.com/thombashi/pathvalidate/issues/13) (Thanks to [@ProfElectric](https://github.com/ProfElectric))
- Change to normalize with `sanitize_filepath` in default
- Add normalize interface to `sanitize_filepath`
[Changes][v2.3.0]
# [v2.2.2](https://github.com/thombashi/pathvalidate/releases/tag/v2.2.2) - 2020-03-28
- Improve file path validation for Windows platform: [#12](https://github.com/thombashi/pathvalidate/issues/12) (Thanks to [@bschollnick](https://github.com/bschollnick))
- Fix `__str__` method
- Fix to avoid raise an exception when an absolute path includes `"."`/`".."`
- Modify an error message
- Modify raising exception from `NullNameError` to `ValidationError` of `validate_pathtype`
[Changes][v2.2.2]
# [v2.2.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.2.1) - 2020-03-20
- Fix to include `py.typed` to the package
[Changes][v2.2.1]
# [v2.2.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.2.0) - 2020-02-12
- Add `POSIX` as a platform
- Add a reserved keyword for macOS
- Change platform of `validate_filepath_arg`/`sanitize_filepath_arg` to `'auto'`: [#11](https://github.com/thombashi/pathvalidate/issues/11) (Thanks to [@freelanceAndy](https://github.com/freelanceAndy))
[Changes][v2.2.0]
# [v2.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.1.0) - 2020-02-01
- Add `check_reserved` argument to validate/sanitize functions
- Add `'/'` as a reserved file path for Linux/macOS
- Suppress errors when sanitizing null values
- Fix `max_len` value check for file names
- Include type annotation information to the package
- Remove `dev` extras_require
- Bug fixes
[Changes][v2.1.0]
# [v2.0.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.0.0) - 2020-01-13
- Change to be more strict validation for absolute paths
- Fix argparse validator/sanitizer failed when empty inputs
- Bug fixes
[Changes][v2.0.0]
# [v1.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v1.1.0) - 2020-01-04
- Modify validate/sanitize functions for `argparse`
- Modify validate/sanitize functions for `click`
- Update `dev` extras
[Changes][v1.1.0]
# [v1.0.0](https://github.com/thombashi/pathvalidate/releases/tag/v1.0.0) - 2020-01-03
- Drop Python 2 support
- Modify to use Python 3 functionality
- Update `extras_require`
- Bug fixes
- Remove a deprecated property
[Changes][v1.0.0]
# [v0.29.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.29.1) - 2020-01-02
- Fix file path length validation: [#10](https://github.com/thombashi/pathvalidate/issues/10) (Thanks to [@UncleGoogle](https://github.com/UncleGoogle))
- Add `.asc` files of packages to PyPI
[Changes][v0.29.1]
# [v0.29.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.29.0) - 2019-06-16
- Add filename/filepath validators for `argparse`/`click`
- Modify error messages
[Changes][v0.29.0]
# [v0.28.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.28.2) - 2019-05-18
- Fix to properly escape special chars for validation error messages: [#9](https://github.com/thombashi/pathvalidate/issues/9) (Thanks to [@UncleGoogle](https://github.com/UncleGoogle))
[Changes][v0.28.2]
# [v0.28.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.28.0) - 2019-05-01
- Drop support for Python 3.4
[Changes][v0.28.0]
# [v0.26.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.26.0) - 2019-03-15
- Add support for NTFS reserved names
- Improve drive letter handling
[Changes][v0.26.0]
# [v0.25.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.25.0) - 2019-03-14
- Add `CLOCK$` as a reserved filename for Windows platform: [#8](https://github.com/thombashi/pathvalidate/issues/8) (Thanks to [@sparr](https://github.com/sparr))
- Improve reserved name detection
- Add `reserved_name` property to `ReservedNameError` class
[Changes][v0.25.0]
# [v0.24.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.24.1) - 2019-02-12
- Fix improper error messages
- Improve error message readability
[Changes][v0.24.1]
# [v0.24.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.24.0) - 2019-02-03
- Add `is_valid_filename`/`is_valid_filepath` function
- Add `FileNameSanitizer`/`FilePathSanitizer` classes
- Add minimum length validation support
- Remove deprecated functions
[Changes][v0.24.0]
# [v0.23.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.23.0) - 2019-01-06
- Improve sanitization/validation for files
- Add `.` and `..` as reserved keywords for files
- Add limit to `max_filename_len`
- Fix platform specific sanitization: [#7](https://github.com/thombashi/pathvalidate/issues/7)
- Fix reserved keywords sanitization/validation for files
- Integrate `InvalidCharWindowsError` into `InvalidCharError`
- Change to use `ReservedNameError` instead of `InvalidReservedNameError`
- Breaking changes
- Rename a property for `FileSanitizer` from `platform_name` to `platform`
- Rename methods argument from `platform_name` to `platform`
[Changes][v0.23.0]
# [v0.22.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.22.0) - 2018-12-23
- Add universal (platform independent) filename/filepath sanitization/validation
- Treat ASCII whitespace other than normal space as invalid on Windows [#6](https://github.com/thombashi/pathvalidate/issues/6) (Thanks to [@nyuszika7h](https://github.com/nyuszika7h))
[Changes][v0.22.0]
# [v0.21.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.21.1) - 2018-07-28
- Add support for PathLike object
- Bug fixes
[Changes][v0.21.1]
# [v0.18.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.18.0) - 2018-07-07
- Add validations/sanitizations for unprintable characters
- Add support for Python 3.7
[Changes][v0.18.0]
# [v0.15.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.15.0) - 2017-03-18
- Remove package dependencies
- pathvalidate functions are expected to passing unicode strings.
[Changes][v0.15.0]
# [v0.14.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.14.0) - 2017-02-11
- Change max file name/path length to configurable
- Add support for Python 3.6
- Bug fixes
[Changes][v0.14.0]
# [v0.13.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.13.0) - 2017-01-03
- Add JavaScript validator/sanitizer
- Bug fixes
[Changes][v0.13.0]
# [v0.11.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.11.0) - 2016-12-25
- Add multibyte character validate/sanitize support
[Changes][v0.11.0]
# [v0.10.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.10.0) - 2016-12-23
- Add LTSV support
[Changes][v0.10.0]
# [v0.9.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.9.1) - 2016-11-17
- Support UTF8
[Changes][v0.9.1]
# [v0.9.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.9.0) - 2016-11-13
- Add validate_symbol function
[Changes][v0.9.0]
# [v0.8.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.8.2) - 2016-10-27
- Fix Windows path validation
- Bug fixes
[Changes][v0.8.2]
# [v0.6.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.6.0) - 2016-09-19
- Add SQLite name validation function
[Changes][v0.6.0]
# [v0.5.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.5.2) - 2016-08-20
- Fix validate/sanitize of excel sheet
- Subdividing errors
- Add file name validation for Windows reserved names and path length
[Changes][v0.5.2]
# [v0.5.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.5.1) - 2016-07-23
- Modify error handling
[Changes][v0.5.1]
# [v0.5.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.5.0) - 2016-07-17
- Drop support for Python 2.6
- Add validate_excel_sheet_name function
- Add sanitize_excel_sheet_name function
[Changes][v0.5.0]
# [v0.4.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.4.2) - 2016-06-19
- Make pytest-runner a conditional requirement
[Changes][v0.4.2]
# [v0.4.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.4.1) - 2016-05-29
- Modify replace_symbol function behavior
[Changes][v0.4.1]
# [v0.4.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.4.0) - 2016-05-28
- Add validate_file_path/sanitize_file_path functions
- Fix validate/sanitize filename functions
- Fix validate/sanitize python variable name functions
[Changes][v0.4.0]
# [v0.3.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.3.0) - 2016-05-22
- Add validate_python_var_name function
[Changes][v0.3.0]
# [v0.2.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.2.0) - 2016-05-21
- Add sanitize_python_var_name function
[Changes][v0.2.0]
# [v0.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.1.0) - 2016-03-24
[Changes][v0.1.0]
[v3.2.2]: https://github.com/thombashi/pathvalidate/compare/v3.2.1...v3.2.2
[v3.2.1]: https://github.com/thombashi/pathvalidate/compare/v3.2.0...v3.2.1
[v3.2.0]: https://github.com/thombashi/pathvalidate/compare/v3.1.0...v3.2.0
[v3.1.0]: https://github.com/thombashi/pathvalidate/compare/v3.0.0...v3.1.0
[v3.0.0]: https://github.com/thombashi/pathvalidate/compare/v2.5.2...v3.0.0
[v2.5.2]: https://github.com/thombashi/pathvalidate/compare/v2.5.1...v2.5.2
[v2.5.1]: https://github.com/thombashi/pathvalidate/compare/v2.5.0...v2.5.1
[v2.5.0]: https://github.com/thombashi/pathvalidate/compare/v2.4.1...v2.5.0
[v2.4.1]: https://github.com/thombashi/pathvalidate/compare/v2.4.0...v2.4.1
[v2.4.0]: https://github.com/thombashi/pathvalidate/compare/v2.3.2...v2.4.0
[v2.3.2]: https://github.com/thombashi/pathvalidate/compare/v2.3.1...v2.3.2
[v2.3.1]: https://github.com/thombashi/pathvalidate/compare/v2.3.0...v2.3.1
[v2.3.0]: https://github.com/thombashi/pathvalidate/compare/v2.2.2...v2.3.0
[v2.2.2]: https://github.com/thombashi/pathvalidate/compare/v2.2.1...v2.2.2
[v2.2.1]: https://github.com/thombashi/pathvalidate/compare/v2.2.0...v2.2.1
[v2.2.0]: https://github.com/thombashi/pathvalidate/compare/v2.1.0...v2.2.0
[v2.1.0]: https://github.com/thombashi/pathvalidate/compare/v2.0.0...v2.1.0
[v2.0.0]: https://github.com/thombashi/pathvalidate/compare/v1.1.0...v2.0.0
[v1.1.0]: https://github.com/thombashi/pathvalidate/compare/v1.0.0...v1.1.0
[v1.0.0]: https://github.com/thombashi/pathvalidate/compare/v0.29.1...v1.0.0
[v0.29.1]: https://github.com/thombashi/pathvalidate/compare/v0.29.0...v0.29.1
[v0.29.0]: https://github.com/thombashi/pathvalidate/compare/v0.28.2...v0.29.0
[v0.28.2]: https://github.com/thombashi/pathvalidate/compare/v0.28.0...v0.28.2
[v0.28.0]: https://github.com/thombashi/pathvalidate/compare/v0.26.0...v0.28.0
[v0.26.0]: https://github.com/thombashi/pathvalidate/compare/v0.25.0...v0.26.0
[v0.25.0]: https://github.com/thombashi/pathvalidate/compare/v0.24.1...v0.25.0
[v0.24.1]: https://github.com/thombashi/pathvalidate/compare/v0.24.0...v0.24.1
[v0.24.0]: https://github.com/thombashi/pathvalidate/compare/v0.23.0...v0.24.0
[v0.23.0]: https://github.com/thombashi/pathvalidate/compare/v0.22.0...v0.23.0
[v0.22.0]: https://github.com/thombashi/pathvalidate/compare/v0.21.1...v0.22.0
[v0.21.1]: https://github.com/thombashi/pathvalidate/compare/v0.18.0...v0.21.1
[v0.18.0]: https://github.com/thombashi/pathvalidate/compare/v0.15.0...v0.18.0
[v0.15.0]: https://github.com/thombashi/pathvalidate/compare/v0.14.0...v0.15.0
[v0.14.0]: https://github.com/thombashi/pathvalidate/compare/v0.13.0...v0.14.0
[v0.13.0]: https://github.com/thombashi/pathvalidate/compare/v0.11.0...v0.13.0
[v0.11.0]: https://github.com/thombashi/pathvalidate/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/thombashi/pathvalidate/compare/v0.9.1...v0.10.0
[v0.9.1]: https://github.com/thombashi/pathvalidate/compare/v0.9.0...v0.9.1
[v0.9.0]: https://github.com/thombashi/pathvalidate/compare/v0.8.2...v0.9.0
[v0.8.2]: https://github.com/thombashi/pathvalidate/compare/v0.6.0...v0.8.2
[v0.6.0]: https://github.com/thombashi/pathvalidate/compare/v0.5.2...v0.6.0
[v0.5.2]: https://github.com/thombashi/pathvalidate/compare/v0.5.1...v0.5.2
[v0.5.1]: https://github.com/thombashi/pathvalidate/compare/v0.5.0...v0.5.1
[v0.5.0]: https://github.com/thombashi/pathvalidate/compare/v0.4.2...v0.5.0
[v0.4.2]: https://github.com/thombashi/pathvalidate/compare/v0.4.1...v0.4.2
[v0.4.1]: https://github.com/thombashi/pathvalidate/compare/v0.4.0...v0.4.1
[v0.4.0]: https://github.com/thombashi/pathvalidate/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/thombashi/pathvalidate/compare/v0.2.0...v0.3.0
[v0.2.0]: https://github.com/thombashi/pathvalidate/compare/v0.1.0...v0.2.0
[v0.1.0]: https://github.com/thombashi/pathvalidate/tree/v0.1.0
pathvalidate-3.2.3/LICENSE 0000664 0000000 0000000 00000002101 14735767125 0015205 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2016-2025 Tsuyoshi Hombashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
pathvalidate-3.2.3/MANIFEST.in 0000664 0000000 0000000 00000000340 14735767125 0015741 0 ustar 00root root 0000000 0000000 include LICENSE
include README.rst
include tox.ini
include docs/pages/introduction/summary.txt
include */py.typed
recursive-include test *
recursive-include requirements *
global-exclude __pycache__/*
global-exclude *.pyc
pathvalidate-3.2.3/Makefile 0000664 0000000 0000000 00000003324 14735767125 0015650 0 ustar 00root root 0000000 0000000 BIN_DIR := $(shell pwd)/bin
PYTHON := python3
BIN_CHANGELOG_FROM_RELEASE := $(BIN_DIR)/changelog-from-release
AUTHOR := Tsuyoshi Hombashi
FIRST_RELEASE_YEAR := 2016
LAST_UPDATE_YEAR := $(shell git log -1 --format=%cd --date=format:%Y)
$(BIN_CHANGELOG_FROM_RELEASE):
mkdir -p $(BIN_DIR)
GOBIN=$(BIN_DIR) go install github.com/rhysd/changelog-from-release/v3@latest
.PHONY: build
build: clean
@$(PYTHON) -m tox -e build
ls -lh dist/*
.PHONY: changelog
changelog: $(BIN_CHANGELOG_FROM_RELEASE)
$(BIN_CHANGELOG_FROM_RELEASE) > CHANGELOG.md
cp -a CHANGELOG.md docs/pages/CHANGELOG.md
.PHONY: check
check:
$(PYTHON) -m tox -e lint
-$(PYTHON) -m tox -e lint-examples
-rm examples/pathvalidate_examples.py
.PHONY: clean
clean:
rm -rf $(BIN_DIR)
$(PYTHON) -m tox -e clean
.PHONY: docs
docs:
@$(PYTHON) -m tox -e docs
.PHONY: idocs
idocs:
@$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade -e .
@$(MAKE) docs
.PHONY: fmt
fmt:
@$(PYTHON) -m tox -e fmt
.PHONY: readme
readme:
@$(PYTHON) -m tox -e readme
.PHONY: release
release:
$(PYTHON) -m tox -e release
$(MAKE) clean
.PHONY: setup-ci
setup-ci:
$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade pip
$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade tox
.PHONY: setup-dev
setup-dev: setup-ci
$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade -e .[test]
$(PYTHON) -m pip check
.PHONY: test
test:
$(PYTHON) -m tox -e py
.PHONY: update-copyright
update-copyright:
sed -i "s/f\"Copyright .*/f\"Copyright $(FIRST_RELEASE_YEAR)-$(LAST_UPDATE_YEAR), {__author__}\"/" pathvalidate/__version__.py
sed -i "s/^Copyright (c) .* $(AUTHOR)/Copyright (c) $(FIRST_RELEASE_YEAR)-$(LAST_UPDATE_YEAR) $(AUTHOR)/" LICENSE
pathvalidate-3.2.3/README.rst 0000664 0000000 0000000 00000024036 14735767125 0015702 0 ustar 00root root 0000000 0000000 .. contents:: **pathvalidate**
:backlinks: top
:depth: 2
Summary
=========
`pathvalidate `__ is a Python library to sanitize/validate a string such as filenames/file-paths/etc.
|PyPI pkg ver| |conda pkg ver| |Supported Python ver| |Supported Python impl| |CI status| |Test coverage| |CodeQL|
.. |PyPI pkg ver| image:: https://badge.fury.io/py/pathvalidate.svg
:target: https://badge.fury.io/py/pathvalidate
:alt: PyPI package version
.. |conda pkg ver| image:: https://anaconda.org/conda-forge/pathvalidate/badges/version.svg
:target: https://anaconda.org/conda-forge/pathvalidate
:alt: conda package version
.. |Supported Python ver| image:: https://img.shields.io/pypi/pyversions/pathvalidate.svg
:target: https://pypi.org/project/pathvalidate
:alt: Supported Python versions
.. |Supported Python impl| image:: https://img.shields.io/pypi/implementation/pathvalidate.svg
:target: https://pypi.org/project/pathvalidate
:alt: Supported Python implementations
.. |CI status| image:: https://github.com/thombashi/pathvalidate/actions/workflows/ci.yml/badge.svg
:target: https://github.com/thombashi/pathvalidate/actions/workflows/ci.yml
:alt: CI status of Linux/macOS/Windows
.. |Test coverage| image:: https://coveralls.io/repos/github/thombashi/pathvalidate/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/pathvalidate?branch=master
:alt: Test coverage: coveralls
.. |CodeQL| image:: https://github.com/thombashi/pathvalidate/actions/workflows/github-code-scanning/codeql/badge.svg
:target: https://github.com/thombashi/pathvalidate/actions/workflows/github-code-scanning/codeql
:alt: CodeQL
Features
---------
- Sanitize/Validate a string as a:
- file name
- file path
- Sanitize will do:
- Remove invalid characters for a target platform
- Replace reserved names for a target platform
- Normalize
- Remove unprintable characters
- Argument validator/sanitizer for ``argparse`` and ``click``
- Multi platform support:
- ``Linux``
- ``Windows``
- ``macOS``
- ``POSIX``: POSIX-compliant systems (Linux, macOS, etc.)
- ``universal``: platform independent
- Multibyte character support
CLI tool
---------
You can find this package's command line interface tool at the `pathvalidate-cli `__ repository.
Examples
==========
Sanitize a filename
---------------------
:Sample Code:
.. code-block:: python
from pathvalidate import sanitize_filename
fname = "fi:l*e/p\"a?t>h|.t {sanitize_filename(fname)}\n")
fname = "\0_a*b:ce%f/(g)h+i_0.txt"
print(f"{fname} -> {sanitize_filename(fname)}\n")
:Output:
.. code-block::
fi:l*e/p"a?t>h|.t filepath.txt
_a*b:ce%f/(g)h+i_0.txt -> _abcde%f(g)h+i_0.txt
The default target ``platform`` is ``universal``.
i.e. the sanitized file name is valid for any platform.
Sanitize a filepath
---------------------
:Sample Code:
.. code-block:: python
from pathvalidate import sanitize_filepath
fpath = "fi:l*e/p\"a?t>h|.t {sanitize_filepath(fpath)}\n")
fpath = "\0_a*b:ce%f/(g)h+i_0.txt"
print(f"{fpath} -> {sanitize_filepath(fpath)}\n")
:Output:
.. code-block::
fi:l*e/p"a?t>h|.t file/path.txt
_a*b:ce%f/(g)h+i_0.txt -> _abcde%f/(g)h+i_0.txt
Validate a filename
---------------------
:Sample Code:
.. code-block:: python
import sys
from pathvalidate import ValidationError, validate_filename
try:
validate_filename("fi:l*e/p\"a?t>h|.th|.th|.t None:
if filename:
click.echo(f"filename: {filename}")
if filepath:
click.echo(f"filepath: {filepath}")
if __name__ == "__main__":
cli()
:Output:
.. code-block::
$ ./examples/click_validate.py --filename ab
filename: ab
$ ./examples/click_validate.py --filepath e?g
Usage: click_validate.py [OPTIONS]
Try 'click_validate.py --help' for help.
Error: Invalid value for '--filename': [PV1100] invalid characters found: invalids=('?'), value='e?g', platform=Windows
filename/filepath sanitizer for ``click``
-------------------------------------------
:Sample Code:
.. code-block:: python
import click
from pathvalidate.click import sanitize_filename_arg, sanitize_filepath_arg
@click.command()
@click.option("--filename", callback=sanitize_filename_arg)
@click.option("--filepath", callback=sanitize_filepath_arg)
def cli(filename, filepath):
if filename:
click.echo(f"filename: {filename}")
if filepath:
click.echo(f"filepath: {filepath}")
if __name__ == "__main__":
cli()
:Output:
.. code-block::
$ ./examples/click_sanitize.py --filename a/b
filename: ab
For more information
----------------------
More examples can be found at
https://pathvalidate.rtfd.io/en/latest/pages/examples/index.html
Installation
============
Installation: pip
------------------------------
::
pip install pathvalidate
Installation: conda
------------------------------
::
conda install conda-forge::pathvalidate
Installation: apt
------------------------------
::
sudo add-apt-repository ppa:thombashi/ppa
sudo apt update
sudo apt install python3-pathvalidate
Dependencies
============
Python 3.9+
no external dependencies.
Documentation
===============
https://pathvalidate.rtfd.io/
Sponsors
====================================
|chasbecker| |shiguredo| |b4tman| |Arturi0| |github|
.. |chasbecker| image:: https://avatars.githubusercontent.com/u/44389260?s=48&u=6da7176e51ae2654bcfd22564772ef8a3bb22318&v=4
:target: https://github.com/chasbecker
:alt: ex-sponsor: Charles Becker (chasbecker)
.. |shiguredo| image:: https://avatars.githubusercontent.com/u/2549434?s=48&v=4
:target: https://github.com/shiguredo
:alt: ex-sponsor: 時雨堂 (shiguredo)
.. |b4tman| image:: https://avatars.githubusercontent.com/u/3658062?s=48&v=4
:target: https://github.com/b4tman
:alt: onetime: Dmitry Belyaev (b4tman)
.. |Arturi0| image:: https://avatars.githubusercontent.com/u/46711571?s=48&u=57687c0e02d5d6e8eeaf9177f7b7af4c9f275eb5&v=4
:target: https://github.com/Arturi0
:alt: onetime: Arturi0
.. |github| image:: https://avatars.githubusercontent.com/u/9919?s=48&v=4
:target: https://github.com/github
:alt: onetime: GitHub (github)
`Become a sponsor `__
pathvalidate-3.2.3/docs/ 0000775 0000000 0000000 00000000000 14735767125 0015136 5 ustar 00root root 0000000 0000000 pathvalidate-3.2.3/docs/Makefile 0000664 0000000 0000000 00000017630 14735767125 0016605 0 ustar 00root root 0000000 0000000 # Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help:
@echo "Please use \`make ' where is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pathvalidate.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pathvalidate.qhc"
.PHONY: applehelp
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
.PHONY: devhelp
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pathvalidate"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pathvalidate"
@echo "# devhelp"
.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
epub3:
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
.PHONY: dummy
dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."
pathvalidate-3.2.3/docs/conf.py 0000664 0000000 0000000 00000023521 14735767125 0016440 0 ustar 00root root 0000000 0000000 import os
import sys
import sphinx_rtd_theme
from pathvalidate import __author__, __copyright__, __name__, __version__
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../pathvalidate'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
intersphinx_mapping = {'python': ('https://docs.python.org/', None)}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = __name__
copyright = __copyright__
author = __author__
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = __version__
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents.
# " v documentation" by default.
#html_title = u'pathvalidate v0.1.0'
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
#html_last_updated_fmt = None
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
#html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
#html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'pathvalidatedoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pathvalidate.tex', 'pathvalidate Documentation',
__author__, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pathvalidate', 'pathvalidate Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pathvalidate', 'pathvalidate Documentation',
author, 'pathvalidate', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
rst_prolog = r"""
.. |False| replace:: :py:obj:`False`
.. |True| replace:: :py:obj:`True`
.. |None| replace:: :py:obj:`None`
.. |invalid_file_path_chars| replace::
``\\0``
.. |invalid_win_file_path_chars| replace::
``:``, ``*``, ``?``, ``"``, ``<``, ``>``, ``|``,
``\t``, ``\n``, ``\r``, ``\x0b``, ``\x0c``
.. |invalid_filename_chars| replace::
``/``, ``\\0``
.. |invalid_win_filename_chars| replace::
``\``, ``:``, ``*``, ``?``, ``"``, ``<``, ``>``, ``|``,
``\t``, ``\n``, ``\r``, ``\x0b``, ``\x0c``
.. |invalid_excel_sheet_chars| replace::
``[``, ``]``, ``:``, ``*``, ``?``, ``/``, ``\``
.. |raises_sqlite_keywords| replace::
If the ``name`` is equals to
`SQLite Keywords `__.
"""
pathvalidate-3.2.3/docs/index.rst 0000664 0000000 0000000 00000001121 14735767125 0016772 0 ustar 00root root 0000000 0000000 Welcome to pathvalidate's documentation!
========================================
.. raw:: html
.. toctree::
:caption: Table of Contents
:maxdepth: 3
:numbered:
pages/introduction/index
pages/examples/index
pages/reference/index
pages/changelog_ref
pages/links
Indices and tables
==================
* :ref:`genindex`
pathvalidate-3.2.3/docs/make.bat 0000664 0000000 0000000 00000016447 14735767125 0016557 0 ustar 00root root 0000000 0000000 @ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^` where ^ is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. epub3 to make an epub3
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
echo. dummy to check syntax errors of document sources
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
:sphinx_ok
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pathvalidate.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pathvalidate.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "epub3" (
%SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub3 file is in %BUILDDIR%/epub3.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
if "%1" == "dummy" (
%SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy
if errorlevel 1 exit /b 1
echo.
echo.Build finished. Dummy builder generates no files.
goto end
)
:end
pathvalidate-3.2.3/docs/make_readme.py 0000664 0000000 0000000 00000004634 14735767125 0017751 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python3
"""
.. codeauthor:: Tsuyoshi Hombashi
"""
import sys
from path import Path
from readmemaker import ReadmeMaker
PROJECT_NAME = "pathvalidate"
OUTPUT_DIR = ".."
def write_examples(maker: ReadmeMaker) -> None:
maker.set_indent_level(0)
maker.write_chapter("Examples")
example_root = Path("pages").joinpath("examples")
maker.inc_indent_level()
maker.write_chapter("Sanitize a filename")
maker.write_file(example_root.joinpath("sanitize_filename_code.txt"))
maker.write_chapter("Sanitize a filepath")
maker.write_file(example_root.joinpath("sanitize_filepath_code.txt"))
maker.write_chapter("Validate a filename")
maker.write_file(example_root.joinpath("validate_filename_code.txt"))
maker.write_chapter("Check a filename")
maker.write_file(example_root.joinpath("is_valid_filename_code.txt"))
maker.write_chapter("filename/filepath validator for ``argparse``")
maker.write_file(example_root.joinpath("argparse_validator.txt"))
maker.write_chapter("filename/filepath sanitizer for ``argparse``")
maker.write_file(example_root.joinpath("argparse_sanitizer.txt"))
maker.write_chapter("filename/filepath validator for ``click``")
maker.write_file(example_root.joinpath("click_validator.txt"))
maker.write_chapter("filename/filepath sanitizer for ``click``")
maker.write_file(example_root.joinpath("click_sanitizer.txt"))
maker.write_chapter("For more information")
maker.write_lines(
[
"More examples can be found at ",
f"https://{PROJECT_NAME}.rtfd.io/en/latest/pages/examples/index.html",
]
)
def main() -> int:
maker = ReadmeMaker(
PROJECT_NAME,
OUTPUT_DIR,
is_make_toc=True,
project_url=f"https://github.com/thombashi/{PROJECT_NAME}",
)
maker.write_chapter("Summary")
maker.write_introduction_file("summary.txt")
maker.write_introduction_file("badges.txt")
maker.write_introduction_file("feature.txt")
maker.write_introduction_file("cli.txt")
write_examples(maker)
maker.write_introduction_file("installation.rst")
maker.set_indent_level(0)
maker.write_chapter("Documentation")
maker.write_lines([f"https://{PROJECT_NAME}.rtfd.io/"])
maker.write_file(maker.doc_page_root_dir_path.joinpath("sponsors.rst"))
return 0
if __name__ == "__main__":
sys.exit(main())
pathvalidate-3.2.3/docs/pages/ 0000775 0000000 0000000 00000000000 14735767125 0016235 5 ustar 00root root 0000000 0000000 pathvalidate-3.2.3/docs/pages/CHANGELOG.md 0000664 0000000 0000000 00000053750 14735767125 0020060 0 ustar 00root root 0000000 0000000
# [v3.2.2](https://github.com/thombashi/pathvalidate/releases/tag/v3.2.2) - 2025-01-01
- Fix the detection logic of the reservation words for the file name on Windows: [#57](https://github.com/thombashi/pathvalidate/issues/57) (Thanks to [@jplarocque](https://github.com/jplarocque))
- Drop support for Python 3.7/3.8
- Refactor type annotations
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.2.1...v3.2.2
[Changes][v3.2.2]
# [v3.2.1](https://github.com/thombashi/pathvalidate/releases/tag/v3.2.1) - 2024-08-23
## What's Changed
* Test Python 3.12 in CIs by [@MatthieuDartiailh](https://github.com/MatthieuDartiailh) in [#40](https://github.com/thombashi/pathvalidate/pull/40)
* Bump actions/setup-python from 4 to 5 by [@dependabot](https://github.com/dependabot) in [#36](https://github.com/thombashi/pathvalidate/pull/36)
* Bump actions/upload-artifact from 3 to 4 by [@dependabot](https://github.com/dependabot) in [#38](https://github.com/thombashi/pathvalidate/pull/38)
* Bump actions/download-artifact from 3 to 4 by [@dependabot](https://github.com/dependabot) in [#37](https://github.com/thombashi/pathvalidate/pull/37)
* Fix CI by [@thombashi](https://github.com/thombashi) in [#41](https://github.com/thombashi/pathvalidate/pull/41)
* Update the CI workflow to include a job that publishes packages to TestPyPI by [@thombashi](https://github.com/thombashi) in [#42](https://github.com/thombashi/pathvalidate/pull/42)
* Fix coverage report by [@thombashi](https://github.com/thombashi) in [#45](https://github.com/thombashi/pathvalidate/pull/45)
* Fix `sanitize_filename` truncation by [@7x11x13](https://github.com/7x11x13) in [#48](https://github.com/thombashi/pathvalidate/pull/48)
* Fix validation functions of filepaths by [@thombashi](https://github.com/thombashi) in [#55](https://github.com/thombashi/pathvalidate/pull/55)
- If `platform` argument is `windows` or `universal`, filepaths ending with a space or a period should be detected as an error
- Fix POSIX-style absolute paths were not detected as errors with `platform="windows"` or `platform="universal"` on Python 3.12 and below
* Add support for Python 3.13 by [@thombashi](https://github.com/thombashi) in [#56](https://github.com/thombashi/pathvalidate/pull/56)
* Improve type annotations
* Add a build and publish workflow
* Add Sigstore signatures to release assets
* Update copyright year to include the last update year: [#54](https://github.com/thombashi/pathvalidate/issues/54) (Thanks to [@Flimm](https://github.com/Flimm))
* Add CHANGELOG
## New Contributors
* [@MatthieuDartiailh](https://github.com/MatthieuDartiailh) made their first contribution in [#40](https://github.com/thombashi/pathvalidate/pull/40)
* [@dependabot](https://github.com/dependabot) made their first contribution in [#36](https://github.com/thombashi/pathvalidate/pull/36)
* [@7x11x13](https://github.com/7x11x13) made their first contribution in [#48](https://github.com/thombashi/pathvalidate/pull/48)
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.2.0...v3.2.1
[Changes][v3.2.1]
# [v3.2.0](https://github.com/thombashi/pathvalidate/releases/tag/v3.2.0) - 2023-09-17
- Add `reserved_name_handler` argument to `sanitize_filename` function and `sanitize_filepath` function
- Add `NullValueHandler` class and `ReservedNameHandler` class
- Add `fs_encoding` property and `byte_count` property to `ValidationError` class
- Add `additional_reserved_names` argument to validate/sanitize functions to allow custom reserved names
- Modify the return value format of `ValidationError.__str__` method
- Improve type annotations
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.1.0...v3.2.0
[Changes][v3.2.0]
# [v3.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v3.1.0) - 2023-07-16
- Fix validation error messages to show the `target-platform` properly: [#34](https://github.com/thombashi/pathvalidate/issues/34) (Thanks to [@matanster](https://github.com/matanster))
- Fix README: out of date with the actual error generated by `validate_filename` [#35](https://github.com/thombashi/pathvalidate/issues/35) (Thanks to [@hXtreme](https://github.com/hXtreme))
- Add `description` property to `ErrorReason` class
- Add `as_slog` method to `ValidationError` class
- Add `docs` extras
- Change the type of the return value of `ValidationError.reason` from `Optional[ErrorReason]` to `ErrorReason`
- Update `[build-system]`
- Drop support for Python 3.6
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v3.0.0...v3.1.0
[Changes][v3.1.0]
# [v3.0.0](https://github.com/thombashi/pathvalidate/releases/tag/v3.0.0) - 2023-05-22
## What's Changed
- Trim heading spaces in Windows by [@eggplants](https://github.com/eggplants) in [#28](https://github.com/thombashi/pathvalidate/pull/28)
- Consider filesystem encoding for length calculations: [#26](https://github.com/thombashi/pathvalidate/issues/26) (Thanks to [@virlos](https://github.com/virlos))
- Fix type model: [#29](https://github.com/thombashi/pathvalidate/issues/29) (Thanks to [@rogalski](https://github.com/rogalski))
- Fix sanitizing of filenames that only consist of whitespaces and periods
- Add `validate_unprintable_char` function
- Add `validate_after_sanitize` keyword argument to `sanitize_filename` and `sanitize_filepath` functions
- Add error codes to `ErrorReason`
- Add `zip_safe=False` to `setup`
- Modify to accept `pathvalidate.Platform` type as `platform` arguments
- Rename type alias from `Handler` to `NullValueHandler`
- Remove `InvalidLengthError` to use `ValidationError`
- Improve type annotations
- Make it possible to import `FileNameValidator` and `FilePathValidator` classes from the package root
- Change constructor arguments of `FileNameSanitizer` and `FilePathSanitizer` classes
- Remove `min_len`
- Add `validator`
- Remove deprecated functions
- Modify error messages
- Refactoring
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v2.5.2...v3.0.0
[Changes][v3.0.0]
# [v2.5.2](https://github.com/thombashi/pathvalidate/releases/tag/v2.5.2) - 2022-08-20
- Add support for Python 3.11: [#22](https://github.com/thombashi/pathvalidate/issues/22) (Thanks to [@hegjon](https://github.com/hegjon))
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v2.5.1...v2.5.2
[Changes][v2.5.2]
# [v2.5.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.5.1) - 2022-07-31
## What's Changed
* Add `__all__` by [@eggplants](https://github.com/eggplants) in [#24](https://github.com/thombashi/pathvalidate/pull/24)
* Add `DeprecationWarning` to deprecated functions
## New Contributors
* [@eggplants](https://github.com/eggplants) made their first contribution in [#24](https://github.com/thombashi/pathvalidate/pull/24)
**Full Changelog**: https://github.com/thombashi/pathvalidate/compare/v2.5.0...v2.5.1
[Changes][v2.5.1]
# [v2.5.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.5.0) - 2021-09-26
- Add support for Python 3.10
- Drop support for Python 3.5
- Add `null_value_handler` argument to `sanitize_filename`/`sanitize_filepath` functions: [#20](https://github.com/thombashi/pathvalidate/issues/20) (Thanks to @
mkbloke)
- Add `AbstractSanitizer`/`AbstractValidator` classes to import path
- Add `replace_ansi_escape` function
- Add `setup-ci` target to `Makefile`
- Modify `min_len`/`max_len` to use default values when assigned minus values
[Changes][v2.5.0]
# [v2.4.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.4.1) - 2021-04-03
- Fix filename validations that include `'\'` (backslash) on other than Windows: [#18](https://github.com/thombashi/pathvalidate/issues/18) (Thanks to [@Traktormaster](https://github.com/Traktormaster))
[Changes][v2.4.1]
# [v2.4.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.4.0) - 2021-03-21
- Add `exclude_symbols` argument to `replace_symbol` function
- Fix permissions of files included in `sdist` package binary (Thanks to [@hegjon](https://github.com/hegjon))
[Changes][v2.4.0]
# [v2.3.2](https://github.com/thombashi/pathvalidate/releases/tag/v2.3.2) - 2021-01-03
- Fix to disallow file name/path that only white spaces for `universal` platform
[Changes][v2.3.2]
# [v2.3.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.3.1) - 2020-12-13
- Modify to accept file name/path that consists only whitespaces: [#15](https://github.com/thombashi/pathvalidate/issues/15) (Thank to [@Traktormaster](https://github.com/Traktormaster))
[Changes][v2.3.1]
# [v2.3.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.3.0) - 2020-05-03
- Change not to process for `"."`/`".."` by sanitization functions: [#13](https://github.com/thombashi/pathvalidate/issues/13) (Thanks to [@ProfElectric](https://github.com/ProfElectric))
- Change to normalize with `sanitize_filepath` in default
- Add normalize interface to `sanitize_filepath`
[Changes][v2.3.0]
# [v2.2.2](https://github.com/thombashi/pathvalidate/releases/tag/v2.2.2) - 2020-03-28
- Improve file path validation for Windows platform: [#12](https://github.com/thombashi/pathvalidate/issues/12) (Thanks to [@bschollnick](https://github.com/bschollnick))
- Fix `__str__` method
- Fix to avoid raise an exception when an absolute path includes `"."`/`".."`
- Modify an error message
- Modify raising exception from `NullNameError` to `ValidationError` of `validate_pathtype`
[Changes][v2.2.2]
# [v2.2.1](https://github.com/thombashi/pathvalidate/releases/tag/v2.2.1) - 2020-03-20
- Fix to include `py.typed` to the package
[Changes][v2.2.1]
# [v2.2.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.2.0) - 2020-02-12
- Add `POSIX` as a platform
- Add a reserved keyword for macOS
- Change platform of `validate_filepath_arg`/`sanitize_filepath_arg` to `'auto'`: [#11](https://github.com/thombashi/pathvalidate/issues/11) (Thanks to [@freelanceAndy](https://github.com/freelanceAndy))
[Changes][v2.2.0]
# [v2.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.1.0) - 2020-02-01
- Add `check_reserved` argument to validate/sanitize functions
- Add `'/'` as a reserved file path for Linux/macOS
- Suppress errors when sanitizing null values
- Fix `max_len` value check for file names
- Include type annotation information to the package
- Remove `dev` extras_require
- Bug fixes
[Changes][v2.1.0]
# [v2.0.0](https://github.com/thombashi/pathvalidate/releases/tag/v2.0.0) - 2020-01-13
- Change to be more strict validation for absolute paths
- Fix argparse validator/sanitizer failed when empty inputs
- Bug fixes
[Changes][v2.0.0]
# [v1.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v1.1.0) - 2020-01-04
- Modify validate/sanitize functions for `argparse`
- Modify validate/sanitize functions for `click`
- Update `dev` extras
[Changes][v1.1.0]
# [v1.0.0](https://github.com/thombashi/pathvalidate/releases/tag/v1.0.0) - 2020-01-03
- Drop Python 2 support
- Modify to use Python 3 functionality
- Update `extras_require`
- Bug fixes
- Remove a deprecated property
[Changes][v1.0.0]
# [v0.29.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.29.1) - 2020-01-02
- Fix file path length validation: [#10](https://github.com/thombashi/pathvalidate/issues/10) (Thanks to [@UncleGoogle](https://github.com/UncleGoogle))
- Add `.asc` files of packages to PyPI
[Changes][v0.29.1]
# [v0.29.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.29.0) - 2019-06-16
- Add filename/filepath validators for `argparse`/`click`
- Modify error messages
[Changes][v0.29.0]
# [v0.28.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.28.2) - 2019-05-18
- Fix to properly escape special chars for validation error messages: [#9](https://github.com/thombashi/pathvalidate/issues/9) (Thanks to [@UncleGoogle](https://github.com/UncleGoogle))
[Changes][v0.28.2]
# [v0.28.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.28.0) - 2019-05-01
- Drop support for Python 3.4
[Changes][v0.28.0]
# [v0.26.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.26.0) - 2019-03-15
- Add support for NTFS reserved names
- Improve drive letter handling
[Changes][v0.26.0]
# [v0.25.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.25.0) - 2019-03-14
- Add `CLOCK$` as a reserved filename for Windows platform: [#8](https://github.com/thombashi/pathvalidate/issues/8) (Thanks to [@sparr](https://github.com/sparr))
- Improve reserved name detection
- Add `reserved_name` property to `ReservedNameError` class
[Changes][v0.25.0]
# [v0.24.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.24.1) - 2019-02-12
- Fix improper error messages
- Improve error message readability
[Changes][v0.24.1]
# [v0.24.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.24.0) - 2019-02-03
- Add `is_valid_filename`/`is_valid_filepath` function
- Add `FileNameSanitizer`/`FilePathSanitizer` classes
- Add minimum length validation support
- Remove deprecated functions
[Changes][v0.24.0]
# [v0.23.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.23.0) - 2019-01-06
- Improve sanitization/validation for files
- Add `.` and `..` as reserved keywords for files
- Add limit to `max_filename_len`
- Fix platform specific sanitization: [#7](https://github.com/thombashi/pathvalidate/issues/7)
- Fix reserved keywords sanitization/validation for files
- Integrate `InvalidCharWindowsError` into `InvalidCharError`
- Change to use `ReservedNameError` instead of `InvalidReservedNameError`
- Breaking changes
- Rename a property for `FileSanitizer` from `platform_name` to `platform`
- Rename methods argument from `platform_name` to `platform`
[Changes][v0.23.0]
# [v0.22.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.22.0) - 2018-12-23
- Add universal (platform independent) filename/filepath sanitization/validation
- Treat ASCII whitespace other than normal space as invalid on Windows [#6](https://github.com/thombashi/pathvalidate/issues/6) (Thanks to [@nyuszika7h](https://github.com/nyuszika7h))
[Changes][v0.22.0]
# [v0.21.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.21.1) - 2018-07-28
- Add support for PathLike object
- Bug fixes
[Changes][v0.21.1]
# [v0.18.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.18.0) - 2018-07-07
- Add validations/sanitizations for unprintable characters
- Add support for Python 3.7
[Changes][v0.18.0]
# [v0.15.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.15.0) - 2017-03-18
- Remove package dependencies
- pathvalidate functions are expected to passing unicode strings.
[Changes][v0.15.0]
# [v0.14.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.14.0) - 2017-02-11
- Change max file name/path length to configurable
- Add support for Python 3.6
- Bug fixes
[Changes][v0.14.0]
# [v0.13.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.13.0) - 2017-01-03
- Add JavaScript validator/sanitizer
- Bug fixes
[Changes][v0.13.0]
# [v0.11.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.11.0) - 2016-12-25
- Add multibyte character validate/sanitize support
[Changes][v0.11.0]
# [v0.10.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.10.0) - 2016-12-23
- Add LTSV support
[Changes][v0.10.0]
# [v0.9.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.9.1) - 2016-11-17
- Support UTF8
[Changes][v0.9.1]
# [v0.9.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.9.0) - 2016-11-13
- Add validate_symbol function
[Changes][v0.9.0]
# [v0.8.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.8.2) - 2016-10-27
- Fix Windows path validation
- Bug fixes
[Changes][v0.8.2]
# [v0.6.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.6.0) - 2016-09-19
- Add SQLite name validation function
[Changes][v0.6.0]
# [v0.5.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.5.2) - 2016-08-20
- Fix validate/sanitize of excel sheet
- Subdividing errors
- Add file name validation for Windows reserved names and path length
[Changes][v0.5.2]
# [v0.5.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.5.1) - 2016-07-23
- Modify error handling
[Changes][v0.5.1]
# [v0.5.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.5.0) - 2016-07-17
- Drop support for Python 2.6
- Add validate_excel_sheet_name function
- Add sanitize_excel_sheet_name function
[Changes][v0.5.0]
# [v0.4.2](https://github.com/thombashi/pathvalidate/releases/tag/v0.4.2) - 2016-06-19
- Make pytest-runner a conditional requirement
[Changes][v0.4.2]
# [v0.4.1](https://github.com/thombashi/pathvalidate/releases/tag/v0.4.1) - 2016-05-29
- Modify replace_symbol function behavior
[Changes][v0.4.1]
# [v0.4.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.4.0) - 2016-05-28
- Add validate_file_path/sanitize_file_path functions
- Fix validate/sanitize filename functions
- Fix validate/sanitize python variable name functions
[Changes][v0.4.0]
# [v0.3.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.3.0) - 2016-05-22
- Add validate_python_var_name function
[Changes][v0.3.0]
# [v0.2.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.2.0) - 2016-05-21
- Add sanitize_python_var_name function
[Changes][v0.2.0]
# [v0.1.0](https://github.com/thombashi/pathvalidate/releases/tag/v0.1.0) - 2016-03-24
[Changes][v0.1.0]
[v3.2.2]: https://github.com/thombashi/pathvalidate/compare/v3.2.1...v3.2.2
[v3.2.1]: https://github.com/thombashi/pathvalidate/compare/v3.2.0...v3.2.1
[v3.2.0]: https://github.com/thombashi/pathvalidate/compare/v3.1.0...v3.2.0
[v3.1.0]: https://github.com/thombashi/pathvalidate/compare/v3.0.0...v3.1.0
[v3.0.0]: https://github.com/thombashi/pathvalidate/compare/v2.5.2...v3.0.0
[v2.5.2]: https://github.com/thombashi/pathvalidate/compare/v2.5.1...v2.5.2
[v2.5.1]: https://github.com/thombashi/pathvalidate/compare/v2.5.0...v2.5.1
[v2.5.0]: https://github.com/thombashi/pathvalidate/compare/v2.4.1...v2.5.0
[v2.4.1]: https://github.com/thombashi/pathvalidate/compare/v2.4.0...v2.4.1
[v2.4.0]: https://github.com/thombashi/pathvalidate/compare/v2.3.2...v2.4.0
[v2.3.2]: https://github.com/thombashi/pathvalidate/compare/v2.3.1...v2.3.2
[v2.3.1]: https://github.com/thombashi/pathvalidate/compare/v2.3.0...v2.3.1
[v2.3.0]: https://github.com/thombashi/pathvalidate/compare/v2.2.2...v2.3.0
[v2.2.2]: https://github.com/thombashi/pathvalidate/compare/v2.2.1...v2.2.2
[v2.2.1]: https://github.com/thombashi/pathvalidate/compare/v2.2.0...v2.2.1
[v2.2.0]: https://github.com/thombashi/pathvalidate/compare/v2.1.0...v2.2.0
[v2.1.0]: https://github.com/thombashi/pathvalidate/compare/v2.0.0...v2.1.0
[v2.0.0]: https://github.com/thombashi/pathvalidate/compare/v1.1.0...v2.0.0
[v1.1.0]: https://github.com/thombashi/pathvalidate/compare/v1.0.0...v1.1.0
[v1.0.0]: https://github.com/thombashi/pathvalidate/compare/v0.29.1...v1.0.0
[v0.29.1]: https://github.com/thombashi/pathvalidate/compare/v0.29.0...v0.29.1
[v0.29.0]: https://github.com/thombashi/pathvalidate/compare/v0.28.2...v0.29.0
[v0.28.2]: https://github.com/thombashi/pathvalidate/compare/v0.28.0...v0.28.2
[v0.28.0]: https://github.com/thombashi/pathvalidate/compare/v0.26.0...v0.28.0
[v0.26.0]: https://github.com/thombashi/pathvalidate/compare/v0.25.0...v0.26.0
[v0.25.0]: https://github.com/thombashi/pathvalidate/compare/v0.24.1...v0.25.0
[v0.24.1]: https://github.com/thombashi/pathvalidate/compare/v0.24.0...v0.24.1
[v0.24.0]: https://github.com/thombashi/pathvalidate/compare/v0.23.0...v0.24.0
[v0.23.0]: https://github.com/thombashi/pathvalidate/compare/v0.22.0...v0.23.0
[v0.22.0]: https://github.com/thombashi/pathvalidate/compare/v0.21.1...v0.22.0
[v0.21.1]: https://github.com/thombashi/pathvalidate/compare/v0.18.0...v0.21.1
[v0.18.0]: https://github.com/thombashi/pathvalidate/compare/v0.15.0...v0.18.0
[v0.15.0]: https://github.com/thombashi/pathvalidate/compare/v0.14.0...v0.15.0
[v0.14.0]: https://github.com/thombashi/pathvalidate/compare/v0.13.0...v0.14.0
[v0.13.0]: https://github.com/thombashi/pathvalidate/compare/v0.11.0...v0.13.0
[v0.11.0]: https://github.com/thombashi/pathvalidate/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/thombashi/pathvalidate/compare/v0.9.1...v0.10.0
[v0.9.1]: https://github.com/thombashi/pathvalidate/compare/v0.9.0...v0.9.1
[v0.9.0]: https://github.com/thombashi/pathvalidate/compare/v0.8.2...v0.9.0
[v0.8.2]: https://github.com/thombashi/pathvalidate/compare/v0.6.0...v0.8.2
[v0.6.0]: https://github.com/thombashi/pathvalidate/compare/v0.5.2...v0.6.0
[v0.5.2]: https://github.com/thombashi/pathvalidate/compare/v0.5.1...v0.5.2
[v0.5.1]: https://github.com/thombashi/pathvalidate/compare/v0.5.0...v0.5.1
[v0.5.0]: https://github.com/thombashi/pathvalidate/compare/v0.4.2...v0.5.0
[v0.4.2]: https://github.com/thombashi/pathvalidate/compare/v0.4.1...v0.4.2
[v0.4.1]: https://github.com/thombashi/pathvalidate/compare/v0.4.0...v0.4.1
[v0.4.0]: https://github.com/thombashi/pathvalidate/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/thombashi/pathvalidate/compare/v0.2.0...v0.3.0
[v0.2.0]: https://github.com/thombashi/pathvalidate/compare/v0.1.0...v0.2.0
[v0.1.0]: https://github.com/thombashi/pathvalidate/tree/v0.1.0
pathvalidate-3.2.3/docs/pages/changelog_ref.rst 0000664 0000000 0000000 00000000223 14735767125 0021547 0 ustar 00root root 0000000 0000000 Changelog
==================
`Reference `__
.. literalinclude:: CHANGELOG.md
pathvalidate-3.2.3/docs/pages/examples/ 0000775 0000000 0000000 00000000000 14735767125 0020053 5 ustar 00root root 0000000 0000000 pathvalidate-3.2.3/docs/pages/examples/argparse.rst 0000664 0000000 0000000 00000000415 14735767125 0022411 0 ustar 00root root 0000000 0000000 filename/filepath validator for argparse
--------------------------------------------------------
.. include:: argparse_validator.txt
filename/filepath sanitizer for argparse
--------------------------------------------------------
.. include:: argparse_sanitizer.txt
pathvalidate-3.2.3/docs/pages/examples/argparse_sanitizer.txt 0000664 0000000 0000000 00000001360 14735767125 0024510 0 ustar 00root root 0000000 0000000 :Sample Code:
.. code-block:: python
from argparse import ArgumentParser
from pathvalidate.argparse import sanitize_filename_arg, sanitize_filepath_arg
parser = ArgumentParser()
parser.add_argument("--filename", type=sanitize_filename_arg)
parser.add_argument("--filepath", type=sanitize_filepath_arg)
options = parser.parse_args()
if options.filename:
print("filename: {}".format(options.filename))
if options.filepath:
print("filepath: {}".format(options.filepath))
:Output:
.. code-block:: none
$ ./examples/argparse_sanitize.py --filename e/g
filename: eg
.. note::
``sanitize_filepath_arg`` is set platform as ``"auto"``.
pathvalidate-3.2.3/docs/pages/examples/argparse_validator.txt 0000664 0000000 0000000 00000002046 14735767125 0024467 0 ustar 00root root 0000000 0000000 :Sample Code:
.. code-block:: python
from argparse import ArgumentParser
from pathvalidate.argparse import validate_filename_arg, validate_filepath_arg
parser = ArgumentParser()
parser.add_argument("--filename", type=validate_filename_arg)
parser.add_argument("--filepath", type=validate_filepath_arg)
options = parser.parse_args()
if options.filename:
print(f"filename: {options.filename}")
if options.filepath:
print(f"filepath: {options.filepath}")
:Output:
.. code-block:: none
$ ./examples/argparse_validate.py --filename eg
filename: eg
$ ./examples/argparse_validate.py --filename e?g
usage: argparse_validate.py [-h] [--filename FILENAME] [--filepath FILEPATH]
argparse_validate.py: error: argument --filename: [PV1100] invalid characters found: invalids=(':'), value='e:g', platform=Windows
.. note::
``validate_filepath_arg`` consider ``platform`` as of ``"auto"`` if the input is an absolute file path.
pathvalidate-3.2.3/docs/pages/examples/click.rst 0000664 0000000 0000000 00000000412 14735767125 0021667 0 ustar 00root root 0000000 0000000 filename/filepath validator for ``click``
--------------------------------------------------------
.. include:: click_validator.txt
filename/filepath sanitizer for ``click``
--------------------------------------------------------
.. include:: click_sanitizer.txt
pathvalidate-3.2.3/docs/pages/examples/click_sanitizer.txt 0000664 0000000 0000000 00000001234 14735767125 0023771 0 ustar 00root root 0000000 0000000 :Sample Code:
.. code-block:: python
import click
from pathvalidate.click import sanitize_filename_arg, sanitize_filepath_arg
@click.command()
@click.option("--filename", callback=sanitize_filename_arg)
@click.option("--filepath", callback=sanitize_filepath_arg)
def cli(filename, filepath):
if filename:
click.echo(f"filename: {filename}")
if filepath:
click.echo(f"filepath: {filepath}")
if __name__ == "__main__":
cli()
:Output:
.. code-block:: none
$ ./examples/click_sanitize.py --filename a/b
filename: ab
pathvalidate-3.2.3/docs/pages/examples/click_validator.txt 0000664 0000000 0000000 00000001700 14735767125 0023744 0 ustar 00root root 0000000 0000000 :Sample Code:
.. code-block:: python
import click
from pathvalidate.click import validate_filename_arg, validate_filepath_arg
@click.command()
@click.option("--filename", callback=validate_filename_arg)
@click.option("--filepath", callback=validate_filepath_arg)
def cli(filename: str, filepath: str) -> None:
if filename:
click.echo(f"filename: {filename}")
if filepath:
click.echo(f"filepath: {filepath}")
if __name__ == "__main__":
cli()
:Output:
.. code-block:: none
$ ./examples/click_validate.py --filename ab
filename: ab
$ ./examples/click_validate.py --filepath e?g
Usage: click_validate.py [OPTIONS]
Try 'click_validate.py --help' for help.
Error: Invalid value for '--filename': [PV1100] invalid characters found: invalids=('?'), value='e?g', platform=Windows
pathvalidate-3.2.3/docs/pages/examples/index.rst 0000664 0000000 0000000 00000000152 14735767125 0021712 0 ustar 00root root 0000000 0000000 Examples
========
.. toctree::
:maxdepth: 3
sanitize
validate
is_valid
argparse
click
pathvalidate-3.2.3/docs/pages/examples/is_valid.rst 0000664 0000000 0000000 00000000703 14735767125 0022377 0 ustar 00root root 0000000 0000000 .. _example-is-valid-filename:
Check a filename
----------------------------
:py:func:`.is_valid_filename()` function returns |True| if a filename is valid for a specified platform.
.. include:: is_valid_filename_code.txt
.. _example-is-valid-filepath:
Check a filepath
----------------------------
:py:func:`.is_valid_filepath()` function returns |True| if a filepath is valid for a specified platform.
.. include:: is_valid_filepath_code.txt
pathvalidate-3.2.3/docs/pages/examples/is_valid_filename_code.txt 0000664 0000000 0000000 00000001041 14735767125 0025234 0 ustar 00root root 0000000 0000000 :Sample Code:
.. code-block:: python
from pathvalidate import is_valid_filename, sanitize_filename
fname = "fi:l*e/p\"a?t>h|.th|.t