{ "info": { "author": "Laurent Peuch", "author_email": "cortex@worlddomination.be", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: IPython", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Text Processing :: Markup :: SGML", "Topic :: Text Processing :: Markup :: XML" ], "description": "IPython-BeautifulSoup\n=====================\n.. image:: https://travis-ci.org/Psycojoker/ipython-beautifulsoup.svg?branch=master\n :target: https://travis-ci.org/Psycojoker/ipython-beautifulsoup\n \nIPython-BeautifulSoup is an IPython extension for displaying\nBeautifulSoup HTML/XML objects as prettified and syntax highlighted HTML\nblocks in IPython notebook and qtconsole.\n\nSyntax highlighting is accomplished with\n`Pygments `__.\n\n|teaser|\n\nInstall\n=======\n\nSimply run:\n\n::\n\n pip install \"ipython-beautifulsoup[bs4]\"\n\n\nInstalling IPython Notebook\n---------------------------\n\nSee the `IPython installation\ndocs `__ for\ndetails.\n\nTo install IPython notebook or qtconsole as well, append ``notebook``\nand/or ``qtconsole`` to the extras specifier after \"bs4\" separated by a\n\",\", like this:\n\n::\n\n pip install \"ipython-beautifulsoup[bs4,notebook,qtconsole]\"\n\nOn Ubuntu LTS, if you want to install **IPython notebook**, you'll need\nto do this before:\n\n::\n\n sudo apt-get install python-dev g++\n\n(use ``python3-dev`` if you're using Python 3)\n\nFor the **qtconsole** do this (if you do this in a virtualenv) (WARNING:\nit's slow):\n\n::\n\n sudo apt-get install make cmake qt4-qmake libqt4-dev\n pip install pyside\n\nUsage\n=====\n\nIn IPython notebook or qtconsole, run:\n\n.. code:: python\n\n %load_ext soup\n\nThis will push a series of callables into your current context, as well\nas a monkey-patched ``BeautifulSoup`` and ``requests``.\n\nYou can now use BeautifulSoup like you would if it was imported from the\ncorresponding module.\n\nThere is great chances that you'll want to configure the output by using\n``configure_ipython_beautifulsoup``, for example like this (just after\nthe ``%load_ext``):\n\n::\n\n configure_ipython_beautifulsoup(show_html=True, show_css=True, show_js=False)\n\nTo see ``configure_ipython_beautifulsoup`` documentation just do (in any\ninterface of IPython):\n\n::\n\n configure_ipython_beautifulsoup?\n\nThis also loads a shortcut function called ``p`` (for Parse) defined as\nfollows:\n\n.. code:: python\n\n def p(url):\n if requests is not None:\n return BeautifulSoup(requests.get(url).contents)\n return BeautifulSoup(urlopen(url).read())\n\nA note on security\n==================\n\n **WARNING**\n\n By nature of including external HTML, JS, and CSS, this extension is\n inherently unsafe if you choose to render the html by setting\n show\\_html to True when calling\n **``configure_ipython_beautifulsoup``**.\n\n By default, ``