{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Wikipedia API for Python.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyOqBVPlO7t/H/K54tPNQXu0",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
""
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Ko5a1q2y1cOl",
"colab_type": "text"
},
"source": [
"# Wikipedia API for Python\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "rCQjrE2n1drg",
"colab_type": "text"
},
"source": [
"## In this tutorial let us understand the usage of Wikipedia API.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "qib3T9UX1fTy",
"colab_type": "text"
},
"source": [
"![alt text](https://miro.medium.com/max/1400/1*1FHnsWYdcfxoygKxkTdJew.png)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Krw-FZ7F10j7",
"colab_type": "text"
},
"source": [
"# Introduction\n",
"\n",
"Wikipedia, the world’s largest and free encyclopedia. It is the land full of information. I mean who would have used Wikipedia in their entire life (If you haven’t used it then most probably you are lying). The python library called `Wikipedia` allows us to easily access and parse the data from Wikipedia. In other words, you can also use this library as a little scraper where you can scrape only limited information from Wikipedia. We will see how can we do that today in this tutorial.\n",
"\n",
"\n",
"\n",
"\n",
"---\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "HDAg8LhB1-Xh",
"colab_type": "text"
},
"source": [
"# Installation\n",
"\n",
"The first step of using the API is manually installing it. Because, this is an external API it’s not built-in, so just type the following command to install it.\n",
"\n",
"* If you are using a [jupyter notebook](https://colab.research.google.com/notebooks/intro.ipynb) then make sure you use the below command (with the ‘!’ mark — the reason for this is it tell the jupyter notebook environment that a command is being typed (AKA **command mode**).\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "GciTaTsc2Kk_",
"colab_type": "code",
"colab": {}
},
"source": [
"!pip install wikipedia"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "A-4eBwuy2MAV",
"colab_type": "text"
},
"source": [
"* If you are using any IDE such as [Microsoft Visual Studio Code](https://code.visualstudio.com/), [PyCharm](https://www.jetbrains.com/pycharm/) and even [Sublime Text](https://www.sublimetext.com/3) then make sure in the terminal you enter the below command:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "nx8uaHvZ2Wzb",
"colab_type": "code",
"colab": {}
},
"source": [
"pip install wikipedia"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "vgkki4_c2Zvb",
"colab_type": "text"
},
"source": [
"After you enter the above command, in either of the above two cases you will be then prompted by success message like the one shown below. This is an indication that the library is successfully installed.\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "Dn1zyNjJ2bQP",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 297
},
"outputId": "6c757c2b-d52e-4dce-8f7f-e52a3dc11fac"
},
"source": [
"!pip install wikipedia"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": [
"Collecting wikipedia\n",
" Downloading https://files.pythonhosted.org/packages/67/35/25e68fbc99e672127cc6fbb14b8ec1ba3dfef035bf1e4c90f78f24a80b7d/wikipedia-1.4.0.tar.gz\n",
"Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.6/dist-packages (from wikipedia) (4.6.3)\n",
"Requirement already satisfied: requests<3.0.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from wikipedia) (2.21.0)\n",
"Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests<3.0.0,>=2.0.0->wikipedia) (1.24.3)\n",
"Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2.8)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2019.11.28)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests<3.0.0,>=2.0.0->wikipedia) (3.0.4)\n",
"Building wheels for collected packages: wikipedia\n",
" Building wheel for wikipedia (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for wikipedia: filename=wikipedia-1.4.0-cp36-none-any.whl size=11686 sha256=d0d5cc5f62e177020a96252ea5991ec3839cb9e4a302f3d217426ce0a2c406d5\n",
" Stored in directory: /root/.cache/pip/wheels/87/2a/18/4e471fd96d12114d16fe4a446d00c3b38fb9efcb744bd31f4a\n",
"Successfully built wikipedia\n",
"Installing collected packages: wikipedia\n",
"Successfully installed wikipedia-1.4.0\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "90b60Aep2em7",
"colab_type": "text"
},
"source": [
"\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "wqIc6wa-2gRi",
"colab_type": "text"
},
"source": [
"# Search and Suggestion\n",
"\n",
"Now let us see some of the built-in methods provided by the Wikipedia API. The first one is Search and Suggestion. I’m pretty sure you guys might know the usage of these two methods because of its name.\n",
"\n",
"## Search\n",
"\n",
"The search method returns the search result for a query. Just like other search engines, Wikipedia has its own search engine, you can have a look at it below:\n",
"\n",
"[Wikipedia Search](https://en.wikipedia.org/w/index.php?search)\n",
"\n",
"Now let us see how to retrieve the search results of a query using python. I will use **“Coronavirus”** as the topic in today’s tutorial because as well all know it’s trending and spreading worldwide. The first thing before starting to use API you need to first import it.\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "MEoZNFvo2tM4",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 55
},
"outputId": "24d33ec0-0cc3-4b6c-8f06-7b6c2b7c1426"
},
"source": [
"import wikipedia\n",
"print(wikipedia.search(\"Coronavirus\"))"
],
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"text": [
"['Coronavirus', '2019–20 coronavirus pandemic', 'Severe acute respiratory syndrome coronavirus 2', 'Middle East respiratory syndrome-related coronavirus', 'Coronavirus disease 2019', '2020 coronavirus pandemic in California', 'Misinformation related to the 2019–20 coronavirus pandemic', 'Socio-economic impact of the 2019–20 coronavirus pandemic', 'Severe acute respiratory syndrome-related coronavirus', 'Severe acute respiratory syndrome coronavirus']\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "dAxRz5co209d",
"colab_type": "text"
},
"source": [
"The above are some of the most searched queries on Wikipedia if you don’t believe me, go to the above link I have given and search for the topic and compare the results. And the search results change every hour probably.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "xx9fUJqq220F",
"colab_type": "text"
},
"source": [
"There are some of the ways where you can filter the search results by using search parameters such as results and suggestion (I know don’t worry about the spelling). The result returns the maximum number of results and the suggestion if True, return results and suggestion (if any) in a tuple.\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "JIFba2k924Dj",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 55
},
"outputId": "151cbc24-d19a-4b22-c65a-2a875320c8fb"
},
"source": [
"print(wikipedia.search(\"Coronavirus\", results = 5, suggestion = True))"
],
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"text": [
"(['Coronavirus', '2019–20 coronavirus pandemic', 'Middle East respiratory syndrome-related coronavirus', 'Severe acute respiratory syndrome coronavirus 2', 'Severe acute respiratory syndrome-related coronavirus'], None)\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "UAaUc8Ix26dQ",
"colab_type": "text"
},
"source": [
"## Suggestion\n",
"\n",
"Now the suggestion as the name suggests returns the suggested Wikipedia title for the query or none if it doesn't get any.\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "5UbFt3hL29hh",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "11b5fdc1-1f90-453d-9e21-a51321ea497d"
},
"source": [
"print(wikipedia.suggest('Coronavir'))"
],
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"text": [
"coronavirus\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Wk_fReEO3Aiu",
"colab_type": "text"
},
"source": [
"\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "cnOV23eb3BCB",
"colab_type": "text"
},
"source": [
"# Summary\n",
"\n",
"To get the summary of an article use the **“summary”** method as shown below:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "4-WdvLw53HrO",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 72
},
"outputId": "3f61c67f-49ba-4334-8842-a17e48d63214"
},
"source": [
"print(wikipedia.summary(\"Coronavirus\"))"
],
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"text": [
"Coronaviruses are a group of related viruses that cause diseases in mammals and birds. In humans, coronaviruses cause respiratory tract infections that can be mild, such as some cases of the common cold (among other possible causes, predominantly rhinoviruses), and others that can be lethal, such as SARS, MERS, and COVID-19. Symptoms in other species vary: in chickens, they cause an upper respiratory tract disease, while in cows and pigs they cause diarrhea. There are yet to be vaccines or antiviral drugs to prevent or treat human coronavirus infections. \n",
"Coronaviruses constitute the subfamily Orthocoronavirinae, in the family Coronaviridae, order Nidovirales, and realm Riboviria. They are enveloped viruses with a positive-sense single-stranded RNA genome and a nucleocapsid of helical symmetry. The genome size of coronaviruses ranges from approximately 27 to 34 kilobases, the largest among known RNA viruses. The name coronavirus is derived from the Latin corona, meaning \"crown\" or \"halo\", which refers to the characteristic appearance reminiscent of a crown or a solar corona around the virions (virus particles) when viewed under two-dimensional transmission electron microscopy, due to the surface being covered in club-shaped protein spikes.\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "2YqJfHWc3GrV",
"colab_type": "text"
},
"source": [
"But sometimes be careful, you might run into a `DisambiguationError`. Which means the same words with different meanings. For example, the word **“bass”** can represent a fish or beats or many more. At that time the summary method throws an error as shown below.\n",
"\n",
"\n",
"\n",
"> **Hint**: Be specific in your approach\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "AYi54Xik3YPu",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "88b8b9f1-0123-4d52-f776-2e92497567b1"
},
"source": [
"print(wikipedia.summary(\"bass\"))"
],
"execution_count": 7,
"outputs": [
{
"output_type": "stream",
"text": [
"/usr/local/lib/python3.6/dist-packages/wikipedia/wikipedia.py:389: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system (\"lxml\"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.\n",
"\n",
"The code that caused this warning is on line 389 of the file /usr/local/lib/python3.6/dist-packages/wikipedia/wikipedia.py. To get rid of this warning, pass the additional argument 'features=\"lxml\"' to the BeautifulSoup constructor.\n",
"\n",
" lis = BeautifulSoup(html).find_all('li')\n"
],
"name": "stderr"
},
{
"output_type": "error",
"ename": "DisambiguationError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mDisambiguationError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mwikipedia\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msummary\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"bass\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/wikipedia/util.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 28\u001b[0;31m \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 29\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mret\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/wikipedia/wikipedia.py\u001b[0m in \u001b[0;36msummary\u001b[0;34m(title, sentences, chars, auto_suggest, redirect)\u001b[0m\n\u001b[1;32m 229\u001b[0m \u001b[0;31m# use auto_suggest and redirect to get the correct article\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 230\u001b[0m \u001b[0;31m# also, use page's error checking to raise DisambiguationError if necessary\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 231\u001b[0;31m \u001b[0mpage_info\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mauto_suggest\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mauto_suggest\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mredirect\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mredirect\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 232\u001b[0m \u001b[0mtitle\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpage_info\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 233\u001b[0m \u001b[0mpageid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpage_info\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpageid\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/wikipedia/wikipedia.py\u001b[0m in \u001b[0;36mpage\u001b[0;34m(title, pageid, auto_suggest, redirect, preload)\u001b[0m\n\u001b[1;32m 274\u001b[0m \u001b[0;31m# if there is no suggestion or search results, the page doesn't exist\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mPageError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 276\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mWikipediaPage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mredirect\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mredirect\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreload\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpreload\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 277\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mpageid\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mWikipediaPage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpageid\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpageid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreload\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpreload\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/wikipedia/wikipedia.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, title, pageid, redirect, preload, original_title)\u001b[0m\n\u001b[1;32m 297\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Either a title or a pageid must be specified\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 298\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 299\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__load\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mredirect\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mredirect\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreload\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpreload\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 300\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 301\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpreload\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/wikipedia/wikipedia.py\u001b[0m in \u001b[0;36m__load\u001b[0;34m(self, redirect, preload)\u001b[0m\n\u001b[1;32m 391\u001b[0m \u001b[0mmay_refer_to\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mli\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_text\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mli\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfiltered_lis\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mli\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 392\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 393\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mDisambiguationError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'title'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpage\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'title'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmay_refer_to\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 394\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 395\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDisambiguationError\u001b[0m: \"Bass\" may refer to: \nBass (fish)\nBass (sound)\nAcoustic bass guitar\nBass clarinet\ncornett\nBass drum\nBass flute\nBass guitar\nBass recorder\nBass sarrusophone\nBass saxophone\nBass trombone\nBass trumpet\nBass violin\nDouble bass\nElectric upright bass\nTuba\nBass (voice type)\nBass clef\nBass note\nBassline\nCulture Vulture (EP)\nSimon Harris (musician)\nSimon Harris (musician)\nTubular Bells 2003\nBass Brewery\nBass Anglers Sportsman Society\nG.H. Bass & Co.\nBass (surname)\nBass Reeves\nChuck Bass\nBass Armstrong\nBass Monroe\nMega Man characters\nBass Strait\nBass Pyramid\nBass, Victoria\nDivision of Bass\nDivision of Bass (state)\nElectoral district of Bass\nShire of Bass\nBass, Alabama\nBass, Arkansas\nBass, Casey County, Kentucky\nBass, Missouri\nBass, West Virginia\nNancy Lee and Perry R. Bass Performance Hall\nBass, Hansi\nBass River (disambiguation)\nBass Rock\nBasses, Vienne\nBass diffusion model\nBeneath a Steel Sky\nButtocks\nBASS\nUSS Bass\nBas (disambiguation)\nBase (disambiguation)\nBass House (disambiguation)\nBasse (disambiguation)\nBassline (disambiguation)\nDrum and bass\nFigured bass\nMiami bass\nGhettotech\nSebastian (name)"
]
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "FdbT_TO43bHR",
"colab_type": "text"
},
"source": [
"Also, Wikipedia API gives us an option to change the language that we want to read the articles. All you have to do it set the language to your desired language. **Any french readers in the house, I would be using the french language as a reference.**\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "sv_wXQMq3di5",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 55
},
"outputId": "546a0857-f51c-4ad3-a1a2-ae49fcf05939"
},
"source": [
"wikipedia.set_lang(\"fr\")\n",
"wikipedia.summary(\"Coronavirus\")"
],
"execution_count": 8,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"\"Coronavirus ou CoV (du latin, virus à couronne) est le nom d'un genre de virus correspondant à la sous-famille des orthocoronavirinæ (de la famille des coronaviridæ). Le virus à couronne doit son nom à l'apparence des virions sous un microscope électronique, avec une frange de grandes projections bulbeuses qui ressemblent à la couronne solaire. \\nLes coronavirus sont munis d'une enveloppe virale ayant un génome à ARN de sens positif et une capside (coque) kilobases, incroyablement grosse pour un virus à ARN. Ils se classent parmi les Nidovirales, puisque tous les virus de cet ordre produisent un jeu imbriqué d'ARNm sous-génomique lors de l'infection. Des protéines en forme de pic, enveloppe, membrane et capside contribuent à la structure d'ensemble de tous les coronavirus. Ces virus à ARN sont monocaténaire (simple brin) et de sens positif (groupe IV de la classification Baltimore). Ils peuvent muter et se recombiner. \\nLes chauves-souris et les oiseaux, en tant que vertébrés volants à sang chaud, sont des hôtes idéaux pour les coronavirus, avec les chauves-souris et les oiseaux, assurant l'évolution et la dissémination du coronavirus.\\nLes coronavirus sont normalement spécifiques à un taxon animal comme hôte, mammifères ou oiseaux selon leur espèce ; mais ces virus peuvent parfois changer d'hôte à la suite d'une mutation. Leur transmission interhumaine se produit principalement par contacts étroits via des gouttelettes respiratoires générées par les éternuements et la toux.\\nLes coronavirus ont été responsables chez l'homme des graves épidémies de syndrome respiratoire aigu sévère (SRAS) en 2002/2003 et du syndrome respiratoire du Moyen-Orient (MERS) à partir de 2012, ainsi que la pandémie de Covid-19 de 2020, causée par le coronavirus SARS-CoV-2, contre lequel on ne dispose pas encore de vaccin ni de médicament à l'efficacité prouvée.\""
]
},
"metadata": {
"tags": []
},
"execution_count": 8
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "6hHAvCHk3f9z",
"colab_type": "text"
},
"source": [
"\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Ln4TADmW3gpa",
"colab_type": "text"
},
"source": [
"# Languages supported\n",
"\n",
"Now let us what languages does Wikipedia support, this might be a common question that people ask. Now here is the answer. Currently, Wikipedia supports **444 different languages**. To find it see the code below:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "rnNB0Hlr3zqR",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "a38c03b7-47e7-4ce1-a435-a50ca3bdcf56"
},
"source": [
"wikipedia.languages()"
],
"execution_count": 9,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"{'aa': 'Qafár af',\n",
" 'ab': 'Аҧсшәа',\n",
" 'abs': 'bahasa ambon',\n",
" 'ace': 'Acèh',\n",
" 'ady': 'адыгабзэ',\n",
" 'ady-cyrl': 'адыгабзэ',\n",
" 'aeb': 'تونسي/Tûnsî',\n",
" 'aeb-arab': 'تونسي',\n",
" 'aeb-latn': 'Tûnsî',\n",
" 'af': 'Afrikaans',\n",
" 'ak': 'Akan',\n",
" 'aln': 'Gegë',\n",
" 'als': 'Alemannisch',\n",
" 'am': 'አማርኛ',\n",
" 'an': 'aragonés',\n",
" 'ang': 'Ænglisc',\n",
" 'anp': 'अङ्गिका',\n",
" 'ar': 'العربية',\n",
" 'arc': 'ܐܪܡܝܐ',\n",
" 'arn': 'mapudungun',\n",
" 'arq': 'جازايرية',\n",
" 'ary': 'Maġribi',\n",
" 'arz': 'مصرى',\n",
" 'as': 'অসমীয়া',\n",
" 'ase': 'American sign language',\n",
" 'ast': 'asturianu',\n",
" 'atj': 'Atikamekw',\n",
" 'av': 'авар',\n",
" 'avk': 'Kotava',\n",
" 'awa': 'अवधी',\n",
" 'ay': 'Aymar aru',\n",
" 'az': 'azərbaycanca',\n",
" 'azb': 'تۆرکجه',\n",
" 'ba': 'башҡортса',\n",
" 'ban': 'Bali',\n",
" 'bar': 'Boarisch',\n",
" 'bat-smg': 'žemaitėška',\n",
" 'bbc': 'Batak Toba',\n",
" 'bbc-latn': 'Batak Toba',\n",
" 'bcc': 'جهلسری بلوچی',\n",
" 'bcl': 'Bikol Central',\n",
" 'be': 'беларуская',\n",
" 'be-tarask': 'беларуская (тарашкевіца)\\u200e',\n",
" 'be-x-old': 'беларуская (тарашкевіца)\\u200e',\n",
" 'bg': 'български',\n",
" 'bgn': 'روچ کپتین بلوچی',\n",
" 'bh': 'भोजपुरी',\n",
" 'bho': 'भोजपुरी',\n",
" 'bi': 'Bislama',\n",
" 'bjn': 'Banjar',\n",
" 'bm': 'bamanankan',\n",
" 'bn': 'বাংলা',\n",
" 'bo': 'བོད་ཡིག',\n",
" 'bpy': 'বিষ্ণুপ্রিয়া মণিপুরী',\n",
" 'bqi': 'بختیاری',\n",
" 'br': 'brezhoneg',\n",
" 'brh': 'Bráhuí',\n",
" 'bs': 'bosanski',\n",
" 'btm': 'Batak Mandailing',\n",
" 'bto': 'Iriga Bicolano',\n",
" 'bug': 'ᨅᨔ ᨕᨘᨁᨗ',\n",
" 'bxr': 'буряад',\n",
" 'ca': 'català',\n",
" 'cbk-zam': 'Chavacano de Zamboanga',\n",
" 'cdo': 'Mìng-dĕ̤ng-ngṳ̄',\n",
" 'ce': 'нохчийн',\n",
" 'ceb': 'Cebuano',\n",
" 'ch': 'Chamoru',\n",
" 'cho': 'Choctaw',\n",
" 'chr': 'ᏣᎳᎩ',\n",
" 'chy': 'Tsetsêhestâhese',\n",
" 'ckb': 'کوردی',\n",
" 'co': 'corsu',\n",
" 'cps': 'Capiceño',\n",
" 'cr': 'Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ',\n",
" 'crh': 'qırımtatarca',\n",
" 'crh-cyrl': 'къырымтатарджа (Кирилл)\\u200e',\n",
" 'crh-latn': 'qırımtatarca (Latin)\\u200e',\n",
" 'cs': 'čeština',\n",
" 'csb': 'kaszëbsczi',\n",
" 'cu': 'словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ',\n",
" 'cv': 'Чӑвашла',\n",
" 'cy': 'Cymraeg',\n",
" 'da': 'dansk',\n",
" 'de': 'Deutsch',\n",
" 'de-at': 'Österreichisches Deutsch',\n",
" 'de-ch': 'Schweizer Hochdeutsch',\n",
" 'de-formal': 'Deutsch (Sie-Form)\\u200e',\n",
" 'din': 'Thuɔŋjäŋ',\n",
" 'diq': 'Zazaki',\n",
" 'dsb': 'dolnoserbski',\n",
" 'dtp': 'Dusun Bundu-liwan',\n",
" 'dty': 'डोटेली',\n",
" 'dv': 'ދިވެހިބަސް',\n",
" 'dz': 'ཇོང་ཁ',\n",
" 'ee': 'eʋegbe',\n",
" 'egl': 'Emiliàn',\n",
" 'el': 'Ελληνικά',\n",
" 'eml': 'emiliàn e rumagnòl',\n",
" 'en': 'English',\n",
" 'en-ca': 'Canadian English',\n",
" 'en-gb': 'British English',\n",
" 'eo': 'Esperanto',\n",
" 'es': 'español',\n",
" 'es-419': 'español de América Latina',\n",
" 'es-formal': 'español (formal)\\u200e',\n",
" 'et': 'eesti',\n",
" 'eu': 'euskara',\n",
" 'ext': 'estremeñu',\n",
" 'fa': 'فارسی',\n",
" 'ff': 'Fulfulde',\n",
" 'fi': 'suomi',\n",
" 'fit': 'meänkieli',\n",
" 'fiu-vro': 'Võro',\n",
" 'fj': 'Na Vosa Vakaviti',\n",
" 'fo': 'føroyskt',\n",
" 'fr': 'français',\n",
" 'frc': 'français cadien',\n",
" 'frp': 'arpetan',\n",
" 'frr': 'Nordfriisk',\n",
" 'fur': 'furlan',\n",
" 'fy': 'Frysk',\n",
" 'ga': 'Gaeilge',\n",
" 'gag': 'Gagauz',\n",
" 'gan': '贛語',\n",
" 'gan-hans': '赣语(简体)\\u200e',\n",
" 'gan-hant': '贛語(繁體)\\u200e',\n",
" 'gcr': 'kriyòl gwiyannen',\n",
" 'gd': 'Gàidhlig',\n",
" 'gl': 'galego',\n",
" 'glk': 'گیلکی',\n",
" 'gn': \"Avañe'ẽ\",\n",
" 'gom': 'गोंयची कोंकणी / Gõychi Konknni',\n",
" 'gom-deva': 'गोंयची कोंकणी',\n",
" 'gom-latn': 'Gõychi Konknni',\n",
" 'gor': 'Bahasa Hulontalo',\n",
" 'got': '𐌲𐌿𐍄𐌹𐍃𐌺',\n",
" 'grc': 'Ἀρχαία ἑλληνικὴ',\n",
" 'gsw': 'Alemannisch',\n",
" 'gu': 'ગુજરાતી',\n",
" 'gv': 'Gaelg',\n",
" 'ha': 'Hausa',\n",
" 'hak': '客家語/Hak-kâ-ngî',\n",
" 'haw': 'Hawaiʻi',\n",
" 'he': 'עברית',\n",
" 'hi': 'हिन्दी',\n",
" 'hif': 'Fiji Hindi',\n",
" 'hif-latn': 'Fiji Hindi',\n",
" 'hil': 'Ilonggo',\n",
" 'ho': 'Hiri Motu',\n",
" 'hr': 'hrvatski',\n",
" 'hrx': 'Hunsrik',\n",
" 'hsb': 'hornjoserbsce',\n",
" 'ht': 'Kreyòl ayisyen',\n",
" 'hu': 'magyar',\n",
" 'hu-formal': 'magyar (formal)\\u200e',\n",
" 'hy': 'հայերեն',\n",
" 'hyw': 'Արեւմտահայերէն',\n",
" 'hz': 'Otsiherero',\n",
" 'ia': 'interlingua',\n",
" 'id': 'Bahasa Indonesia',\n",
" 'ie': 'Interlingue',\n",
" 'ig': 'Igbo',\n",
" 'ii': 'ꆇꉙ',\n",
" 'ik': 'Iñupiak',\n",
" 'ike-cans': 'ᐃᓄᒃᑎᑐᑦ',\n",
" 'ike-latn': 'inuktitut',\n",
" 'ilo': 'Ilokano',\n",
" 'inh': 'ГӀалгӀай',\n",
" 'io': 'Ido',\n",
" 'is': 'íslenska',\n",
" 'it': 'italiano',\n",
" 'iu': 'ᐃᓄᒃᑎᑐᑦ/inuktitut',\n",
" 'ja': '日本語',\n",
" 'jam': 'Patois',\n",
" 'jbo': 'la .lojban.',\n",
" 'jut': 'jysk',\n",
" 'jv': 'Jawa',\n",
" 'ka': 'ქართული',\n",
" 'kaa': 'Qaraqalpaqsha',\n",
" 'kab': 'Taqbaylit',\n",
" 'kbd': 'Адыгэбзэ',\n",
" 'kbd-cyrl': 'Адыгэбзэ',\n",
" 'kbp': 'Kabɩyɛ',\n",
" 'kg': 'Kongo',\n",
" 'khw': 'کھوار',\n",
" 'ki': 'Gĩkũyũ',\n",
" 'kiu': 'Kırmancki',\n",
" 'kj': 'Kwanyama',\n",
" 'kjp': 'ဖၠုံလိက်',\n",
" 'kk': 'қазақша',\n",
" 'kk-arab': 'قازاقشا (تٴوتە)\\u200f',\n",
" 'kk-cn': 'قازاقشا (جۇنگو)\\u200f',\n",
" 'kk-cyrl': 'қазақша (кирил)\\u200e',\n",
" 'kk-kz': 'қазақша (Қазақстан)\\u200e',\n",
" 'kk-latn': 'qazaqşa (latın)\\u200e',\n",
" 'kk-tr': 'qazaqşa (Türkïya)\\u200e',\n",
" 'kl': 'kalaallisut',\n",
" 'km': 'ភាសាខ្មែរ',\n",
" 'kn': 'ಕನ್ನಡ',\n",
" 'ko': '한국어',\n",
" 'ko-kp': '조선말',\n",
" 'koi': 'Перем Коми',\n",
" 'kr': 'Kanuri',\n",
" 'krc': 'къарачай-малкъар',\n",
" 'kri': 'Krio',\n",
" 'krj': 'Kinaray-a',\n",
" 'krl': 'karjal',\n",
" 'ks': 'कॉशुर / کٲشُر',\n",
" 'ks-arab': 'کٲشُر',\n",
" 'ks-deva': 'कॉशुर',\n",
" 'ksh': 'Ripoarisch',\n",
" 'ku': 'kurdî',\n",
" 'ku-arab': 'كوردي (عەرەبی)\\u200f',\n",
" 'ku-latn': 'kurdî (latînî)\\u200e',\n",
" 'kum': 'къумукъ',\n",
" 'kv': 'коми',\n",
" 'kw': 'kernowek',\n",
" 'ky': 'Кыргызча',\n",
" 'la': 'Latina',\n",
" 'lad': 'Ladino',\n",
" 'lb': 'Lëtzebuergesch',\n",
" 'lbe': 'лакку',\n",
" 'lez': 'лезги',\n",
" 'lfn': 'Lingua Franca Nova',\n",
" 'lg': 'Luganda',\n",
" 'li': 'Limburgs',\n",
" 'lij': 'Ligure',\n",
" 'liv': 'Līvõ kēļ',\n",
" 'lki': 'لەکی',\n",
" 'lmo': 'lumbaart',\n",
" 'ln': 'lingála',\n",
" 'lo': 'ລາວ',\n",
" 'loz': 'Silozi',\n",
" 'lrc': 'لۊری شومالی',\n",
" 'lt': 'lietuvių',\n",
" 'ltg': 'latgaļu',\n",
" 'lus': 'Mizo ţawng',\n",
" 'luz': 'لئری دوٙمینی',\n",
" 'lv': 'latviešu',\n",
" 'lzh': '文言',\n",
" 'lzz': 'Lazuri',\n",
" 'mai': 'मैथिली',\n",
" 'map-bms': 'Basa Banyumasan',\n",
" 'mdf': 'мокшень',\n",
" 'mg': 'Malagasy',\n",
" 'mh': 'Ebon',\n",
" 'mhr': 'олык марий',\n",
" 'mi': 'Māori',\n",
" 'min': 'Minangkabau',\n",
" 'mk': 'македонски',\n",
" 'ml': 'മലയാളം',\n",
" 'mn': 'монгол',\n",
" 'mni': 'ꯃꯤꯇꯩ ꯂꯣꯟ',\n",
" 'mnw': 'ဘာသာ မန်',\n",
" 'mo': 'молдовеняскэ',\n",
" 'mr': 'मराठी',\n",
" 'mrj': 'кырык мары',\n",
" 'ms': 'Bahasa Melayu',\n",
" 'mt': 'Malti',\n",
" 'mus': 'Mvskoke',\n",
" 'mwl': 'Mirandés',\n",
" 'my': 'မြန်မာဘာသာ',\n",
" 'myv': 'эрзянь',\n",
" 'mzn': 'مازِرونی',\n",
" 'na': 'Dorerin Naoero',\n",
" 'nah': 'Nāhuatl',\n",
" 'nan': 'Bân-lâm-gú',\n",
" 'nap': 'Napulitano',\n",
" 'nb': 'norsk bokmål',\n",
" 'nds': 'Plattdüütsch',\n",
" 'nds-nl': 'Nedersaksies',\n",
" 'ne': 'नेपाली',\n",
" 'new': 'नेपाल भाषा',\n",
" 'ng': 'Oshiwambo',\n",
" 'niu': 'Niuē',\n",
" 'nl': 'Nederlands',\n",
" 'nl-informal': 'Nederlands (informeel)\\u200e',\n",
" 'nn': 'norsk nynorsk',\n",
" 'no': 'norsk',\n",
" 'nov': 'Novial',\n",
" 'nqo': 'ߒߞߏ',\n",
" 'nrm': 'Nouormand',\n",
" 'nso': 'Sesotho sa Leboa',\n",
" 'nv': 'Diné bizaad',\n",
" 'ny': 'Chi-Chewa',\n",
" 'nys': 'Nyunga',\n",
" 'oc': 'occitan',\n",
" 'olo': 'Livvinkarjala',\n",
" 'om': 'Oromoo',\n",
" 'or': 'ଓଡ଼ିଆ',\n",
" 'os': 'Ирон',\n",
" 'pa': 'ਪੰਜਾਬੀ',\n",
" 'pag': 'Pangasinan',\n",
" 'pam': 'Kapampangan',\n",
" 'pap': 'Papiamentu',\n",
" 'pcd': 'Picard',\n",
" 'pdc': 'Deitsch',\n",
" 'pdt': 'Plautdietsch',\n",
" 'pfl': 'Pälzisch',\n",
" 'pi': 'पालि',\n",
" 'pih': 'Norfuk / Pitkern',\n",
" 'pl': 'polski',\n",
" 'pms': 'Piemontèis',\n",
" 'pnb': 'پنجابی',\n",
" 'pnt': 'Ποντιακά',\n",
" 'prg': 'Prūsiskan',\n",
" 'ps': 'پښتو',\n",
" 'pt': 'português',\n",
" 'pt-br': 'português do Brasil',\n",
" 'qu': 'Runa Simi',\n",
" 'qug': 'Runa shimi',\n",
" 'rgn': 'Rumagnôl',\n",
" 'rif': 'Tarifit',\n",
" 'rm': 'rumantsch',\n",
" 'rmy': 'romani čhib',\n",
" 'rn': 'Kirundi',\n",
" 'ro': 'română',\n",
" 'roa-rup': 'armãneashti',\n",
" 'roa-tara': 'tarandíne',\n",
" 'ru': 'русский',\n",
" 'rue': 'русиньскый',\n",
" 'rup': 'armãneashti',\n",
" 'ruq': 'Vlăheşte',\n",
" 'ruq-cyrl': 'Влахесте',\n",
" 'ruq-latn': 'Vlăheşte',\n",
" 'rw': 'Kinyarwanda',\n",
" 'sa': 'संस्कृतम्',\n",
" 'sah': 'саха тыла',\n",
" 'sat': 'ᱥᱟᱱᱛᱟᱲᱤ',\n",
" 'sc': 'sardu',\n",
" 'scn': 'sicilianu',\n",
" 'sco': 'Scots',\n",
" 'sd': 'سنڌي',\n",
" 'sdc': 'Sassaresu',\n",
" 'sdh': 'کوردی خوارگ',\n",
" 'se': 'davvisámegiella',\n",
" 'sei': 'Cmique Itom',\n",
" 'ses': 'Koyraboro Senni',\n",
" 'sg': 'Sängö',\n",
" 'sgs': 'žemaitėška',\n",
" 'sh': 'srpskohrvatski / српскохрватски',\n",
" 'shi': 'Tašlḥiyt/ⵜⴰⵛⵍⵃⵉⵜ',\n",
" 'shi-latn': 'Tašlḥiyt',\n",
" 'shi-tfng': 'ⵜⴰⵛⵍⵃⵉⵜ',\n",
" 'shn': 'ၽႃႇသႃႇတႆး ',\n",
" 'shy-latn': 'tacawit',\n",
" 'si': 'සිංහල',\n",
" 'simple': 'Simple English',\n",
" 'sk': 'slovenčina',\n",
" 'skr': 'سرائیکی',\n",
" 'skr-arab': 'سرائیکی',\n",
" 'sl': 'slovenščina',\n",
" 'sli': 'Schläsch',\n",
" 'sm': 'Gagana Samoa',\n",
" 'sma': 'Åarjelsaemien',\n",
" 'sn': 'chiShona',\n",
" 'so': 'Soomaaliga',\n",
" 'sq': 'shqip',\n",
" 'sr': 'српски / srpski',\n",
" 'sr-ec': 'српски (ћирилица)\\u200e',\n",
" 'sr-el': 'srpski (latinica)\\u200e',\n",
" 'srn': 'Sranantongo',\n",
" 'ss': 'SiSwati',\n",
" 'st': 'Sesotho',\n",
" 'stq': 'Seeltersk',\n",
" 'sty': 'cебертатар',\n",
" 'su': 'Sunda',\n",
" 'sv': 'svenska',\n",
" 'sw': 'Kiswahili',\n",
" 'szl': 'ślůnski',\n",
" 'szy': 'Sakizaya',\n",
" 'ta': 'தமிழ்',\n",
" 'tay': 'Tayal',\n",
" 'tcy': 'ತುಳು',\n",
" 'te': 'తెలుగు',\n",
" 'tet': 'tetun',\n",
" 'tg': 'тоҷикӣ',\n",
" 'tg-cyrl': 'тоҷикӣ',\n",
" 'tg-latn': 'tojikī',\n",
" 'th': 'ไทย',\n",
" 'ti': 'ትግርኛ',\n",
" 'tk': 'Türkmençe',\n",
" 'tl': 'Tagalog',\n",
" 'tly': 'толышә зывон',\n",
" 'tn': 'Setswana',\n",
" 'to': 'lea faka-Tonga',\n",
" 'tpi': 'Tok Pisin',\n",
" 'tr': 'Türkçe',\n",
" 'tru': 'Ṫuroyo',\n",
" 'ts': 'Xitsonga',\n",
" 'tt': 'татарча/tatarça',\n",
" 'tt-cyrl': 'татарча',\n",
" 'tt-latn': 'tatarça',\n",
" 'tum': 'chiTumbuka',\n",
" 'tw': 'Twi',\n",
" 'ty': 'reo tahiti',\n",
" 'tyv': 'тыва дыл',\n",
" 'tzm': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',\n",
" 'udm': 'удмурт',\n",
" 'ug': 'ئۇيغۇرچە / Uyghurche',\n",
" 'ug-arab': 'ئۇيغۇرچە',\n",
" 'ug-latn': 'Uyghurche',\n",
" 'uk': 'українська',\n",
" 'ur': 'اردو',\n",
" 'uz': 'oʻzbekcha/ўзбекча',\n",
" 'uz-cyrl': 'ўзбекча',\n",
" 'uz-latn': 'oʻzbekcha',\n",
" 've': 'Tshivenda',\n",
" 'vec': 'vèneto',\n",
" 'vep': 'vepsän kel’',\n",
" 'vi': 'Tiếng Việt',\n",
" 'vls': 'West-Vlams',\n",
" 'vmf': 'Mainfränkisch',\n",
" 'vo': 'Volapük',\n",
" 'vot': 'Vaďďa',\n",
" 'vro': 'Võro',\n",
" 'wa': 'walon',\n",
" 'war': 'Winaray',\n",
" 'wo': 'Wolof',\n",
" 'wuu': '吴语',\n",
" 'xal': 'хальмг',\n",
" 'xh': 'isiXhosa',\n",
" 'xmf': 'მარგალური',\n",
" 'xsy': 'saisiyat',\n",
" 'yi': 'ייִדיש',\n",
" 'yo': 'Yorùbá',\n",
" 'yue': '粵語',\n",
" 'za': 'Vahcuengh',\n",
" 'zea': 'Zeêuws',\n",
" 'zgh': 'ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ',\n",
" 'zh': '中文',\n",
" 'zh-classical': '文言',\n",
" 'zh-cn': '中文(中国大陆)\\u200e',\n",
" 'zh-hans': '中文(简体)\\u200e',\n",
" 'zh-hant': '中文(繁體)\\u200e',\n",
" 'zh-hk': '中文(香港)\\u200e',\n",
" 'zh-min-nan': 'Bân-lâm-gú',\n",
" 'zh-mo': '中文(澳門)\\u200e',\n",
" 'zh-my': '中文(马来西亚)\\u200e',\n",
" 'zh-sg': '中文(新加坡)\\u200e',\n",
" 'zh-tw': '中文(台灣)\\u200e',\n",
" 'zh-yue': '粵語',\n",
" 'zu': 'isiZulu'}"
]
},
"metadata": {
"tags": []
},
"execution_count": 9
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Vj2xUHbW31oE",
"colab_type": "text"
},
"source": [
"To check is a language is supported then write a condition as shown below:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "jwWJSdLa32y7",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "95c9bd92-54a8-4fec-a2e3-466f6b1018ab"
},
"source": [
"'en' in wikipedia.languages()"
],
"execution_count": 10,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"True"
]
},
"metadata": {
"tags": []
},
"execution_count": 10
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "_Y9DRi_Z35BW",
"colab_type": "text"
},
"source": [
"Here **‘en’** stands for **‘English’** and you know the answer for the above code. Its obviously a **“True”** or **“False”**, here it’s **“True”**\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "FzR_Dyv9396E",
"colab_type": "text"
},
"source": [
"Also, to get a possible language prefix please try:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "3h4bXT4e39NB",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "70bc222f-76b9-41a8-a934-34ec4e4af454"
},
"source": [
"wikipedia.languages()['en']"
],
"execution_count": 11,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'English'"
]
},
"metadata": {
"tags": []
},
"execution_count": 11
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "jN8g10xm4Ah5",
"colab_type": "text"
},
"source": [
"\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "74-fpccn4B1V",
"colab_type": "text"
},
"source": [
"# Page Access\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "az0j8nrH4DX_",
"colab_type": "text"
},
"source": [
"The API also gives us full access to the Wikipedia page, with the help of which we can access the title, URL, content, images, links of the complete page. In order to access the page you need to load the page first as shown below:\n",
"\n",
"**Just a heads up, I will use a single article topic (Coronavirus) as a reference in this example:**\n",
"\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "a6AfRu4l4GkY",
"colab_type": "code",
"colab": {}
},
"source": [
"covid = wikipedia.page(\"Coronavirus\")"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "gdQdjA7l4Nc-",
"colab_type": "text"
},
"source": [
"## Title\n",
"\n",
"To access the title of the above-provided page use:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "uXM8OdyG4Qz8",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "4bdd301e-6974-4b03-9c3a-4d7ac38d5d38"
},
"source": [
"print(covid.title)"
],
"execution_count": 15,
"outputs": [
{
"output_type": "stream",
"text": [
"Coronavirus\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "GOVuo1Db4SnW",
"colab_type": "text"
},
"source": [
"## URL\n",
"To get the URL of the page use:"
]
},
{
"cell_type": "code",
"metadata": {
"id": "iymZUWiC4Udb",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "a9e38aba-0e14-4fed-c005-89325455efdc"
},
"source": [
"print(covid.url)"
],
"execution_count": 16,
"outputs": [
{
"output_type": "stream",
"text": [
"https://en.wikipedia.org/wiki/Coronavirus\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "hiX10HQ04WUt",
"colab_type": "text"
},
"source": [
"## Content\n",
"To access the content of the page use:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "jRcUW9va4ZCV",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "a1b78add-e598-4c54-f580-fad994c5bb29"
},
"source": [
"print(covid.content)"
],
"execution_count": 17,
"outputs": [
{
"output_type": "stream",
"text": [
"Coronaviruses are a group of related viruses that cause diseases in mammals and birds. In humans, coronaviruses cause respiratory tract infections that can be mild, such as some cases of the common cold (among other possible causes, predominantly rhinoviruses), and others that can be lethal, such as SARS, MERS, and COVID-19. Symptoms in other species vary: in chickens, they cause an upper respiratory tract disease, while in cows and pigs they cause diarrhea. There are yet to be vaccines or antiviral drugs to prevent or treat human coronavirus infections. \n",
"Coronaviruses constitute the subfamily Orthocoronavirinae, in the family Coronaviridae, order Nidovirales, and realm Riboviria. They are enveloped viruses with a positive-sense single-stranded RNA genome and a nucleocapsid of helical symmetry. The genome size of coronaviruses ranges from approximately 27 to 34 kilobases, the largest among known RNA viruses. The name coronavirus is derived from the Latin corona, meaning \"crown\" or \"halo\", which refers to the characteristic appearance reminiscent of a crown or a solar corona around the virions (virus particles) when viewed under two-dimensional transmission electron microscopy, due to the surface being covered in club-shaped protein spikes.\n",
"\n",
"\n",
"== Discovery ==\n",
"Human coronaviruses were first discovered in the late 1960s. The earliest ones discovered were an infectious bronchitis virus in chickens and two in human patients with the common cold (later named human coronavirus 229E and human coronavirus OC43). Other members of this family have since been identified, including SARS-CoV in 2003, HCoV NL63 in 2004, HKU1 in 2005, MERS-CoV in 2012, and SARS-CoV-2 (formerly known as 2019-nCoV) in 2019. Most of these have involved serious respiratory tract infections.\n",
"\n",
"\n",
"== Etymology ==\n",
"The name \"coronavirus\" is derived from Latin corona, meaning \"crown\" or \"wreath\", itself a borrowing from Greek κορώνη korṓnē, \"garland, wreath\". The name refers to the characteristic appearance of virions (the infective form of the virus) by electron microscopy, which have a fringe of large, bulbous surface projections creating an image reminiscent of a crown or of a solar corona. This morphology is created by the viral spike peplomers, which are proteins on the surface of the virus.\n",
"\n",
"\n",
"== Morphology ==\n",
"\n",
"Coronaviruses are large pleomorphic spherical particles with bulbous surface projections. The diameter of the virus particles is around 120 nm. The envelope of the virus in electron micrographs appears as a distinct pair of electron dense shells.The viral envelope consists of a lipid bilayer where the membrane (M), envelope (E) and spike (S) structural proteins are anchored. A subset of coronaviruses (specifically the members of betacoronavirus subgroup A) also have a shorter spike-like surface protein called hemagglutinin esterase (HE).Inside the envelope, there is the nucleocapsid, which is formed from multiple copies of the nucleocapsid (N) protein, which are bound to the positive-sense single-stranded RNA genome in a continuous beads-on-a-string type conformation. The lipid bilayer envelope, membrane proteins, and nucleocapsid protect the virus when it is outside the host cell.\n",
"\n",
"\n",
"== Genome ==\n",
"\n",
"Coronaviruses contain a positive-sense, single-stranded RNA genome. The genome size for coronaviruses ranges from approximately 27 to 34 kilobases. The genome size is one of the largest among RNA viruses. The genome has a 5′ methylated cap and a 3′ polyadenylated tail.The genome organization for a coronavirus is 5′-leader-UTR-replicase/transcriptase-spike (S)-envelope (E)-membrane (M)-nucleocapsid (N)-3′UTR-poly (A) tail. The open reading frames 1a and 1b, which occupy the first two-thirds of the genome, encode the replicase/transcriptase polyprotein. The replicase/transcriptase polyprotein self cleaves to form the nonstructural proteins (nsps).The later reading frames encode the four major structural proteins: spike, envelope, membrane, and nucleocapsid. Interspersed between these reading frames are the reading frames for the accessory proteins. The number of accessory proteins and their function is unique depending on the specific coronavirus.\n",
"\n",
"\n",
"== Life cycle ==\n",
"\n",
"\n",
"=== Entry ===\n",
"\n",
"Infection begins when the viral spike (S) glycoprotein attaches to its complementary host cell receptor. After attachment, a protease of the host cell cleaves and activates the receptor-attached spike protein. Depending on the host cell protease available, cleavage and activation allows the virus to enter the host cell by endocytosis or direct fusion of the viral envelop with the host membrane.On entry into the host cell, the virus particle is uncoated, and its genome enters the cell cytoplasm. The coronavirus RNA genome has a 5′ methylated cap and a 3′ polyadenylated tail, which allows the RNA to attach to the host cell's ribosome for translation. The host ribosome translates the initial overlapping open reading frame of the virus genome and forms a long polyprotein. The polyprotein has its own proteases which cleave the polyprotein into multiple nonstructural proteins.\n",
"\n",
"\n",
"=== Replication ===\n",
"A number of the nonstructural proteins coalesce to form a multi-protein replicase-transcriptase complex (RTC). The main replicase-transcriptase protein is the RNA-dependent RNA polymerase (RdRp). It is directly involved in the replication and transcription of RNA from an RNA strand. The other nonstructural proteins in the complex assist in the replication and transcription process. The exoribonuclease non-structural protein, for instance, provides extra fidelity to replication by providing a proofreading function which the RNA-dependent RNA polymerase lacks.One of the main functions of the complex is to replicate the viral genome. RdRp directly mediates the synthesis of negative-sense genomic RNA from the positive-sense genomic RNA. This is followed by the replication of positive-sense genomic RNA from the negative-sense genomic RNA. The other important function of the complex is to transcribe the viral genome. RdRp directly mediates the synthesis of negative-sense subgenomic RNA molecules from the positive-sense genomic RNA. This is followed by the transcription of these negative-sense subgenomic RNA molecules to their corresponding positive-sense mRNAs.\n",
"\n",
"\n",
"=== Release ===\n",
"The replicated positive-sense genomic RNA becomes the genome of the progeny viruses. The mRNAs are gene transcripts of the last third of the virus genome after the initial overlapping reading frame. These mRNAs are translated by the host's ribosomes into the structural proteins and a number of accessory proteins. RNA translation occurs inside the endoplasmic reticulum. The viral structural proteins S, E, and M move along the secretory pathway into the Golgi intermediate compartment. There, the M proteins direct most protein-protein interactions required for assembly of viruses following its binding to the nucleocapsid. Progeny viruses are then released from the host cell by exocytosis through secretory vesicles.\n",
"\n",
"\n",
"== Transmission ==\n",
"Human to human transmission of coronaviruses is primarily thought to occur among close contacts via respiratory droplets generated by sneezing and coughing. The interaction of the coronavirus spike protein with its complement host cell receptor is central in determining the tissue tropism, infectivity, and species range of the virus. The SARS coronavirus, for example, infects human cells by attaching to the angiotensin-converting enzyme 2 (ACE2) receptor.\n",
"\n",
"\n",
"== Taxonomy ==\n",
"\n",
"The scientific name for coronavirus is Orthocoronavirinae or Coronavirinae. Coronavirus belongs to the family of Coronaviridae.\n",
"\n",
"Genus: Alphacoronavirus\n",
"Species: Human coronavirus 229E, Human coronavirus NL63, Miniopterus bat coronavirus 1, Miniopterus bat coronavirus HKU8, Porcine epidemic diarrhea virus, Rhinolophus bat coronavirus HKU2, Scotophilus bat coronavirus 512\n",
"Genus Betacoronavirus; type species: Murine coronavirus\n",
"Species: Betacoronavirus 1, Human coronavirus HKU1, Murine coronavirus, Pipistrellus bat coronavirus HKU5, Rousettus bat coronavirus HKU9, Severe acute respiratory syndrome-related coronavirus, Severe acute respiratory syndrome coronavirus 2, Tylonycteris bat coronavirus HKU4, Middle East respiratory syndrome-related coronavirus, Human coronavirus OC43, Hedgehog coronavirus 1 (EriCoV)\n",
"Genus Gammacoronavirus; type species: Infectious bronchitis virus\n",
"Species: Beluga whale coronavirus SW1, Infectious bronchitis virus\n",
"Genus Deltacoronavirus; type species: Bulbul coronavirus HKU11\n",
"Species: Bulbul coronavirus HKU11, Porcine coronavirus HKU15\n",
"\n",
"\n",
"== Evolution ==\n",
"The most recent common ancestor (MRCA) of all coronaviruses has been estimated to have existed as recently as 8000 BCE, though some models place the MRCA as far back as 55 million years or more, implying long term coevolution with bats. The MRCAs of the alphacoronavirus line has been placed at about 2400 BCE, the betacoronavirus line at 3300 BCE, the gammacoronavirus line at 2800 BCE, and the deltacoronavirus line at about 3000 BCE. It appears that bats and birds, as warm-blooded flying vertebrates, are ideal hosts for the coronavirus gene source (with bats for alphacoronavirus and betacoronavirus, and birds for gammacoronavirus and deltacoronavirus) to fuel coronavirus evolution and dissemination.Bovine coronavirus and canine respiratory coronaviruses diverged from a common ancestor recently (~ 1950). Bovine coronavirus and human coronavirus OC43 diverged around the 1890s. Bovine coronavirus diverged from the equine coronavirus species at the end of the 18th century.The MRCA of human coronavirus OC43 has been dated to the 1950s.MERS-CoV, although related to several bat coronavirus species, appears to have diverged from these several centuries ago. The human coronavirus NL63 and a bat coronavirus shared an MRCA 563–822 years ago.The most closely related bat coronavirus and SARS-CoV diverged in 1986. A path of evolution of the SARS virus and keen relationship with bats have been proposed. The authors suggest that the coronaviruses have been coevolved with bats for a long time and the ancestors of SARS-CoV first infected the species of the genus Hipposideridae, subsequently spread to species of the Rhinolophidae and then to civets, and finally to humans.Alpaca coronavirus and human coronavirus 229E diverged before 1960.\n",
"\n",
"\n",
"== Human coronaviruses ==\n",
"\n",
"Coronaviruses vary significantly in risk factor. Some can kill more than 30% of those infected (such as MERS-CoV), and some are relatively harmless, such as the common cold. Coronaviruses cause colds with major symptoms, such as fever, and sore throat from swollen adenoids, occurring primarily in the winter and early spring seasons. Coronaviruses can cause pneumonia (either direct viral pneumonia or a secondary bacterial pneumonia) and bronchitis (either direct viral bronchitis or a secondary bacterial bronchitis). The much publicized human coronavirus discovered in 2003, SARS-CoV, which causes severe acute respiratory syndrome (SARS), has a unique pathogenesis because it causes both upper and lower respiratory tract infections.Seven strains of human coronaviruses are known, of which four produce the generally mild symptoms of the common cold:\n",
"\n",
"Human coronavirus OC43 (HCoV-OC43)\n",
"Human coronavirus HKU1\n",
"Human coronavirus NL63 (HCoV-NL63, New Haven coronavirus)\n",
"Human coronavirus 229E (HCoV-229E)– and three, symptoms that are potentially severe:\n",
"\n",
"Middle East respiratory syndrome-related coronavirus (MERS-CoV), previously known as novel coronavirus 2012 and HCoV-EMC\n",
"Severe acute respiratory syndrome coronavirus (SARS-CoV or \"SARS-classic\")\n",
"Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), previously known as 2019-nCoV or \"novel coronavirus 2019\"The coronaviruses HCoV-229E, -NL63, -OC43, and -HKU1 continually circulate in the human population and cause respiratory infections in adults and children world-wide.\n",
"\n",
"\n",
"== Outbreaks of coronavirus-related diseases ==\n",
"Outbreaks of coronavirus types of relatively high mortality are as follows:\n",
"\n",
"\n",
"=== Severe acute respiratory syndrome (SARS) ===\n",
"\n",
"In 2003, following the outbreak of severe acute respiratory syndrome (SARS) which had begun the prior year in Asia, and secondary cases elsewhere in the world, the World Health Organization (WHO) issued a press release stating that a novel coronavirus identified by a number of laboratories was the causative agent for SARS. The virus was officially named the SARS coronavirus (SARS-CoV). More than 8,000 people were infected, about ten percent of whom died.\n",
"\n",
"\n",
"=== Middle East respiratory syndrome (MERS) ===\n",
"\n",
"In September 2012, a new type of coronavirus was identified, initially called Novel Coronavirus 2012, and now officially named Middle East respiratory syndrome coronavirus (MERS-CoV). The World Health Organization issued a global alert soon after. The WHO update on 28 September 2012 said the virus did not seem to pass easily from person to person. However, on 12 May 2013, a case of human-to-human transmission in France was confirmed by the French Ministry of Social Affairs and Health. In addition, cases of human-to-human transmission were reported by the Ministry of Health in Tunisia. Two confirmed cases involved people who seemed to have caught the disease from their late father, who became ill after a visit to Qatar and Saudi Arabia. Despite this, it appears the virus had trouble spreading from human to human, as most individuals who are infected do not transmit the virus. By 30 October 2013, there were 124 cases and 52 deaths in Saudi Arabia.After the Dutch Erasmus Medical Centre sequenced the virus, the virus was given a new name, Human Coronavirus–Erasmus Medical Centre (HCoV-EMC). The final name for the virus is Middle East respiratory syndrome coronavirus (MERS-CoV). In May 2014, the only two United States cases of MERS-CoV infection were recorded, both occurring in healthcare workers who worked in Saudi Arabia and then travelled to the U.S. One was treated in Indiana and one in Florida. Both were hospitalized temporarily and then discharged.In May 2015, an outbreak of MERS-CoV occurred in the Republic of Korea, when a man who had traveled to the Middle East, visited 4 hospitals in the Seoul area to treat his illness. This caused one of the largest outbreaks of MERS-CoV outside the Middle East. As of December 2019, 2,468 cases of MERS-CoV infection had been confirmed by laboratory tests, 851 of which were fatal, a mortality rate of approximately 34.5%.\n",
"\n",
"\n",
"=== Coronavirus disease 2019 (COVID-19) ===\n",
"\n",
"In December 2019, a pneumonia outbreak was reported in Wuhan, China. On 31 December 2019, the outbreak was traced to a novel strain of coronavirus, which was given the interim name 2019-nCoV by the World Health Organization (WHO), later renamed SARS-CoV-2 by the International Committee on Taxonomy of Viruses. Some researchers have suggested that the Huanan Seafood Wholesale Market may not be the original source of viral transmission to humans.As of 26 March 2020, there have been at least 24,065 confirmed deaths and more than 531,630 confirmed cases in the coronavirus pneumonia pandemic. The Wuhan strain has been identified as a new strain of Betacoronavirus from group 2B with approximately 70% genetic similarity to the SARS-CoV. The virus has a 96% similarity to a bat coronavirus, so it is widely suspected to originate from bats as well.\n",
"The pandemic has resulted in travel restrictions and nationwide lockdowns in several countries.\n",
"\n",
"\n",
"== Other animals ==\n",
"Coronaviruses have been recognized as causing pathological conditions in veterinary medicine since the early 1970s. Except for avian infectious bronchitis, the major related diseases have mainly an intestinal location.\n",
"\n",
"\n",
"=== Diseases caused ===\n",
"Coronaviruses primarily infect the upper respiratory and gastrointestinal tract of mammals and birds. They also cause a range of diseases in farm animals and domesticated pets, some of which can be serious and are a threat to the farming industry. In chickens, the infectious bronchitis virus (IBV), a coronavirus, targets not only the respiratory tract but also the urogenital tract. The virus can spread to different organs throughout the chicken. Economically significant coronaviruses of farm animals include porcine coronavirus (transmissible gastroenteritis coronavirus, TGE) and bovine coronavirus, which both result in diarrhea in young animals. Feline coronavirus: two forms, feline enteric coronavirus is a pathogen of minor clinical significance, but spontaneous mutation of this virus can result in feline infectious peritonitis (FIP), a disease associated with high mortality. Similarly, there are two types of coronavirus that infect ferrets: Ferret enteric coronavirus causes a gastrointestinal syndrome known as epizootic catarrhal enteritis (ECE), and a more lethal systemic version of the virus (like FIP in cats) known as ferret systemic coronavirus (FSC). There are two types of canine coronavirus (CCoV), one that causes mild gastrointestinal disease and one that has been found to cause respiratory disease. Mouse hepatitis virus (MHV) is a coronavirus that causes an epidemic murine illness with high mortality, especially among colonies of laboratory mice. Sialodacryoadenitis virus (SDAV) is highly infectious coronavirus of laboratory rats, which can be transmitted between individuals by direct contact and indirectly by aerosol. Acute infections have high morbidity and tropism for the salivary, lachrymal and harderian glands.A HKU2-related bat coronavirus called swine acute diarrhea syndrome coronavirus (SADS-CoV) causes diarrhea in pigs.Prior to the discovery of SARS-CoV, MHV had been the best-studied coronavirus both in vivo and in vitro as well as at the molecular level. Some strains of MHV cause a progressive demyelinating encephalitis in mice which has been used as a murine model for multiple sclerosis. Significant research efforts have been focused on elucidating the viral pathogenesis of these animal coronaviruses, especially by virologists interested in veterinary and zoonotic diseases.\n",
"\n",
"\n",
"=== In domestic animals ===\n",
"Infectious bronchitis virus (IBV) causes avian infectious bronchitis.\n",
"Porcine coronavirus (transmissible gastroenteritis coronavirus of pigs, TGEV).\n",
"Bovine coronavirus (BCV), responsible for severe profuse enteritis in of young calves.\n",
"Feline coronavirus (FCoV) causes mild enteritis in cats as well as severe Feline infectious peritonitis (other variants of the same virus).\n",
"the two types of canine coronavirus (CCoV) (one causing enteritis, the other found in respiratory diseases).\n",
"Turkey coronavirus (TCV) causes enteritis in turkeys.\n",
"Ferret enteric coronavirus causes epizootic catarrhal enteritis in ferrets.\n",
"Ferret systemic coronavirus causes FIP-like systemic syndrome in ferrets.\n",
"Pantropic canine coronavirus.\n",
"Rabbit enteric coronavirus causes acute gastrointestinal disease and diarrhea in young European rabbits. Mortality rates are high.\n",
"Porcine epidemic diarrhea virus (PED or PEDV), has emerged around the world.\n",
"\n",
"\n",
"== Genomic cis-acting elements ==\n",
"In common with the genomes of all other RNA viruses, coronavirus genomes contain cis-acting RNA elements that ensure the specific replication of viral RNA by a virally encoded RNA-dependent RNA polymerase. The embedded cis-acting elements devoted to coronavirus replication constitute a small fraction of the total genome, but this is presumed to be a reflection of the fact that coronaviruses have the largest genomes of all RNA viruses. The boundaries of cis-acting elements essential to replication are fairly well-defined, and the RNA secondary structures of these regions are understood. However, how these cis-acting structures and sequences interact with the viral replicase and host cell components to allow RNA synthesis is not well understood.\n",
"\n",
"\n",
"== Genome packaging ==\n",
"The assembly of infectious coronavirus particles requires the selection of viral genomic RNA from a cellular pool that contains an abundant excess of non-viral and viral RNAs. Among the seven to ten specific viral mRNAs synthesized in virus-infected cells, only the full-length genomic RNA is packaged efficiently into coronavirus particles. Studies have revealed cis-acting elements and trans-acting viral factors involved in the coronavirus genome encapsidation and packaging. Understanding the molecular mechanisms of genome selection and packaging is critical for developing antiviral strategies and viral expression vectors based on the coronavirus genome.\n",
"\n",
"\n",
"== See also ==\n",
"\n",
"Bat-borne virus\n",
"Zoonosis\n",
"\n",
"\n",
"== References ==\n",
"\n",
"\n",
"== Further reading ==\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "bqvj8glX4cF4",
"colab_type": "text"
},
"source": [
"\n",
"\n",
"> **Hint**: You can get the content of the entire page using the above method\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ILZYEymU4enU",
"colab_type": "text"
},
"source": [
"## Images\n",
"\n",
"Yes, you are right we can get the images from the Wikipedia article. But the catch point here is, we can’t render the whole images here but we can get them as URL’s as shown below:\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "YqcEcBXJ4iHf",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 55
},
"outputId": "f0893032-2e78-4617-dcaf-1ce5e2356480"
},
"source": [
"print(covid.images)"
],
"execution_count": 18,
"outputs": [
{
"output_type": "stream",
"text": [
"['https://upload.wikimedia.org/wikipedia/commons/8/82/SARS-CoV-2_without_background.png', 'https://upload.wikimedia.org/wikipedia/commons/9/96/3D_medical_animation_coronavirus_structure.jpg', 'https://upload.wikimedia.org/wikipedia/commons/f/f4/Coronavirus_replication.png', 'https://upload.wikimedia.org/wikipedia/commons/e/e5/Coronavirus_virion_structure.svg', 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Phylogenetic_tree_of_coronaviruses.jpg', 'https://upload.wikimedia.org/wikipedia/commons/7/74/Red_Pencil_Icon.png', 'https://upload.wikimedia.org/wikipedia/commons/8/82/SARS-CoV-2_without_background.png', 'https://upload.wikimedia.org/wikipedia/commons/1/11/SARS-CoV_MERS-CoV_genome_organization_and_S-protein_domains.png', 'https://upload.wikimedia.org/wikipedia/commons/2/2f/Sida-aids.png', 'https://upload.wikimedia.org/wikipedia/commons/d/d6/WHO_Rod.svg', 'https://upload.wikimedia.org/wikipedia/commons/9/99/Wiktionary-logo-en-v2.svg', 'https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg', 'https://upload.wikimedia.org/wikipedia/commons/7/78/Coronaviruses_004_lores.jpg', 'https://upload.wikimedia.org/wikipedia/en/8/8c/Extended-protection-shackle.svg']\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ZiwtWUh24ke_",
"colab_type": "text"
},
"source": [
"## Links\n",
"Similarly, we can get the links that Wikipedia used as a reference from different websites or research, etc."
]
},
{
"cell_type": "code",
"metadata": {
"id": "A9ABv9rU4mW1",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 55
},
"outputId": "144e5d54-29a8-4ba6-e616-bc9dc929f17c"
},
"source": [
"print(covid.links)"
],
"execution_count": 19,
"outputs": [
{
"output_type": "stream",
"text": [
"['2002–2004 SARS outbreak', '2012 Middle East respiratory syndrome coronavirus outbreak', '2015 Middle East respiratory syndrome outbreak in South Korea', '2018 Middle East respiratory syndrome outbreak', '2019–2020 coronavirus pandemic', '2019–20 coronavirus pandemic', 'Acute bronchitis', 'Adenoid', 'Adenoviridae', 'Adenovirus infection', 'Adult T-cell leukemia/lymphoma', 'Alpaca', 'Alphacoronavirus', 'Anal cancer', 'Ancient Greek', 'Angiotensin-converting enzyme 2', 'Anorexia (symptom)', 'Antiviral drug', 'Arbovirus encephalitis', 'Astrovirus', 'Avian infectious bronchitis', 'Avian infectious bronchitis virus', 'Avian influenza', 'BCE', 'BK virus', 'Bacterial pneumonia', 'Bat', 'Bat-borne virus', 'Bead', 'Beluga whale coronavirus SW1', 'Betacoronavirus', 'Betacoronavirus 1', 'Bibcode', 'Birds', 'Bovine coronavirus', 'Bronchiolitis', 'Bronchitis', 'Bulbul coronavirus HKU11', \"Burkitt's lymphoma\", 'Canine coronavirus', 'Capsid', 'Cardiovascular disease', 'Central nervous system viral disease', 'Cervical cancer', 'Chandipura vesiculovirus', 'China', 'Christian Drosten', 'Cis-acting', 'Civet', 'Common cold', 'Complication (medicine)', 'Corona', 'Coronaviridae', 'Coronavirus disease 2019', 'Cough', 'Coxsackie B virus', 'Croup', 'Cytomegalovirus', 'Cytomegalovirus esophagitis', 'Cytomegalovirus retinitis', 'Cytoplasm', 'DNA replication', 'DNA virus', 'Deltacoronavirus', 'Diarrhea', 'Digital object identifier', 'Dyspnea', 'Electron microscope', 'Electron microscopy', 'Embecovirus', 'Encapsidation', 'Encephalitis lethargica', 'Encyclopedia of Life', 'Endocytosis', 'Endoplasmic reticulum', 'Enterovirus', 'Enveloped virus', 'Epstein–Barr virus', 'Epstein–Barr virus infection', 'Erasmus MC', 'Esophagus', 'European rabbits', 'Exocytosis', 'Exoribonuclease', 'Extranodal NK/T-cell lymphoma, nasal type', 'Eye disease', 'Fatigue (medical)', 'Feline coronavirus', 'Feline infectious peritonitis', 'Ferret', 'Fever', 'Five-prime cap', 'Five prime untranslated region', 'Follicular dendritic cell sarcoma', 'GB virus C', 'Gammacoronavirus', 'Gastroenteritis', 'Gastrointestinal tract', 'Genitourinary system', 'Genome', 'Genome size', 'HIV', 'HIV/AIDS', 'HPV-positive oropharyngeal cancer', 'Harderian gland', 'Headache', 'Hedgehog coronavirus 1', 'Hemagglutinin esterase', 'Hepacivirus C', 'Hepatitis A', 'Hepatitis B', 'Hepatitis B virus', 'Hepatitis C', 'Hepatitis D', 'Hepatitis E', 'Hepatocellular carcinoma', 'Herpes simplex keratitis', 'Herpes simplex virus', 'Herpesviral meningitis', 'Hipposideridae', \"Hodgkin's lymphoma\", 'Host (biology)', 'Host tropism', 'Huanan Seafood Wholesale Market', 'Human T-lymphotropic virus 1', 'Human coronavirus 229E', 'Human coronavirus HKU1', 'Human coronavirus NL63', 'Human coronavirus OC43', 'Human digestive system', 'Human metapneumovirus', 'Human orthopneumovirus', 'Human parainfluenza viruses', 'Human polyomavirus 2', 'ICD-10', 'ICD-10 Chapter I: Certain infectious and parasitic diseases', 'Immune disorder', 'Incertae sedis', 'Infection', 'Infectious bronchitis virus', 'Infectious mononucleosis', 'Infectivity', 'Influenza', 'Influenza A virus', 'Influenza B virus', 'Influenza C virus', 'Influenza D virus', 'Interim Register of Marine and Nonmarine Genera', 'International Committee on Taxonomy of Viruses', 'International Standard Book Number', 'International Standard Serial Number', 'International Statistical Classification of Diseases and Related Health Problems', 'Intestinal', \"Kaposi's sarcoma\", \"Kaposi's sarcoma-associated herpesvirus\", 'Kilobase', 'Lipid bilayer', 'List of ICD-9 codes 001–139: infectious and parasitic diseases', 'Lower respiratory tract infection', 'Lymphocytic choriomeningitis', 'MERS-CoV', 'Malaise', 'Mammals', 'Measles morbillivirus', 'Merkel-cell carcinoma', 'Merkel cell polyomavirus', 'Messenger RNA', 'Middle East respiratory syndrome', 'Middle East respiratory syndrome-related coronavirus', 'Miniopterus bat coronavirus 1', 'Miniopterus bat coronavirus HKU8', 'Morbidity', 'Morphology (biology)', 'Most recent common ancestor', 'Mouse hepatitis virus', 'Multiple sclerosis', 'Mumps', 'Mumps rubulavirus', 'Murinae', 'Murine coronavirus', 'Mutation', 'Myalgia', 'Myelitis', 'Myocarditis', 'Nasal congestion', 'Nasopharyngeal carcinoma', 'National Center for Biotechnology Information', 'Nidovirales', 'Norovirus', 'Nucleic acid secondary structure', 'Nucleocapsid', 'Oncovirus', 'Orthohepevirus A', 'Orthomyxoviridae', 'Otitis media', 'Outbreaks', 'Pancreatitis', 'Papillomaviridae', 'Paramyxoviridae', 'Penile cancer', 'Peplomer', 'Pericarditis', 'Pharyngitis', 'Pharynx', 'Pipistrellus bat coronavirus HKU5', 'Pleconaril', 'Pleomorphism (microbiology)', 'Pneumonia', 'Polio', 'Poliovirus', 'Polyadenylation', 'Popular Science', 'Porcine', 'Porcine coronavirus HKU15', 'Porcine epidemic diarrhea virus', 'Positive-sense single-stranded RNA virus', 'Post-polio syndrome', 'Progressive multifocal leukoencephalopathy', 'Proofreading (biology)', 'Protease', 'Protein', 'Protein complex', 'Proteins', 'Proteolysis', 'PubMed Central', 'PubMed Identifier', 'RNA', 'RNA-dependent RNA polymerase', 'RNA virus', 'Rabies', 'Rabies virus', 'Ramsay Hunt syndrome type 2', 'Reading frame', 'Republic of Korea', 'Respiratory droplet', 'Respiratory system', 'Respiratory tract infection', 'Respiratory tract infections', 'Rhinolophidae', 'Rhinolophus bat coronavirus HKU2', 'Rhinorrhea', 'Rhinovirus', 'Ribosome', 'Riboviria', 'Rotavirus', 'Rousettus bat coronavirus HKU9', 'SARS-CoV-2', 'SARS coronavirus', 'Science (journal)', 'Scotophilus bat coronavirus 512', 'Severe acute respiratory syndrome', 'Severe acute respiratory syndrome-related coronavirus', 'Severe acute respiratory syndrome coronavirus', 'Severe acute respiratory syndrome coronavirus 2', 'Sinusitis', 'Sneeze', 'Solar corona', 'Sore throat', 'Splenic marginal zone lymphoma', 'Streptococcal pharyngitis', 'Structural proteins', 'Subacute sclerosing panencephalitis', 'Subfamily', 'Susan Baker (virologist)', 'Swine acute diarrhea syndrome coronavirus', 'Symptom', 'Synonym (taxonomy)', 'The New York Times', 'Three prime untranslated region', 'Tissue tropism', 'Transcription (biology)', 'Transmissible gastroenteritis coronavirus', 'Transmission electron micrograph', 'Transmission electron microscopy', 'Tropical spastic paraparesis', 'Tropism', 'Tunisia', 'Turkey coronavirus', 'Turkeys', 'Tylonycteris bat coronavirus HKU4', 'Uncoating', 'Upper respiratory tract', 'Upper respiratory tract infection', 'Urogenital tract', 'Vaccine', 'Vaginal cancer', 'Vesicular-tubular cluster', 'Veterinary medicine', 'Viral disease', 'Viral encephalitis', 'Viral entry', 'Viral envelope', 'Viral hepatitis', 'Viral meningitis', 'Viral pathogenesis', 'Viral pneumonia', 'Viral shedding', 'Virion', 'Virologist', 'Virus', 'Virus classification', 'Vulvar cancer', 'Wayback Machine', 'Weakness', 'Wikidata', 'Wikispecies', 'World Health Organization', 'Wuhan', 'Zoonosis', 'Zoonotic']\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "dje7G6OJ4noc",
"colab_type": "text"
},
"source": [
"\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "T2lXTaHC4oOF",
"colab_type": "text"
},
"source": [
"So, there you go, you have reached the end of the tutorial of Wikipedia API for Python. To know more methods visit [Wikipedia API](https://wikipedia.readthedocs.io/en/latest/code.html#api). I hope you guys had a lot of fun learning and implementing. If you guys have any comments or concerns let me know via the comment section below. Until then Good-Bye.\n",
"\n",
"\n",
"# Be Safe.\n",
"\n"
]
}
]
}