click-pathlib-2020.3.13.0
توضیحات
'A Python click type which is similar to click.Path but returns a pathlib Path'
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX |
| نام فایل | click-pathlib-2020.3.13.0 |
| نام | click-pathlib |
| نسخه کتابخانه | 2020.3.13.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Adam Dangoor |
| ایمیل نویسنده | adamdangoor@gmail.com |
| آدرس صفحه اصلی | https://github.com/adamtheturtle/click-pathlib |
| آدرس اینترنتی | https://pypi.org/project/click-pathlib/ |
| مجوز | Apache License, Version 2.0 |
|Build Status| |codecov| |PyPI|
Click Pathlib
=============
A Python ``click`` type which is similar to ``click.Path`` but returns a ``Pathlib.Path``.
.. contents::
Installation
------------
.. code:: console
$ 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``.
.. code:: python
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()
.. _click.Path: https://click.palletsprojects.com/en/7.x/api/#click.Path
Credits
-------
Thanks to `@jeremyh`_ for describing this solution on GitHub at https://github.com/pallets/click/issues/405#issuecomment-470812067.
Contributing
------------
See `CONTRIBUTING.rst <./CONTRIBUTING.rst>`_.
.. |Build Status| image:: https://travis-ci.com/adamtheturtle/click-pathlib.svg?branch=master
:target: https://travis-ci.com/adamtheturtle/click-pathlib
.. _@jeremyh: https://github.com/jeremyh
.. |codecov| image:: https://codecov.io/gh/adamtheturtle/click-pathlib/branch/master/graph/badge.svg
:target: https://codecov.io/gh/adamtheturtle/click-pathlib
.. |PyPI| image:: https://badge.fury.io/py/click-pathlib.svg
:target: https://badge.fury.io/py/click-pathlib
نیازمندی
| مقدار | نام |
|---|---|
| >=7.0 | click |
| ==1.46 | PyGithub |
| ==1.3.1 | autoflake |
| ==0.41 | check-manifest |
| ==2.0.16 | codecov |
| ==2.0.0 | flake8-commas |
| ==2.1.1 | flake8-quotes |
| ==3.7.9 | flake8 |
| ==4.3.21 | isort |
| ==0.770 | mypy |
| ==2.0.3.1 | pip-check-reqs-pip-gte-20 |
| ==5.0.2 | pydocstyle |
| ==3.0.1 | pyenchant |
| ==2.4.4 | pylint |
| ==2.6 | pyroma |
| ==2.8.1 | pytest-cov |
| ==5.4.0 | pytest |
| ==3.1.1 | twine |
| ==1.3 | vulture |
| ==0.29.0 | yapf |
نحوه نصب
نصب پکیج whl click-pathlib-2020.3.13.0:
pip install click-pathlib-2020.3.13.0.whl
نصب پکیج tar.gz click-pathlib-2020.3.13.0:
pip install click-pathlib-2020.3.13.0.tar.gz