click-pathlib


Nameclick-pathlib JSON
Version 2020.3.13.0 PyPI version JSON
download
home_pagehttps://github.com/adamtheturtle/click-pathlib
Summary'A Python click type which is similar to click.Path but returns a pathlib Path'
upload_time2020-03-13 15:53:20
maintainer
docs_urlNone
authorAdam Dangoor
requires_python
licenseApache License, Version 2.0
keywords click
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |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



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/adamtheturtle/click-pathlib",
    "name": "click-pathlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "click",
    "author": "Adam Dangoor",
    "author_email": "adamdangoor@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/38/fe/0ed987a20b4b691b315b04b6a7ea58f0f5a052791b25be024da96d0519b3/click-pathlib-2020.3.13.0.tar.gz",
    "platform": "",
    "description": "|Build Status| |codecov| |PyPI|\n\nClick Pathlib\n=============\n\nA Python ``click`` type which is similar to ``click.Path`` but returns a ``Pathlib.Path``.\n\n.. contents::\n\nInstallation\n------------\n\n.. code:: console\n\n   $ pip install click-pathlib\n\nThis supports Python 3.8+.\n\nUsage\n~~~~~\n\nUse the ``click_pathlib.Path`` just like a click.Path_ type and your function will receive a ``pathlib.Path``.\n\n.. code:: python\n\n   import click\n   import click_pathlib\n\n   @click.command('delete')\n   @click.argument(\n       'existing_file',\n       type=click_pathlib.Path(exists=True),\n   )\n   def delete(existing_file):\n       existing_file.unlink()\n\n.. _click.Path: https://click.palletsprojects.com/en/7.x/api/#click.Path\n\nCredits\n-------\n\nThanks to `@jeremyh`_ for describing this solution on GitHub at https://github.com/pallets/click/issues/405#issuecomment-470812067.\n\nContributing\n------------\n\nSee `CONTRIBUTING.rst <./CONTRIBUTING.rst>`_.\n\n.. |Build Status| image:: https://travis-ci.com/adamtheturtle/click-pathlib.svg?branch=master\n   :target: https://travis-ci.com/adamtheturtle/click-pathlib\n.. _@jeremyh: https://github.com/jeremyh\n.. |codecov| image:: https://codecov.io/gh/adamtheturtle/click-pathlib/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/adamtheturtle/click-pathlib\n.. |PyPI| image:: https://badge.fury.io/py/click-pathlib.svg\n   :target: https://badge.fury.io/py/click-pathlib\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "'A Python click type which is similar to click.Path but returns a pathlib Path'",
    "version": "2020.3.13.0",
    "project_urls": {
        "Homepage": "https://github.com/adamtheturtle/click-pathlib"
    },
    "split_keywords": [
        "click"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45930e132a0e8224780ef0586aa3b085252e0b95e54998d6c71dd71ab69d54f3",
                "md5": "4806dc7bf623bad01365a80c776bf511",
                "sha256": "37faab20677ce754176378cd9be82fd9e7e28b5d5fa4f1cc89613cb6b9fe9d97"
            },
            "downloads": -1,
            "filename": "click_pathlib-2020.3.13.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4806dc7bf623bad01365a80c776bf511",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3630,
            "upload_time": "2020-03-13T15:53:18",
            "upload_time_iso_8601": "2020-03-13T15:53:18.385653Z",
            "url": "https://files.pythonhosted.org/packages/45/93/0e132a0e8224780ef0586aa3b085252e0b95e54998d6c71dd71ab69d54f3/click_pathlib-2020.3.13.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38fe0ed987a20b4b691b315b04b6a7ea58f0f5a052791b25be024da96d0519b3",
                "md5": "7cdfb9bdc1e3b6ba30cd3f31b76e8698",
                "sha256": "e74a7a209699107d6aa884b3070e1f81e67dea10acf2244fbd3a4eafad207c1c"
            },
            "downloads": -1,
            "filename": "click-pathlib-2020.3.13.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7cdfb9bdc1e3b6ba30cd3f31b76e8698",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15646,
            "upload_time": "2020-03-13T15:53:20",
            "upload_time_iso_8601": "2020-03-13T15:53:20.366780Z",
            "url": "https://files.pythonhosted.org/packages/38/fe/0ed987a20b4b691b315b04b6a7ea58f0f5a052791b25be024da96d0519b3/click-pathlib-2020.3.13.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-03-13 15:53:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adamtheturtle",
    "github_project": "click-pathlib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "click-pathlib"
}
        
Elapsed time: 1.61259s