{ "info": { "author": "Pili Hu", "author_email": "me@hupili.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: Public Domain", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Topic :: Internet" ], "description": "pquery\n======\n\ngrep for HTML; CLI for pyquery\n\n## Demo\n\n```\n$curl -s https://github.com/hupili/pquery | pquery '.content a' -p text\n.gitignore\nLICENSE\nMANIFEST.in\nREADME.md\npquery\nsetup.py\n```\n\n`pquery` is intended to integrate into your UNIX pipeline.\n\n## Install\n\n`pip install pquery`\n\n## Syntax\n\n```\nUsage:\n pquery \n pquery -p \n pquery -f \n pquery -h | --help\n\nOptions:\n -p: project the dict onto field ``.\n -f: equivalent of `.format(item)`,\n where item is the dict form of one selected HTML element.\n -h | -v: shows this doc.\n\nDict keys:\n 'tag': The HTML tag\n 'html': Inner HTML of the element\n 'text': Inner text of the element\n ...: [optional] Other attributes: e.g. 'href'\n```\n\n## Why\n\n`grep` is powerful for **lines**.\nHTML is structured and not line processor friendly.\nCSS selector is a natural grep for HTML.\nThis script simply wraps [pyquery](http://pyquery.readthedocs.org/en/latest/) to provide a CLI.\n\n## Example 1\n\nA [course webpage](https://class.coursera.org/crypto-008/wiki/LectureSlidesPublicCourse)\nlists slides in `pdf` and `pptx`.\nWant to download all the PDFs.\nThis saves you some click.\n\n```\nwget --load-cookies=cookies.txt -O- 'https://class.coursera.org/crypto-008/wiki/LectureSlidesPublicCourse' | pquery a -p href | grep pdf | xargs -P 5 -I{} wget {}\n```\n\nIt's tedious to directly grep the PDF links out from HTML.\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hupili/pquery", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pquery", "package_url": "https://pypi.org/project/pquery/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pquery/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hupili/pquery" }, "release_url": "https://pypi.org/project/pquery/1.4/", "requires_dist": null, "requires_python": null, "summary": "grep for HTML; CLI for pyquery", "version": "1.4" }, "last_serial": 1739477, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "47739bed179a145bfc09b8b487944065", "sha256": "b8e25a8d9e9809874ccb663954b6935592b5047fc7b4aa36b4c4397833263b54" }, "downloads": -1, "filename": "pquery-1.0.tar.gz", "has_sig": false, "md5_digest": "47739bed179a145bfc09b8b487944065", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2204, "upload_time": "2014-01-17T12:55:55", "url": "https://files.pythonhosted.org/packages/08/bb/eb2c51e1d968eeee3b42fda8a9902abedad59327651cf9e14a47c2b0eb89/pquery-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "64f3a40fe1e769abd6ab635cf15c30e8", "sha256": "1136160d6b70bdc76d43512f4ca4302def3f0829d5dea1f72f6221ce1c2ef204" }, "downloads": -1, "filename": "pquery-1.1.tar.gz", "has_sig": false, "md5_digest": "64f3a40fe1e769abd6ab635cf15c30e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2920, "upload_time": "2015-09-17T05:25:08", "url": "https://files.pythonhosted.org/packages/0b/80/cf1e414569de5c489a961133da2412d3d698e8b47d05866132050ae29072/pquery-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "32f3b065cccc7279c24891252d2a7043", "sha256": "25f4feffed23ffee95d2e56f3e70a5e437f0c9b11c65cd1f1b4e9555e993cae3" }, "downloads": -1, "filename": "pquery-1.2.tar.gz", "has_sig": false, "md5_digest": "32f3b065cccc7279c24891252d2a7043", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3075, "upload_time": "2015-09-23T15:31:56", "url": "https://files.pythonhosted.org/packages/98/fc/60f60add3db6e1027ee75106ca5c5ceb0cabeb6a47d532e94f11ca9857a1/pquery-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "256f4bca9a693059018821d85870574a", "sha256": "3658036d403821b1a1ddde71011f5d323018eb848e1f2c97dc4c5a6818b9c5bc" }, "downloads": -1, "filename": "pquery-1.3.tar.gz", "has_sig": false, "md5_digest": "256f4bca9a693059018821d85870574a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3075, "upload_time": "2015-09-23T15:32:57", "url": "https://files.pythonhosted.org/packages/f8/96/7065305527658342141cd54adb578573825110f8dd2023d5d949129c74f5/pquery-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "f48d132103b51ebc3fc036fc1259d239", "sha256": "ea8be57d7064c2c7331c4ccc35d6defd45b6028afc7d122c5a93c0ee3890ae7e" }, "downloads": -1, "filename": "pquery-1.4.tar.gz", "has_sig": false, "md5_digest": "f48d132103b51ebc3fc036fc1259d239", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3072, "upload_time": "2015-09-26T05:07:06", "url": "https://files.pythonhosted.org/packages/e4/f1/7566c10c8f4aefe62dd0d6ec1618c92fff833948eee7154e722e91aa0c0c/pquery-1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f48d132103b51ebc3fc036fc1259d239", "sha256": "ea8be57d7064c2c7331c4ccc35d6defd45b6028afc7d122c5a93c0ee3890ae7e" }, "downloads": -1, "filename": "pquery-1.4.tar.gz", "has_sig": false, "md5_digest": "f48d132103b51ebc3fc036fc1259d239", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3072, "upload_time": "2015-09-26T05:07:06", "url": "https://files.pythonhosted.org/packages/e4/f1/7566c10c8f4aefe62dd0d6ec1618c92fff833948eee7154e722e91aa0c0c/pquery-1.4.tar.gz" } ] }