{ "info": { "author": "granitosaurus", "author_email": "bernardas.alisauskas@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Internet" ], "description": "\n# About parselcli ![PyPI](https://img.shields.io/pypi/v/parselcli.svg?style=popout)\n\n`parselcli` is a command line interface wrapper for [parsel](https://github.com/scrapy/parsel) package for evaluating css and xpath selection real time against web urls or local html files. \n> Parsel is a library to extract data from HTML and XML using XPath and CSS selectors\n\n[![asciicast](https://asciinema.org/a/234118.svg)](https://asciinema.org/a/234118)\n\n#### Features:\n\n* Supports css and xpath expression.\n* Interactive shell with autocomplete.\n* Css and xpath hints based on current webpage DOM.\n* Full input history.\n* Cache support for repeated usage.\n* Extensive and instant text processing via text processor flags.\n\n## Usage\n\n $ parsel --help \n Usage: parsel [OPTIONS] [URL]\n\n Interactive shell for css and xpath selectors\n\n Options:\n -h TEXT request headers, e.g. -h \"user-agent=cat\n bot\"\n -xpath start in xpath mode instead of css\n -p, --processors TEXT comma separated processors: {}\n -f, --file FILENAME input from html file instead of url\n -c TEXT compile css and return it\n -x TEXT compile xpath and return it\n --cache cache requests\n --config TEXT config file [default:\n /home/dex/.config/parsel.toml]\n --embed start in embedded python shell\n --shell [ptpython|ipython|bpython|python]\n preferred embedded shell; default auto\n resolve in order\n --help Show this message and exit.\n\n\n`parselcli` reads XML or HTML file from url or disk and starts interpreter for xpath or css selectors.\nBy default it starts in css interpreter mode but can be switched to xpath by `-xpath` command and switched back with `-css`.\nInterpreter also has auto complete and suggestions for selectors \\[in progress\\]\n\nThe interpreter also supports commands and embedding of `python`, `ptpython`, `ipython` and `bpython` shells.\nCommand can be called with `-` prefix. List of available commands can be found by calling `-help` command (see Example section).\n\n### Processors and Commands\n\n`parsecli` supports flags and commands in shell: \n\n $ parsel \"https://github.com/granitosaurus/parsel-cli\" \n > -help \n available commands (use -command):\n help: show help\n debug: show debug info\n embed: start interactive python shell\n open: open current url in browser tab\n view: open current html in browser tab\n fetch: download from new url\n css: switch to css selectors\n xpath: switch to xpath selectors\n available flags (use +flag to enable and -flag to disable)\n strip: strip every element of trailing and leading spaces\n first: take first element when there's only one\n collapse: collapse lists when only 1 element\n absolute: convert relative urls to absolute\n join: join results into one\n len: return length of results\n\n\nProcessors can be activated with `+` prefix and deactivated with `-`. These processors can be supplied inline:\n\n > h1::text +strip\n ['parsel-cli']\n\n\nor activated for whole session\n\n > +strip \n enabled flag: strip\n\nCommands are just called as is with sometimes taking a positional argument:\n\n > -fetch \"http://some-other-url.com\"\n downloading \"http://some-other-url.com\"\n > -view\n opening document in browser\n\n## Example\n\n $ parsel \"https://github.com/granitosaurus/parsel-cli\" \n > h1::text \n ['\\n ', '\\n ', '\\n\\n', 'parsel-cli']\n > +join +strip \n enabled flag: join\n enabled flag: strip\n > h1::text \n parsel-cli\n > h1::text +len \n 4\n > -xpath \n switched to xpath\n > //h1/text() \n parsel-cli\n > -css \n switched to css\n > -embed \n >>> locals() \n {'sel': , 'response': , 'request': , '_': {...}, '_1': {...}}\n\n\n >>> response \n \n\n\n >>> \n > -debug \n 200-https://github.com/granitosaurus/parsel-cli\n enabled processors:\n Join\n Strip\n > -help \n available commands (use -command):\n help: show help\n debug: show debug info\n embed: start interactive python shell\n open: open current url in browser tab\n view: open current html in browser tab\n fetch: download from new url\n css: switch to css selectors\n xpath: switch to xpath selectors\n available flags (use +flag to enable and -flag to disable)\n strip: strip every element of trailing and leading spaces\n first: take first element when there's only one\n collapse: collapse lists when only 1 element\n absolute: convert relative urls to absolute\n join: join results into one\n len: return length of results\n\n\n## Install\n\n pip install parselcli\n\nor install from github:\n\n pip install --user git+https://github.com/Granitosaurus/parsel-cli@v0.33\n\n## Config\n\n`parselcli` can be configured via `toml` configuration file found in `$XDG_HOME/parsel.toml` (usually `~/.config/parsel.toml`):\n\n # default processors (the +flags)\n processors = [ \"collapse\", \"strip\",]\n # where ptpython history is located\n history_file_css = \"/home/user/.cache/parsel/history_css\"\n history_file_xpath = \"/home/user/.cache/parsel/history_xpath\"\n history_file_embed = \"/home/user/.cache/parsel/history_embed\"\n\n [requests]\n # when using --cache flag for using cached responses\n cache_expire = 86400\n # where sqlite cache file is stored for cache\n cache_dir = \"/home/user/.cache/parsel/requests.cache\"\n\n [requests.headers]\n # here headers can be defined for requests to avoid bot detection etc.\n User-Agent = \"parselcli web inspector\"\n # e.g. chrome on windows use\n # User-Agent = \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36\"\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/granitosaurus/parsel-cli", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "parselcli", "package_url": "https://pypi.org/project/parselcli/", "platform": "", "project_url": "https://pypi.org/project/parselcli/", "project_urls": { "Homepage": "https://github.com/granitosaurus/parsel-cli" }, "release_url": "https://pypi.org/project/parselcli/0.33.1/", "requires_dist": [ "toml", "click", "parsel", "ptpython", "requests-cache", "brotli" ], "requires_python": "", "summary": "CLI interpreter for xpath and css selectors", "version": "0.33.1" }, "last_serial": 5894752, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "398461321913ac49c7594bc4474635f5", "sha256": "c5cc752e42cb0be35b2fa722ab0242cdc5042a038ae73e8e897880ca9b1d7cc1" }, "downloads": -1, "filename": "parselcli-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "398461321913ac49c7594bc4474635f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12052, "upload_time": "2019-03-16T16:00:18", "url": "https://files.pythonhosted.org/packages/c1/38/5361366a4ebe7d8b272f7fb0a661fc1f314ec46a0078480b3dd9da5c3130/parselcli-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d55462ce72c286c74a4190b76bb6c043", "sha256": "d1092264fcd38cebd5efef8d7b8d852cc0a3d7a387106c48ef56cb3e250c90df" }, "downloads": -1, "filename": "parselcli-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d55462ce72c286c74a4190b76bb6c043", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10252, "upload_time": "2019-03-16T16:00:21", "url": "https://files.pythonhosted.org/packages/ea/8d/df1c95bf525eee61ea0b62c58a7d48134e1192579ae7b6e729b104c865a8/parselcli-0.3.0.tar.gz" } ], "0.31.0": [ { "comment_text": "", "digests": { "md5": "b4b8a8b5d8a1eb7fbd9cd5ca58e25192", "sha256": "71b2e6f9fb3cda046cadae45249f3e3f8409d955c46cb71a06d2eb23c517c3d7" }, "downloads": -1, "filename": "parselcli-0.31.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b4b8a8b5d8a1eb7fbd9cd5ca58e25192", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13022, "upload_time": "2019-03-24T07:02:29", "url": "https://files.pythonhosted.org/packages/ca/39/10ffb2a542c00504a44ac6b18d306e2c7a530e8de502d6ecb6f052139a9e/parselcli-0.31.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "753d385f51c91205f163a3ad2997dac6", "sha256": "4faa7c5635617e3236d6b4e8f0d983227cacabd585e39600932d105d92d54e57" }, "downloads": -1, "filename": "parselcli-0.31.0.tar.gz", "has_sig": false, "md5_digest": "753d385f51c91205f163a3ad2997dac6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11411, "upload_time": "2019-03-24T07:02:31", "url": "https://files.pythonhosted.org/packages/c6/0f/aa9a38f31095ee8baeb54359f30a498d8228abb69fc5983575c2c4b75468/parselcli-0.31.0.tar.gz" } ], "0.32.0": [ { "comment_text": "", "digests": { "md5": "5b79ba7dd801c4a1afd923a34b6a0fc5", "sha256": "3b82fce21dc094e1d7549d6b2d6f8e6e0e62899a033c8806450920bc64c3dd08" }, "downloads": -1, "filename": "parselcli-0.32.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5b79ba7dd801c4a1afd923a34b6a0fc5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13127, "upload_time": "2019-04-05T03:42:09", "url": "https://files.pythonhosted.org/packages/bc/fd/17ab1279f508739e8c7086bee3beffcc694d83a1a41bf77da6586cb388a8/parselcli-0.32.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e543fe0e127caa9891d89abefd64e4a0", "sha256": "99a279910dfc9451dccdb0cfad377505037aef2b1e0d336afbb598fb118a5636" }, "downloads": -1, "filename": "parselcli-0.32.0.tar.gz", "has_sig": false, "md5_digest": "e543fe0e127caa9891d89abefd64e4a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11503, "upload_time": "2019-04-05T03:42:12", "url": "https://files.pythonhosted.org/packages/75/ea/ca1ba2ed9cf9dcd645047f2ef5a4996232cea6a83b670dfc268e0dd2fbbf/parselcli-0.32.0.tar.gz" } ], "0.32.1": [ { "comment_text": "", "digests": { "md5": "914317f0e621814f77fa1617a4c5f7c5", "sha256": "23897fba244eeb0657a696e0be659339543bac1e6e888e61684b692dc0ec4237" }, "downloads": -1, "filename": "parselcli-0.32.1-py3-none-any.whl", "has_sig": false, "md5_digest": "914317f0e621814f77fa1617a4c5f7c5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13131, "upload_time": "2019-04-05T03:44:45", "url": "https://files.pythonhosted.org/packages/3a/7d/1947494d4f98dd0ee6974894365ac38a5326835cc0f6e94d1b50492c641a/parselcli-0.32.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "204934b7948fe5620da7ceaaef4ffd3a", "sha256": "49c5ee5ba1c881f6a8e58f5bdf1ec76075ed861e9f1591e3a17439721737f09c" }, "downloads": -1, "filename": "parselcli-0.32.1.tar.gz", "has_sig": false, "md5_digest": "204934b7948fe5620da7ceaaef4ffd3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11509, "upload_time": "2019-04-05T03:44:50", "url": "https://files.pythonhosted.org/packages/3c/61/a64298e934edc85669b257e331fa4c8234426325eafc75c53bc2504c0278/parselcli-0.32.1.tar.gz" } ], "0.33": [ { "comment_text": "", "digests": { "md5": "870fb41c79d2a39905f9cf735cb7bad3", "sha256": "90fca2d795ede4db9e7bc3f9ff46b0b0537b4a880d2fd8f2d4e596eb763f85ac" }, "downloads": -1, "filename": "parselcli-0.33-py3-none-any.whl", "has_sig": false, "md5_digest": "870fb41c79d2a39905f9cf735cb7bad3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13723, "upload_time": "2019-05-01T11:36:43", "url": "https://files.pythonhosted.org/packages/52/f2/b50255e7f4fc83f28afd67670fe206cf781913dcda083ef3067edd4230a4/parselcli-0.33-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd972a2d6912b545463d11c4f9445bb7", "sha256": "2ee2478afa72ef703fa0cc3022be488ac8e9e857675a5a72e9139c193bb83d4b" }, "downloads": -1, "filename": "parselcli-0.33.tar.gz", "has_sig": false, "md5_digest": "cd972a2d6912b545463d11c4f9445bb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12066, "upload_time": "2019-05-01T11:36:48", "url": "https://files.pythonhosted.org/packages/26/c0/e4efc2352e59add81030ac98d5588ffc58acb8a6fadb38b6ecc85bb99dfa/parselcli-0.33.tar.gz" } ], "0.33.1": [ { "comment_text": "", "digests": { "md5": "546a7b639fbe693fdec3e7c8892c88d3", "sha256": "4cedec21ddf6fe3c3648f49d3da6a1ca649957c6854bce37f4cf972ae176cdf6" }, "downloads": -1, "filename": "parselcli-0.33.1-py3-none-any.whl", "has_sig": false, "md5_digest": "546a7b639fbe693fdec3e7c8892c88d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25328, "upload_time": "2019-09-27T07:48:15", "url": "https://files.pythonhosted.org/packages/3b/aa/f8cade9a983cf045fd15827d8c1a9512f86f73009862166d6ce3b4cce781/parselcli-0.33.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d522efe538f334d8741d05270848502", "sha256": "0d763084aaaf6fa38c795d323c0187fa0194ec8a05d4ec65160a89075b51074b" }, "downloads": -1, "filename": "parselcli-0.33.1.tar.gz", "has_sig": false, "md5_digest": "1d522efe538f334d8741d05270848502", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12419, "upload_time": "2019-09-27T07:48:17", "url": "https://files.pythonhosted.org/packages/4e/0a/a5337e2c253b89ead3522ffd03edcd5d81ac6c1a6725164ac96bf9f74efc/parselcli-0.33.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "546a7b639fbe693fdec3e7c8892c88d3", "sha256": "4cedec21ddf6fe3c3648f49d3da6a1ca649957c6854bce37f4cf972ae176cdf6" }, "downloads": -1, "filename": "parselcli-0.33.1-py3-none-any.whl", "has_sig": false, "md5_digest": "546a7b639fbe693fdec3e7c8892c88d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25328, "upload_time": "2019-09-27T07:48:15", "url": "https://files.pythonhosted.org/packages/3b/aa/f8cade9a983cf045fd15827d8c1a9512f86f73009862166d6ce3b4cce781/parselcli-0.33.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d522efe538f334d8741d05270848502", "sha256": "0d763084aaaf6fa38c795d323c0187fa0194ec8a05d4ec65160a89075b51074b" }, "downloads": -1, "filename": "parselcli-0.33.1.tar.gz", "has_sig": false, "md5_digest": "1d522efe538f334d8741d05270848502", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12419, "upload_time": "2019-09-27T07:48:17", "url": "https://files.pythonhosted.org/packages/4e/0a/a5337e2c253b89ead3522ffd03edcd5d81ac6c1a6725164ac96bf9f74efc/parselcli-0.33.1.tar.gz" } ] }