Click Pathlib
A Python click type which is similar to click.Path but returns a Pathlib.Path.
Installation
$ pip install click-pathlib
This supports Python 3.8+.
Usage
Use the click_pathlib.Path just like a click.Path type and your function will receive a pathlib.Path.
import click
import click_pathlib
@click.command('delete')
@click.argument(
'existing_file',
type=click_pathlib.Path(exists=True),
)
def delete(existing_file):
existing_file.unlink()
Credits
Thanks to @jeremyh for describing this solution on GitHub at https://github.com/pallets/click/issues/405#issuecomment-470812067.
Contributing
See CONTRIBUTING.rst.
Metadata
Release files for click-pathlib 2020.3.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| click-pathlib-2020.3.13.0.tar.gz | 15.6 kB | Without provenance | Details for click-pathlib-2020.3.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| click_pathlib-2020.3.13.0-py3-none-any.whl | Python 3 | none | any | Details for click_pathlib-2020.3.13.0-py3-none-any.whl |
Total release size: 19.3 kB
Release files / click-pathlib-2020.3.13.0.tar.gz
| Download URL | click-pathlib-2020.3.13.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e74a7a209699107d6aa884b3070e1f81e67dea10acf2244fbd3a4eafad207c1c
|
|
BLAKE2b-256 checksum How to use checksums |
38fe0ed987a20b4b691b315b04b6a7ea58f0f5a052791b25be024da96d0519b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
|
Release files / click_pathlib-2020.3.13.0-py3-none-any.whl
| Download URL | click_pathlib-2020.3.13.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37faab20677ce754176378cd9be82fd9e7e28b5d5fa4f1cc89613cb6b9fe9d97
|
|
BLAKE2b-256 checksum How to use checksums |
45930e132a0e8224780ef0586aa3b085252e0b95e54998d6c71dd71ab69d54f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
|
Security for click-pathlib 2020.3.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.