{ "info": { "author": "Olivier Lauzanne", "author_email": "olauzanne@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "\npyquery: a jquery-like library for python\n=========================================\n\n.. image:: https://travis-ci.org/gawel/pyquery.svg\n :alt: Build Status\n :target: https://travis-ci.org/gawel/pyquery\n\npyquery allows you to make jquery queries on xml documents.\nThe API is as much as possible the similar to jquery. pyquery uses lxml for fast\nxml and html manipulation.\n\nThis is not (or at least not yet) a library to produce or interact with\njavascript code. I just liked the jquery API and I missed it in python so I\ntold myself \"Hey let's make jquery in python\". This is the result.\n\nThe `project`_ is being actively developped on a git repository on Github. I\nhave the policy of giving push access to anyone who wants it and then to review\nwhat they do. So if you want to contribute just email me.\n\nPlease report bugs on the `github\n`_ issue\ntracker.\n\n.. _deliverance: http://www.gawel.org/weblog/en/2008/12/skinning-with-pyquery-and-deliverance\n.. _project: https://github.com/gawel/pyquery/\n\nI've spent hours maintaining this software, with love.\nPlease consider tiping if you like it:\n\nBTC: 1PruQAwByDndFZ7vTeJhyWefAghaZx9RZg\n\nETH: 0xb6418036d8E06c60C4D91c17d72Df6e1e5b15CE6\n\nLTC: LY6CdZcDbxnBX9GFBJ45TqVj8NykBBqsmT\n\n\nQuickstart\n==========\n\nYou can use the PyQuery class to load an xml document from a string, a lxml\ndocument, from a file or from an url::\n\n >>> from pyquery import PyQuery as pq\n >>> from lxml import etree\n >>> import urllib\n >>> d = pq(\"\")\n >>> d = pq(etree.fromstring(\"\"))\n >>> d = pq(url=your_url)\n >>> d = pq(url=your_url,\n ... opener=lambda url, **kw: urlopen(url).read())\n >>> d = pq(filename=path_to_html_file)\n\nNow d is like the $ in jquery::\n\n >>> d(\"#hello\")\n []\n >>> p = d(\"#hello\")\n >>> print(p.html())\n Hello world !\n >>> p.html(\"you know Python rocks\")\n []\n >>> print(p.html())\n you know Python rocks\n >>> print(p.text())\n you know Python rocks\n\nYou can use some of the pseudo classes that are available in jQuery but that\nare not standard in css such as :first :last :even :odd :eq :lt :gt :checked\n:selected :file::\n\n >>> d('p:first')\n []\n\n\n\nSee http://pyquery.rtfd.org/ for the full documentation\n\nNews\n====\n\n1.4.3 (2020-11-21)\n------------------\n\n- No longer use a universal wheel\n\n\n1.4.2 (2020-11-21)\n------------------\n\n- Fix exception raised when calling `PyQuery(\"\").text()`\n\n- python2 is no longer supported\n\n1.4.1 (2019-10-26)\n------------------\n\n- This is the latest release with py2 support\n\n- Remove py33, py34 support\n\n- web scraping improvements: default timeout and session support\n\n- Add API methods to serialize form-related elements according to spec\n\n- Include HTML markup when querying textarea text/value\n\n\n1.4.0 (2018-01-11)\n------------------\n\n- Refactoring of `.text()` to match firefox behavior.\n\n\n1.3.0 (2017-10-21)\n------------------\n\n- Remove some unmaintained modules: ``pyquery.ajax`` and ``pyquery.rules``\n\n- Code cleanup. No longer use ugly hacks required by python2.6/python3.2.\n\n- Run tests with python3.6 on CI\n\n- Add a ``method`` argument to ``.outer_html()``\n\n\n1.2.17 (2016-10-14)\n-------------------\n\n- ``PyQuery('').val()`` is ``''``\n- ``PyQuery('').val()`` is ``''``\n\n\n1.2.16 (2016-10-14)\n-------------------\n\n- ``.attr('value', '')`` no longer removes the ``value`` attribute\n\n- ```` without ``value=\"...\"`` have a ``.val()`` of\n ``'on'``\n\n- ```` without ``value=\"...\"`` have a ``.val()`` of\n ``'on'``\n\n- ``