Make Fake Album Cover Game

Table of Contents

Our goal is to create randomly generated album covers with:


Inspiration: Fake Album Covers

Import libraries


In [1]:
from IPython.display import Image as IPythonImage
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw

Helper function to superimpose text on image


In [2]:
def display_cover(top,bottom ):
    """This fucntoin
    """
    import requests
    
    name='album_art_raw.png'
    # Now let's make get an album cover.
    # https://picsum.photos/ is a free service that offers random images.
    # Let's get a random image:
    album_art_raw = requests.get('https://picsum.photos/500/500/?random')
    # and save it as 'album_art_raw.png'
    with open(name,'wb') as album_art_raw_file:
       album_art_raw_file.write(album_art_raw.content)
    # Now that we have our raw image, let's open it 
    # and write our band and album name on it
    img = Image.open("album_art_raw.png")
    draw = ImageDraw.Draw(img)

    # We'll choose a font for our band and album title, 
    # run "% ls /usr/share/fonts/truetype/dejavu" in a cell to see what else is available,
    # or download your own .ttf fonts!
    band_name_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 25) #25pt font
    album_name_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 20) # 20pt font

    # the x,y coordinates for where our album name and band name text will start
    # counted from the top left of the picture (in pixels)
    band_x, band_y = 50, 50
    album_x, album_y = 50, 400

    # Our text should be visible on any image. A good way
    # of accomplishing that is to use white text with a 
    # black border. We'll use the technique shown here to draw the border:
    # https://mail.python.org/pipermail/image-sig/2009-May/005681.html
    outline_color ="black"

    draw.text((band_x-1, band_y-1), top, font=band_name_font, fill=outline_color)
    draw.text((band_x+1, band_y-1), top, font=band_name_font, fill=outline_color)
    draw.text((band_x-1, band_y+1), top, font=band_name_font, fill=outline_color)
    draw.text((band_x+1, band_y+1), top, font=band_name_font, fill=outline_color)

    draw.text((album_x-1, album_y-1), bottom , font=album_name_font, fill=outline_color)
    draw.text((album_x+1, album_y-1), bottom , font=album_name_font, fill=outline_color)
    draw.text((album_x-1, album_y+1), bottom , font=album_name_font, fill=outline_color)
    draw.text((album_x+1, album_y+1), bottom , font=album_name_font, fill=outline_color)

    draw.text((band_x,band_y),top,(255,255,255),font=band_name_font)
    draw.text((album_x, album_y),bottom,(255,255,255),font=album_name_font)

    return img

1) Learn how to use the function display_cover

The function display_cover selects a random image from https://picsum.photos/ and will help us superimpose two strings over the image. The parameter top is the string we would like to superimpose on the top of an image. The parameter bottom is the string we would like to display on the bottom of the image. The function does not return the image but returns an object of type Image from the Pillow library; the object represents a PIL image.


In [9]:
img=display_cover(top='top',bottom='bottom')

To save the image, we use the method save . The argument is the file name of the image we would like to save in this case 'sample-out.png'


In [10]:
img.save('sample-out.png')

Finely we use IPythonImage to read the image file and display the results.


In [11]:
IPythonImage(filename='sample-out.png')


Out[11]:

Question 1) Use the display_cover function to display the image with the name Python on the top and Data Science on the bottom. Save the image as 'sample-out.png'.


In [14]:
img=display_cover(top='Python',bottom='Data Science')
img.save('sample-out.png')
IPythonImage(filename='sample-out.png')


Out[14]:

In [15]:
print("Question 1 Completed")


Question 1 Completed

Part 2: Loading a random page from Wikipedia

In this project, we will use the request library, we used it in the function display_cover, but you should import the library in the next cell.


In [16]:
import requests

The following is the URL to the page


In [17]:
wikipedia_link='https://en.wikipedia.org/wiki/Special:Random'

Question 2) Get Wikipedia page is converted to a string

Use the function get from the requests library to download the Wikipedia page using the wikipedia_link as an argument. Assign the object to the variable raw_random_wikipedia_page.


In [21]:
#hint: requests.get()
wiki_page = requests.get(wikipedia_link)

Use the data attribute text to extract the XML as a text file a string and assign the result variable page:


In [20]:
page = wiki_page.text
print(page)


<!DOCTYPE html>
<html class="client-nojs" lang="en" dir="ltr">
<head>
<meta charset="UTF-8"/>
<title>Yuta Togashi - Wikipedia</title>
<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>
<script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Yuta_Togashi","wgTitle":"Yuta Togashi","wgCurRevisionId":879029683,"wgRevisionId":879029683,"wgArticleId":51813051,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Articles with Japanese-language external links","Articles containing Japanese-language text","J.League player template with ID same as Wikidata","All stub articles","1995 births","Living people","Association football people from Tokyo","Japanese footballers","J3 League players","FC Ryukyu players","FC Gifu players","Association football forwards","Japanese football forward stubs"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Yuta_Togashi","wgRelevantArticleId":51813051,"wgRequestId":"XFC4XgpAIDAAAI9it7AAAAAR","wgCSPNonce":false,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgFlaggedRevsParams":{"tags":{}},"wgStableRevisionId":null,"wgCategoryTreePageCategoryOptions":"{\"mode\":0,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}","wgWikiEditorEnabledModules":[],"wgBetaFeaturesFeatures":[],"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsShouldSendModuleToUser":true,"wgPopupsConflictsWithNavPopupGadget":false,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en","usePageImages":true,"usePageDescriptions":true},"wgMFExpandAllSectionsUserOption":true,"wgMFEnableFontChanger":true,"wgMFDisplayWikibaseDescriptions":{"search":true,"nearby":true,"watchlist":true,"tagline":false},"wgRelatedArticles":null,"wgRelatedArticlesUseCirrusSearch":true,"wgRelatedArticlesOnlyUseCirrusSearch":false,"wgWMESchemaEditAttemptStepOversample":false,"wgPoweredByHHVM":true,"wgULSCurrentAutonym":"English","wgNoticeProject":"wikipedia","wgCentralNoticeCookiesToDelete":[],"wgCentralNoticeCategoriesUsingLegacy":["Fundraising","fundraising"],"wgWikibaseItemId":"Q24088415","wgScoreNoteLanguages":{"arabic":"العربية","catalan":"català","deutsch":"Deutsch","english":"English","espanol":"español","italiano":"italiano","nederlands":"Nederlands","norsk":"norsk","portugues":"português","suomi":"suomi","svenska":"svenska","vlaams":"West-Vlams"},"wgScoreDefaultNoteLanguage":"nederlands","wgCentralAuthMobileDomain":false,"wgCodeMirrorEnabled":true,"wgVisualEditorToolbarScrollOffset":0,"wgVisualEditorUnsupportedEditParams":["undo","undoafter","veswitched"],"wgEditSubmitButtonLabelPublish":true,"oresWikiId":"enwiki","oresBaseUrl":"http://ores.discovery.wmnet:8081/","oresApiVersion":3});mw.loader.state({"ext.gadget.charinsert-styles":"ready","ext.globalCssJs.user.styles":"ready","ext.globalCssJs.site.styles":"ready","site.styles":"ready","noscript":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","ext.globalCssJs.site":"ready","user":"ready","user.options":"ready","user.tokens":"loading","ext.cite.styles":"ready","mediawiki.legacy.shared":"ready","mediawiki.legacy.commonPrint":"ready","wikibase.client.init":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","ext.wikimediaBadges":"ready","ext.3d.styles":"ready","mediawiki.skinning.interface":"ready","skins.vector.styles":"ready"});mw.loader.implement("user.tokens@0tffind",function($,jQuery,require,module){/*@nomin*/mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});
});RLPAGEMODULES=["ext.cite.ux-enhancements","site","mediawiki.page.startup","mediawiki.page.ready","mediawiki.searchSuggest","ext.gadget.teahouse","ext.gadget.ReferenceTooltips","ext.gadget.watchlist-notice","ext.gadget.DRN-wizard","ext.gadget.charinsert","ext.gadget.refToolbar","ext.gadget.extra-toolbar-buttons","ext.gadget.switcher","ext.centralauth.centralautologin","mmv.head","mmv.bootstrap.autostart","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.eventlogger","ext.uls.init","ext.uls.compactlinks","ext.uls.interface","ext.quicksurveys.init","ext.centralNotice.geoIP","ext.centralNotice.startUp","skins.vector.js"];mw.loader.load(RLPAGEMODULES);});</script>
<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=ext.3d.styles%7Cext.cite.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cskins.vector.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector"/>
<script async="" src="/w/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=vector"></script>
<meta name="ResourceLoaderDynamicStyles" content=""/>
<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=ext.gadget.charinsert-styles&amp;only=styles&amp;skin=vector"/>
<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=vector"/>
<meta name="generator" content="MediaWiki 1.33.0-wmf.14"/>
<meta name="referrer" content="origin"/>
<meta name="referrer" content="origin-when-crossorigin"/>
<meta name="referrer" content="origin-when-cross-origin"/>
<link rel="alternate" href="android-app://org.wikipedia/http/en.m.wikipedia.org/wiki/Yuta_Togashi"/>
<link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Yuta_Togashi&amp;action=edit"/>
<link rel="edit" title="Edit this page" href="/w/index.php?title=Yuta_Togashi&amp;action=edit"/>
<link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"/>
<link rel="shortcut icon" href="/static/favicon/wikipedia.ico"/>
<link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikipedia (en)"/>
<link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"/>
<link rel="license" href="//creativecommons.org/licenses/by-sa/3.0/"/>
<link rel="canonical" href="https://en.wikipedia.org/wiki/Yuta_Togashi"/>
<link rel="dns-prefetch" href="//login.wikimedia.org"/>
<link rel="dns-prefetch" href="//meta.wikimedia.org" />
<!--[if lt IE 9]><script src="/w/load.php?debug=false&amp;lang=en&amp;modules=html5shiv&amp;only=scripts&amp;skin=vector&amp;sync=1"></script><![endif]-->
</head>
<body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Yuta_Togashi rootpage-Yuta_Togashi skin-vector action-view">		<div id="mw-page-base" class="noprint"></div>
		<div id="mw-head-base" class="noprint"></div>
		<div id="content" class="mw-body" role="main">
			<a id="top"></a>
			<div id="siteNotice" class="mw-body-content"><!-- CentralNotice --></div><div class="mw-indicators mw-body-content">
</div>
<h1 id="firstHeading" class="firstHeading" lang="en">Yuta Togashi</h1>			<div id="bodyContent" class="mw-body-content">
				<div id="siteSub" class="noprint">From Wikipedia, the free encyclopedia</div>				<div id="contentSub"></div>
				<div id="jump-to-nav"></div>				<a class="mw-jump-link" href="#mw-head">Jump to navigation</a>
				<a class="mw-jump-link" href="#p-search">Jump to search</a>
				<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><table class="infobox vcard" style="width:22em;line-height: 1.2em"><caption class="fn" style="line-height: 1.5em; text-align: center;">Yuta Togashi <br /> 富樫 佑太</caption><tbody><tr><th colspan="4" style="text-align:center;background-color: #b0c4de; line-height: 1.5em">Personal information</th></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Full name</th><td colspan="3" class="nickname" style="white-space: nowrap; vertical-align: baseline">
<span style="white-space:normal;">Yuta Togashi</span></td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Date of birth</th><td colspan="3" style="white-space: nowrap; vertical-align: baseline">
<span style="display:none"> (<span class="bday">1995-12-18</span>) </span>December 18, 1995<span class="noprint ForceAgeToShow"> (age&#160;23)</span></td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Place of birth</th><td colspan="3" class="birthplace" style="white-space: nowrap; vertical-align: baseline">
<a href="/wiki/Tokyo" title="Tokyo">Tokyo</a>, Japan</td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Height</th><td colspan="3" style="white-space: nowrap; vertical-align: baseline">
1.73&#160;m (5&#160;ft 8&#160;in)</td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Playing position</th><td colspan="3" class="role" style="white-space: nowrap; vertical-align: baseline">
<a href="/wiki/Forward_(association_football)" title="Forward (association football)">Forward</a></td></tr><tr><th colspan="4" style="text-align:center;background-color: #b0c4de; line-height: 1.5em">Club information</th></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left"><div style="padding:0.1em 0;line-height:1.2em;">Current team</div></th><td colspan="3" class="org" style="white-space: nowrap; vertical-align: baseline">
<a href="/wiki/FC_Gifu" title="FC Gifu">FC Gifu</a></td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Number</th><td colspan="3" style="white-space: nowrap; vertical-align: baseline">
16</td></tr><tr><th colspan="4" style="text-align:center;background-color: #b0c4de; line-height: 1.5em">Youth career</th></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left"><span style="font-weight:normal">2011–2013</span></th><td colspan="3" style="white-space: nowrap; vertical-align: baseline">
Kokugakuin Kugayama</td></tr><tr><th colspan="4" style="text-align:center;background-color: #b0c4de; line-height: 1.5em">Senior career*</th></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left">Years</th><td style="white-space: nowrap; vertical-align: baseline">
<b>Team</b></td><td style="white-space: nowrap; vertical-align: baseline;text-align: right">
<b><abbr title="League appearances">Apps</abbr></b></td><td style="white-space: nowrap; vertical-align: baseline; text-align: right">
<b>(<abbr title="League goals">Gls</abbr>)</b></td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left"><span style="font-weight:normal">2014–2015</span></th><td style="white-space: nowrap; vertical-align: baseline">
<a href="/wiki/Hurac%C3%A1n_Valencia_CF" title="Huracán Valencia CF">Huracán Valencia CF</a></td><td style="white-space: nowrap; vertical-align: baseline;text-align: right">
</td><td style="white-space: nowrap; vertical-align: baseline; text-align: right">
</td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left"><span style="font-weight:normal">2015–2018</span></th><td style="white-space: nowrap; vertical-align: baseline">
<a href="/wiki/FC_Ryukyu" title="FC Ryukyu">FC Ryukyu</a></td><td style="white-space: nowrap; vertical-align: baseline;text-align: right">
86</td><td style="white-space: nowrap; vertical-align: baseline; text-align: right">
(22)</td></tr><tr><th scope="row" style="white-space: nowrap; vertical-align: baseline; text-align: left"><span style="font-weight:normal">2019–</span></th><td style="white-space: nowrap; vertical-align: baseline">
<a href="/wiki/FC_Gifu" title="FC Gifu">FC Gifu</a></td><td style="white-space: nowrap; vertical-align: baseline;text-align: right">
</td><td style="white-space: nowrap; vertical-align: baseline; text-align: right">
</td></tr><tr><td colspan="4" style="text-align:center;color:darkslategray; font-size:95%">
* Senior club appearances and goals counted for the domestic league only&#32;and correct as of 5 January 2019</td></tr></tbody></table>
<p><b>Yuta Togashi</b><span style="font-weight: normal">&#32;(<span lang="ja">富樫 佑太</span><span style="display:none">,</span>&#32;<i>Togashi Yūta</i>, born December 18, 1995)</span> is a Japanese <a href="/wiki/Association_football" title="Association football">football</a> player.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup> He plays for <a href="/wiki/FC_Gifu" title="FC Gifu">FC Gifu</a>.
</p>
<h2><span class="mw-headline" id="Club_statistics">Club statistics</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Yuta_Togashi&amp;action=edit&amp;section=1" title="Edit section: Club statistics">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p><i>Updated to 23 February 2018</i>.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#91;2&#93;</a></sup><sup id="cite_ref-3" class="reference"><a href="#cite_note-3">&#91;3&#93;</a></sup>
</p>
<table class="wikitable" style="text-align:center;">

<tbody><tr>
<th colspan="3">Club performance
</th>
<th colspan="2">League
</th>
<th colspan="2">Cup
</th>
<th colspan="2">Total
</th></tr>
<tr>
<th>Season
</th>
<th>Club
</th>
<th>League
</th>
<th>Apps</th>
<th>Goals
</th>
<th>Apps</th>
<th>Goals
</th>
<th>Apps</th>
<th>Goals
</th></tr>
<tr>
<th colspan="3">Japan
</th>
<th colspan="2">League
</th>
<th colspan="2"><a href="/wiki/Emperor%27s_Cup" title="Emperor&#39;s Cup">Emperor's Cup</a>
</th>
<th colspan="2">Total
</th></tr>
<tr>
<td><a href="/wiki/2015_J3_League" title="2015 J3 League">2015</a></td>
<td rowspan="3"><a href="/wiki/FC_Ryukyu" title="FC Ryukyu">FC Ryukyu</a></td>
<td rowspan="3"><a href="/wiki/J3_League" title="J3 League">J3 League</a></td>
<td>9</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>9</td>
<td>0
</td></tr>
<tr>
<td><a href="/wiki/2016_J3_League" title="2016 J3 League">2016</a></td>
<td>18</td>
<td>4</td>
<td>2</td>
<td>0</td>
<td>20</td>
<td>4
</td></tr>
<tr>
<td><a href="/wiki/2016_J3_League" title="2016 J3 League">2016</a></td>
<td>27</td>
<td>2</td>
<td>1</td>
<td>1</td>
<td>29</td>
<td>3
</td></tr>
<tr>
<th colspan="3">Total
</th>
<th>54</th>
<th>6</th>
<th>3</th>
<th>1</th>
<th>58</th>
<th>7
</th></tr></tbody></table>
<h2><span class="mw-headline" id="References">References</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Yuta_Togashi&amp;action=edit&amp;section=2" title="Edit section: References">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<div class="reflist" style="list-style-type: decimal;">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://data.j-league.or.jp/SFIX04/?player_id=15876">J.League Data Site</a><span class="languageicon">(in Japanese)</span></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text">Nippon Sports Kikaku Publishing inc./日本スポーツ企画出版社, <a rel="nofollow" class="external text" href="https://www.amazon.co.jp/J1-J3%E9%81%B8%E6%89%8B%E5%90%8D%E9%91%91%E3%83%8F%E3%83%B3%E3%83%87%E3%82%A3%E7%89%88-2018-NSK-MOOK/dp/4905411521">"J1&amp;J2&amp;J3選手名鑑ハンディ版 2018 (NSK MOOK)"</a>, 7 February 2018, Japan, <style data-mw-deduplicate="TemplateStyles:r879151008">.mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}</style><a href="/wiki/International_Standard_Book_Number" title="International Standard Book Number">ISBN</a>&#160;<a href="/wiki/Special:BookSources/978-4905411529" title="Special:BookSources/978-4905411529">978-4905411529</a> (p. 257 out of 289)</span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text">Nippon Sports Kikaku Publishing inc./日本スポーツ企画出版社, <a rel="nofollow" class="external text" href="https://www.amazon.co.jp/2017-J1-J3%E9%81%B8%E6%89%8B%E5%90%8D%E9%91%91-NSK-MOOK/dp/4905411424/ref=pd_sim_14_1/356-9491148-0114816?_encoding=UTF8&amp;psc=1&amp;refRID=BA8BN4Y0F97GNWKQM78H">"2017 J1&amp;J2&amp;J3選手名鑑 (NSK MOOK)"</a>, 8 February 2017, Japan, <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r879151008"/><a href="/wiki/International_Standard_Book_Number" title="International Standard Book Number">ISBN</a>&#160;<a href="/wiki/Special:BookSources/978-4905411420" title="Special:BookSources/978-4905411420">978-4905411420</a> (p. 261 out of 289)</span>
</li>
</ol></div></div>
<h2><span class="mw-headline" id="External_links">External links</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Yuta_Togashi&amp;action=edit&amp;section=3" title="Edit section: External links">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<ul><li><a rel="nofollow" class="external text" href="http://fcryukyu.com/profile/2017/player_09.php">Profile at FC Ryukyu</a></li>
<li><a rel="nofollow" class="external text" href="https://data.j-league.or.jp/SFIX04/?player_id=15876">Yuta Togashi</a> at <a href="/wiki/J.League" title="J.League">J.League</a> <span class="languageicon">(in Japanese)</span></li></ul>
<div role="navigation" class="navbox" aria-labelledby="FC_Gifu_–_current_squad" style="padding:3px"><table class="nowraplinks vcard collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2" style="background:#2E8B57; color:#fff; border:1px solid #228B22; width:87%;"><div class="plainlinks hlist navbar mini"><ul><li class="nv-view"><a href="/wiki/Template:FC_Gifu_squad" title="Template:FC Gifu squad"><abbr title="View this template" style=";background:#2E8B57; color:#fff; border:1px solid #228B22; width:87%;;background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none; padding:0;">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:FC_Gifu_squad" title="Template talk:FC Gifu squad"><abbr title="Discuss this template" style=";background:#2E8B57; color:#fff; border:1px solid #228B22; width:87%;;background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none; padding:0;">t</abbr></a></li><li class="nv-edit"><a class="external text" href="//en.wikipedia.org/w/index.php?title=Template:FC_Gifu_squad&amp;action=edit"><abbr title="Edit this template" style=";background:#2E8B57; color:#fff; border:1px solid #228B22; width:87%;;background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none; padding:0;">e</abbr></a></li></ul></div><div id="FC_Gifu_–_current_squad" class="fn org" style="font-size:114%;margin:0 4em"><a href="/wiki/FC_Gifu" title="FC Gifu"><span style="color:#fff;">FC Gifu</span></a> <span style="color:#fff;"> &#8211; current squad</span></div></th></tr><tr><td colspan="2" class="navbox-list navbox-odd hlist" style="width:100%;padding:0px"><div style="padding:0em 0.25em"><div>
<ul><li><span class="agent vcard">1&#160;<span class="fn"><a href="/w/index.php?title=Michiya_Okamoto&amp;action=edit&amp;redlink=1" class="new" title="Michiya Okamoto (page does not exist)">Okamoto</a></span></span></li>
<li><span class="agent vcard">2&#160;<span class="fn"><a href="/wiki/Masanori_Abe" title="Masanori Abe">Abe</a></span></span></li>
<li><span class="agent vcard">3&#160;<span class="fn"><a href="/wiki/Tadashi_Takeda" title="Tadashi Takeda">Takeda</a></span></span></li>
<li><span class="agent vcard">4&#160;<span class="fn"><a href="/wiki/Kentaro_Kai" title="Kentaro Kai">Kai</a></span></span></li>
<li><span class="agent vcard">5&#160;<span class="fn"><a href="/wiki/Shota_Kawanishi" title="Shota Kawanishi">Kawanishi</a></span></span></li>
<li><span class="agent vcard">6&#160;<span class="fn"><a href="/wiki/Shohei_Mishima" title="Shohei Mishima">Mishima</a></span></span></li>
<li><span class="agent vcard">7&#160;<span class="fn"><a href="/wiki/Toma_Murata" title="Toma Murata">Murata</a></span></span></li>
<li><span class="agent vcard">8&#160;<span class="fn"><a href="/wiki/Fr%C3%A9d%C3%A9ric_Bulot" title="Frédéric Bulot">Frédéric</a></span></span></li>
<li><span class="agent vcard">9&#160;<span class="fn"><a href="/wiki/Yuya_Yamagishi" title="Yuya Yamagishi">Yamagishi</a></span></span></li>
<li><span class="agent vcard">10&#160;<span class="fn"><a href="/wiki/Ryan_De_Vries" title="Ryan De Vries">De Vries</a></span></span></li>
<li><span class="agent vcard">11&#160;<span class="fn"><a href="/wiki/Ryoichi_Maeda" title="Ryoichi Maeda">Maeda</a></span></span></li>
<li><span class="agent vcard">14&#160;<span class="fn"><a href="/wiki/Koya_Kazama" title="Koya Kazama">Kazama</a></span></span></li>
<li><span class="agent vcard">15&#160;<span class="fn"><a href="/w/index.php?title=Yuki_Aizu&amp;action=edit&amp;redlink=1" class="new" title="Yuki Aizu (page does not exist)">Aizu</a></span></span></li>
<li><span class="agent vcard">16&#160;<span class="fn"><a class="mw-selflink selflink">Togashi</a></span></span></li>
<li><span class="agent vcard">17&#160;<span class="fn"><a href="/w/index.php?title=Takumi_Fujitani&amp;action=edit&amp;redlink=1" class="new" title="Takumi Fujitani (page does not exist)">Fujitani</a></span></span></li>
<li><span class="agent vcard">18&#160;<span class="fn"><a href="/wiki/Daichi_Ishikawa" title="Daichi Ishikawa">Ishikawa</a></span></span></li>
<li><span class="agent vcard">21&#160;<span class="fn"><a href="/w/index.php?title=Yusuke_Harada&amp;action=edit&amp;redlink=1" class="new" title="Yusuke Harada (page does not exist)">Harada</a></span></span></li>
<li><span class="agent vcard">22&#160;<span class="fn"><a href="/w/index.php?title=Ko_Yanagisawa&amp;action=edit&amp;redlink=1" class="new" title="Ko Yanagisawa (page does not exist)">Yanagisawa</a></span></span></li>
<li><span class="agent vcard">23&#160;<span class="fn"><a href="/wiki/Yuto_Ono" title="Yuto Ono">Ono</a></span></span></li>
<li><span class="agent vcard">24&#160;<span class="fn"><a href="/w/index.php?title=Shohei_Aihara&amp;action=edit&amp;redlink=1" class="new" title="Shohei Aihara (page does not exist)">Aihara</a></span></span></li>
<li><span class="agent vcard">25&#160;<span class="fn"><a href="/wiki/V%C3%ADctor_Ib%C3%A1%C3%B1ez" title="Víctor Ibáñez">Víctor</a></span></span></li>
<li><span class="agent vcard">26&#160;<span class="fn"><a href="/w/index.php?title=Ham_Yong-jun&amp;action=edit&amp;redlink=1" class="new" title="Ham Yong-jun (page does not exist)">Ham</a></span></span></li>
<li><span class="agent vcard">27&#160;<span class="fn"><a href="/wiki/Osamu_Henry_Iyoha" title="Osamu Henry Iyoha">Iyoha</a></span></span></li>
<li><span class="agent vcard">28&#160;<span class="fn"><a href="/wiki/Yushi_Nagashima" title="Yushi Nagashima">Nagashima</a></span></span></li>
<li><span class="agent vcard">30&#160;<span class="fn"><a href="/wiki/Kensei_Nakashima" title="Kensei Nakashima">Nakashima</a></span></span></li>
<li><span class="agent vcard">31&#160;<span class="fn"><a href="/wiki/Kota_Miyamoto" title="Kota Miyamoto">Miyamoto</a></span></span></li>
<li><span class="agent vcard">33&#160;<span class="fn"><a href="/wiki/Santos_Silva_Alves_Michael" title="Santos Silva Alves Michael">Michael</a></span></span></li>
<li><span class="agent vcard">34&#160;<span class="fn"><a href="/wiki/Fumitaka_Kitatani" title="Fumitaka Kitatani">Kitatani</a></span></span></li>
<li><span class="agent vcard">35&#160;<span class="fn"><a href="/w/index.php?title=Hayate_Nagakura&amp;action=edit&amp;redlink=1" class="new" title="Hayate Nagakura (page does not exist)">Nagakura</a></span></span></li>
<li><span class="agent vcard">36&#160;<span class="fn"><a href="/w/index.php?title=Jefferson_Tabinas&amp;action=edit&amp;redlink=1" class="new" title="Jefferson Tabinas (page does not exist)">Tabinas</a></span></span></li>
<li><span class="nowrap">Manager: <a href="/wiki/Takeshi_Oki" title="Takeshi Oki">Oki</a></span></li></ul>
</div></div></td></tr></tbody></table></div>
<p><br />
</p>
<table class="metadata plainlinks stub" role="presentation" style="background:transparent"><tbody><tr><td><span style="vertical-align: middle; background:transparent"><a href="/wiki/File:Flag_of_Japan.svg" class="image"><img alt="Flag of Japan" src="//upload.wikimedia.org/wikipedia/en/thumb/9/9e/Flag_of_Japan.svg/50px-Flag_of_Japan.svg.png" decoding="async" width="50" height="33" srcset="//upload.wikimedia.org/wikipedia/en/thumb/9/9e/Flag_of_Japan.svg/75px-Flag_of_Japan.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/9/9e/Flag_of_Japan.svg/100px-Flag_of_Japan.svg.png 2x" data-file-width="900" data-file-height="600" /></a><span style="margin-left:-50px;"><a href="/wiki/File:Soccerball_mask.svg" class="image"><img alt="Soccer icon" src="//upload.wikimedia.org/wikipedia/en/thumb/4/4e/Soccerball_mask.svg/50px-Soccerball_mask.svg.png" decoding="async" width="50" height="50" srcset="//upload.wikimedia.org/wikipedia/en/thumb/4/4e/Soccerball_mask.svg/75px-Soccerball_mask.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/4/4e/Soccerball_mask.svg/100px-Soccerball_mask.svg.png 2x" data-file-width="512" data-file-height="512" /></a></span></span></td><td><i>This biographical article related to a Japanese association football forward is a <a href="/wiki/Wikipedia:Stub" title="Wikipedia:Stub">stub</a>. You can help Wikipedia by <a class="external text" href="//en.wikipedia.org/w/index.php?title=Yuta_Togashi&amp;action=edit">expanding it</a>.</i><div class="plainlinks hlist navbar mini" style="position: absolute; right: 15px; display: none;"><ul><li class="nv-view"><a href="/wiki/Template:Japan-footy-forward-stub" title="Template:Japan-footy-forward-stub"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Japan-footy-forward-stub" title="Template talk:Japan-footy-forward-stub"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a class="external text" href="//en.wikipedia.org/w/index.php?title=Template:Japan-footy-forward-stub&amp;action=edit"><abbr title="Edit this template">e</abbr></a></li></ul></div></td></tr></tbody></table>

<!-- 
NewPP limit report
Parsed by mw1283
Cached time: 20190128123943
Cache expiry: 2073600
Dynamic content: false
CPU time usage: 0.504 seconds
Real time usage: 0.659 seconds
Preprocessor visited node count: 3781/1000000
Preprocessor generated node count: 0/1500000
Post‐expand include size: 47323/2097152 bytes
Template argument size: 6940/2097152 bytes
Highest expansion depth: 27/40
Expensive parser function count: 0/500
Unstrip recursion depth: 1/20
Unstrip post‐expand size: 5781/5000000 bytes
Number of Wikibase entities loaded: 1/400
Lua time usage: 0.254/10.000 seconds
Lua memory usage: 11.05 MB/50 MB
-->
<!--
Transclusion expansion time report (%,ms,calls,template)
100.00%  619.221      1 -total
 43.25%  267.810      1 Template:Infobox_football_biography
 38.48%  238.262      1 Template:Reflist
 34.27%  212.183      1 Template:Infobox3cols
 25.45%  157.599      1 Template:Ja
 25.21%  156.118      2 Template:Link_language
 11.68%   72.346      2 Template:ISBN
  7.94%   49.155      2 Template:Catalog_lookup_link
  7.72%   47.782      1 Template:Height
  5.77%   35.743      1 Template:Convert
-->

<!-- Saved in parser cache with key enwiki:pcache:idhash:51813051-0!canonical and timestamp 20190128123942 and revision id 879029683
 -->
</div><noscript><img src="//en.wikipedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" title="" width="1" height="1" style="border: none; position: absolute;" /></noscript></div>					<div class="printfooter">
						Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/w/index.php?title=Yuta_Togashi&amp;oldid=879029683">https://en.wikipedia.org/w/index.php?title=Yuta_Togashi&amp;oldid=879029683</a>"					</div>
				<div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Help:Category" title="Help:Category">Categories</a>: <ul><li><a href="/wiki/Category:1995_births" title="Category:1995 births">1995 births</a></li><li><a href="/wiki/Category:Living_people" title="Category:Living people">Living people</a></li><li><a href="/wiki/Category:Association_football_people_from_Tokyo" title="Category:Association football people from Tokyo">Association football people from Tokyo</a></li><li><a href="/wiki/Category:Japanese_footballers" title="Category:Japanese footballers">Japanese footballers</a></li><li><a href="/wiki/Category:J3_League_players" title="Category:J3 League players">J3 League players</a></li><li><a href="/wiki/Category:FC_Ryukyu_players" title="Category:FC Ryukyu players">FC Ryukyu players</a></li><li><a href="/wiki/Category:FC_Gifu_players" title="Category:FC Gifu players">FC Gifu players</a></li><li><a href="/wiki/Category:Association_football_forwards" title="Category:Association football forwards">Association football forwards</a></li><li><a href="/wiki/Category:Japanese_football_forward_stubs" title="Category:Japanese football forward stubs">Japanese football forward stubs</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden categories: <ul><li><a href="/wiki/Category:Articles_with_Japanese-language_external_links" title="Category:Articles with Japanese-language external links">Articles with Japanese-language external links</a></li><li><a href="/wiki/Category:Articles_containing_Japanese-language_text" title="Category:Articles containing Japanese-language text">Articles containing Japanese-language text</a></li><li><a href="/wiki/Category:J.League_player_template_with_ID_same_as_Wikidata" title="Category:J.League player template with ID same as Wikidata">J.League player template with ID same as Wikidata</a></li><li><a href="/wiki/Category:All_stub_articles" title="Category:All stub articles">All stub articles</a></li></ul></div></div>				<div class="visualClear"></div>
							</div>
		</div>
		<div id="mw-navigation">
			<h2>Navigation menu</h2>
			<div id="mw-head">
									<div id="p-personal" role="navigation" aria-labelledby="p-personal-label">
						<h3 id="p-personal-label">Personal tools</h3>
						<ul>
							<li id="pt-anonuserpage">Not logged in</li><li id="pt-anontalk"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n">Talk</a></li><li id="pt-anoncontribs"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y">Contributions</a></li><li id="pt-createaccount"><a href="/w/index.php?title=Special:CreateAccount&amp;returnto=Yuta+Togashi" title="You are encouraged to create an account and log in; however, it is not mandatory">Create account</a></li><li id="pt-login"><a href="/w/index.php?title=Special:UserLogin&amp;returnto=Yuta+Togashi" title="You&#039;re encouraged to log in; however, it&#039;s not mandatory. [o]" accesskey="o">Log in</a></li>						</ul>
					</div>
									<div id="left-navigation">
										<div id="p-namespaces" role="navigation" class="vectorTabs" aria-labelledby="p-namespaces-label">
						<h3 id="p-namespaces-label">Namespaces</h3>
						<ul>
							<li id="ca-nstab-main" class="selected"><span><a href="/wiki/Yuta_Togashi" title="View the content page [c]" accesskey="c">Article</a></span></li><li id="ca-talk"><span><a href="/wiki/Talk:Yuta_Togashi" rel="discussion" title="Discussion about the content page [t]" accesskey="t">Talk</a></span></li>						</ul>
					</div>
										<div id="p-variants" role="navigation" class="vectorMenu emptyPortlet" aria-labelledby="p-variants-label">
												<input type="checkbox" class="vectorMenuCheckbox" aria-labelledby="p-variants-label" />
						<h3 id="p-variants-label">
							<span>Variants</span>
						</h3>
						<ul class="menu">
													</ul>
					</div>
									</div>
				<div id="right-navigation">
										<div id="p-views" role="navigation" class="vectorTabs" aria-labelledby="p-views-label">
						<h3 id="p-views-label">Views</h3>
						<ul>
							<li id="ca-view" class="collapsible selected"><span><a href="/wiki/Yuta_Togashi">Read</a></span></li><li id="ca-edit" class="collapsible"><span><a href="/w/index.php?title=Yuta_Togashi&amp;action=edit" title="Edit this page [e]" accesskey="e">Edit</a></span></li><li id="ca-history" class="collapsible"><span><a href="/w/index.php?title=Yuta_Togashi&amp;action=history" title="Past revisions of this page [h]" accesskey="h">View history</a></span></li>						</ul>
					</div>
										<div id="p-cactions" role="navigation" class="vectorMenu emptyPortlet" aria-labelledby="p-cactions-label">
						<input type="checkbox" class="vectorMenuCheckbox" aria-labelledby="p-cactions-label" />
						<h3 id="p-cactions-label"><span>More</span></h3>
						<ul class="menu">
													</ul>
					</div>
										<div id="p-search" role="search">
						<h3>
							<label for="searchInput">Search</label>
						</h3>
						<form action="/w/index.php" id="searchform">
							<div id="simpleSearch">
								<input type="search" name="search" placeholder="Search Wikipedia" title="Search Wikipedia [f]" accesskey="f" id="searchInput"/><input type="hidden" value="Special:Search" name="title"/><input type="submit" name="fulltext" value="Search" title="Search Wikipedia for this text" id="mw-searchButton" class="searchButton mw-fallbackSearchButton"/><input type="submit" name="go" value="Go" title="Go to a page with this exact name if it exists" id="searchButton" class="searchButton"/>							</div>
						</form>
					</div>
									</div>
			</div>
			<div id="mw-panel">
				<div id="p-logo" role="banner"><a class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"></a></div>
						<div class="portal" role="navigation" id="p-navigation" aria-labelledby="p-navigation-label">
			<h3 id="p-navigation-label">Navigation</h3>
			<div class="body">
								<ul>
					<li id="n-mainpage-description"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z">Main page</a></li><li id="n-contents"><a href="/wiki/Portal:Contents" title="Guides to browsing Wikipedia">Contents</a></li><li id="n-featuredcontent"><a href="/wiki/Portal:Featured_content" title="Featured content – the best of Wikipedia">Featured content</a></li><li id="n-currentevents"><a href="/wiki/Portal:Current_events" title="Find background information on current events">Current events</a></li><li id="n-randompage"><a href="/wiki/Special:Random" title="Load a random article [x]" accesskey="x">Random article</a></li><li id="n-sitesupport"><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;uselang=en" title="Support us">Donate to Wikipedia</a></li><li id="n-shoplink"><a href="//shop.wikimedia.org" title="Visit the Wikipedia store">Wikipedia store</a></li>				</ul>
							</div>
		</div>
			<div class="portal" role="navigation" id="p-interaction" aria-labelledby="p-interaction-label">
			<h3 id="p-interaction-label">Interaction</h3>
			<div class="body">
								<ul>
					<li id="n-help"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia">Help</a></li><li id="n-aboutsite"><a href="/wiki/Wikipedia:About" title="Find out about Wikipedia">About Wikipedia</a></li><li id="n-portal"><a href="/wiki/Wikipedia:Community_portal" title="About the project, what you can do, where to find things">Community portal</a></li><li id="n-recentchanges"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li><li id="n-contactpage"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia">Contact page</a></li>				</ul>
							</div>
		</div>
			<div class="portal" role="navigation" id="p-tb" aria-labelledby="p-tb-label">
			<h3 id="p-tb-label">Tools</h3>
			<div class="body">
								<ul>
					<li id="t-whatlinkshere"><a href="/wiki/Special:WhatLinksHere/Yuta_Togashi" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j">What links here</a></li><li id="t-recentchangeslinked"><a href="/wiki/Special:RecentChangesLinked/Yuta_Togashi" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li><li id="t-upload"><a href="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u">Upload file</a></li><li id="t-specialpages"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li><li id="t-permalink"><a href="/w/index.php?title=Yuta_Togashi&amp;oldid=879029683" title="Permanent link to this revision of the page">Permanent link</a></li><li id="t-info"><a href="/w/index.php?title=Yuta_Togashi&amp;action=info" title="More information about this page">Page information</a></li><li id="t-wikibase"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q24088415" title="Link to connected data repository item [g]" accesskey="g">Wikidata item</a></li><li id="t-cite"><a href="/w/index.php?title=Special:CiteThisPage&amp;page=Yuta_Togashi&amp;id=879029683" title="Information on how to cite this page">Cite this page</a></li>				</ul>
							</div>
		</div>
			<div class="portal" role="navigation" id="p-coll-print_export" aria-labelledby="p-coll-print_export-label">
			<h3 id="p-coll-print_export-label">Print/export</h3>
			<div class="body">
								<ul>
					<li id="coll-create_a_book"><a href="/w/index.php?title=Special:Book&amp;bookcmd=book_creator&amp;referer=Yuta+Togashi">Create a book</a></li><li id="coll-download-as-rdf2latex"><a href="/w/index.php?title=Special:ElectronPdf&amp;page=Yuta+Togashi&amp;action=show-download-screen">Download as PDF</a></li><li id="t-print"><a href="/w/index.php?title=Yuta_Togashi&amp;printable=yes" title="Printable version of this page [p]" accesskey="p">Printable version</a></li>				</ul>
							</div>
		</div>
			<div class="portal" role="navigation" id="p-lang" aria-labelledby="p-lang-label">
			<h3 id="p-lang-label">Languages</h3>
			<div class="body">
								<ul>
					<li class="interlanguage-link interwiki-ar"><a href="https://ar.wikipedia.org/wiki/%D9%8A%D9%88%D8%AA%D8%A7_%D8%AA%D9%88%D8%BA%D8%A7%D8%B4%D9%8A" title="يوتا توغاشي – Arabic" lang="ar" hreflang="ar" class="interlanguage-link-target">العربية</a></li><li class="interlanguage-link interwiki-es"><a href="https://es.wikipedia.org/wiki/Yuta_Togashi" title="Yuta Togashi – Spanish" lang="es" hreflang="es" class="interlanguage-link-target">Español</a></li><li class="interlanguage-link interwiki-ko"><a href="https://ko.wikipedia.org/wiki/%EB%8F%84%EA%B0%80%EC%8B%9C_%EC%9C%A0%ED%83%80" title="도가시 유타 – Korean" lang="ko" hreflang="ko" class="interlanguage-link-target">한국어</a></li><li class="interlanguage-link interwiki-id"><a href="https://id.wikipedia.org/wiki/Yuta_Togashi" title="Yuta Togashi – Indonesian" lang="id" hreflang="id" class="interlanguage-link-target">Bahasa Indonesia</a></li><li class="interlanguage-link interwiki-ms"><a href="https://ms.wikipedia.org/wiki/Yuta_Togashi" title="Yuta Togashi – Malay" lang="ms" hreflang="ms" class="interlanguage-link-target">Bahasa Melayu</a></li><li class="interlanguage-link interwiki-ja"><a href="https://ja.wikipedia.org/wiki/%E5%AF%8C%E6%A8%AB%E4%BD%91%E5%A4%AA" title="富樫佑太 – Japanese" lang="ja" hreflang="ja" class="interlanguage-link-target">日本語</a></li><li class="interlanguage-link interwiki-tl"><a href="https://tl.wikipedia.org/wiki/Yuta_Togashi" title="Yuta Togashi – Tagalog" lang="tl" hreflang="tl" class="interlanguage-link-target">Tagalog</a></li><li class="interlanguage-link interwiki-vi"><a href="https://vi.wikipedia.org/wiki/Togashi_Yuta" title="Togashi Yuta – Vietnamese" lang="vi" hreflang="vi" class="interlanguage-link-target">Tiếng Việt</a></li><li class="interlanguage-link interwiki-zh-yue"><a href="https://zh-yue.wikipedia.org/wiki/%E5%AF%8C%E6%A8%AB%E4%BD%91%E5%A4%AA" title="富樫佑太 – Cantonese" lang="yue" hreflang="yue" class="interlanguage-link-target">粵語</a></li>				</ul>
				<div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q24088415#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div>			</div>
		</div>
				</div>
		</div>
				<div id="footer" role="contentinfo">
						<ul id="footer-info">
								<li id="footer-info-lastmod"> This page was last edited on 18 January 2019, at 14:56<span class="anonymous-show">&#160;(UTC)</span>.</li>
								<li id="footer-info-copyright">Text is available under the <a rel="license" href="//en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License">Creative Commons Attribution-ShareAlike License</a><a rel="license" href="//creativecommons.org/licenses/by-sa/3.0/" style="display:none;"></a>;
additional terms may apply.  By using this site, you agree to the <a href="//foundation.wikimedia.org/wiki/Terms_of_Use">Terms of Use</a> and <a href="//foundation.wikimedia.org/wiki/Privacy_policy">Privacy Policy</a>. Wikipedia® is a registered trademark of the <a href="//www.wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</li>
							</ul>
						<ul id="footer-places">
								<li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Privacy_policy" class="extiw" title="wmf:Privacy policy">Privacy policy</a></li>
								<li id="footer-places-about"><a href="/wiki/Wikipedia:About" title="Wikipedia:About">About Wikipedia</a></li>
								<li id="footer-places-disclaimer"><a href="/wiki/Wikipedia:General_disclaimer" title="Wikipedia:General disclaimer">Disclaimers</a></li>
								<li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li>
								<li id="footer-places-developers"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/How_to_contribute">Developers</a></li>
								<li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Cookie_statement">Cookie statement</a></li>
								<li id="footer-places-mobileview"><a href="//en.m.wikipedia.org/w/index.php?title=Yuta_Togashi&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li>
							</ul>
										<ul id="footer-icons" class="noprint">
										<li id="footer-copyrightico">
						<a href="https://wikimediafoundation.org/"><img src="/static/images/wikimedia-button.png" srcset="/static/images/wikimedia-button-1.5x.png 1.5x, /static/images/wikimedia-button-2x.png 2x" width="88" height="31" alt="Wikimedia Foundation"/></a>					</li>
										<li id="footer-poweredbyico">
						<a href="//www.mediawiki.org/"><img src="/static/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" srcset="/static/images/poweredby_mediawiki_132x47.png 1.5x, /static/images/poweredby_mediawiki_176x62.png 2x" width="88" height="31"/></a>					</li>
									</ul>
						<div style="clear: both;"></div>
		</div>
		
<script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.504","walltime":"0.659","ppvisitednodes":{"value":3781,"limit":1000000},"ppgeneratednodes":{"value":0,"limit":1500000},"postexpandincludesize":{"value":47323,"limit":2097152},"templateargumentsize":{"value":6940,"limit":2097152},"expansiondepth":{"value":27,"limit":40},"expensivefunctioncount":{"value":0,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":5781,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00%  619.221      1 -total"," 43.25%  267.810      1 Template:Infobox_football_biography"," 38.48%  238.262      1 Template:Reflist"," 34.27%  212.183      1 Template:Infobox3cols"," 25.45%  157.599      1 Template:Ja"," 25.21%  156.118      2 Template:Link_language"," 11.68%   72.346      2 Template:ISBN","  7.94%   49.155      2 Template:Catalog_lookup_link","  7.72%   47.782      1 Template:Height","  5.77%   35.743      1 Template:Convert"]},"scribunto":{"limitreport-timeusage":{"value":"0.254","limit":"10.000"},"limitreport-memusage":{"value":11591081,"limit":52428800}},"cachereport":{"origin":"mw1283","timestamp":"20190128123943","ttl":2073600,"transientcontent":false}}});});</script>
<script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Yuta Togashi","url":"https:\/\/en.wikipedia.org\/wiki\/Yuta_Togashi","sameAs":"http:\/\/www.wikidata.org\/entity\/Q24088415","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q24088415","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2016-10-01T13:47:24Z","dateModified":"2019-01-18T14:56:32Z","headline":"Japanese footballer"}</script>
<script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgBackendResponseTime":488,"wgHostname":"mw1327"});});</script>
	</body>
</html>


In [22]:
print("Question 2 Completed")


Question 2 Completed

Part 3: Extracting the Title of the Article

Question 3 (part 1) Use the title of the Wikipedia article as the title of the band. The title of the article is surrounded by the XML node title as follows: <title>title - Wikipedia</title> . For example, if the title of the article was Python we would see the following: <title>Python - Wikipedia</title>. Consider the example where the title of the article is Teenage Mutant Ninja Turtles the result would be: <title>Teenage Mutant Ninja Turtles - Wikipedia</title>. The first step is to find the XML node <title> and </title>indicating the start and end of the title. The string function find maybe helpful, you can also use libraries like xlxml.


In [36]:
import xml.etree.ElementTree as ET

def find_the_wiki_page_title(page):
    '''
    Converts the string of HTMl page into an XML object and then extracts a XML Tree Object and the title of the HTML Page
    
    '''
    # Parsing the string into an xml tree object
    tree = ET.ElementTree(ET.fromstring(page))
    # finding the title tag from the parsed object
    title_elements = None
    for elem in tree.iter():
        if elem.tag == 'title':
            title_elements = elem
    unedited_title = title_elements.text
    title = unedited_title.split("-")[0]
    return tree, title

xml_tree, band_title = find_the_wiki_page_title(page)
print("The title of the HTML page is ", band_title)
print("Queston 3 is Completed")


The title of the HTML page is  Yuta Togashi 
Queston 3 is Completed

Question 3 (part 2) Next get rid of the term - Wikipedia from the title and assign the result to the band_title For example you can use the function or method strip or replace.

Question 4) Repeat the second and third step, to extract the title of a second Wikipedia article but use the result to album_title


In [38]:
another_wiki_page = "https://en.wikipedia.org/wiki/Special:Random"
second_wiki_page = requests.get(another_wiki_page)
second_page = second_wiki_page.text

second_xml_tree, album_title = find_the_wiki_page_title(second_page)
print("The title of the second HTML page is ", album_title)
print("Queston 4 is Completed")


The title of the second HTML page is  Satoshi Dezaki 
Queston 4 is Completed

If you did everything correct the following cell should display the album and band name:


In [39]:
print("Your band: ", band_title)
print("Your album: ", album_title)


Your band:  Yuta Togashi 
Your album:  Satoshi Dezaki 

Part 4: Displaying the Album Cover

Use the function display_cover to superimpose the band and album title over a random image, assign the result to the variable album_cover .


In [ ]:
album_cover=display_cover(top=album_title,bottom=band_title)
print("Question 4 Completed")

Question 5) use the function display_cover to display the album cover with two random article titles representing the name of the band and the title of the album.


In [40]:
img=display_cover(top=album_title,bottom=band_title)

Use the method save to save the image as sample-out.png:


In [41]:
img.save('sample-out.png')

Use the function IPythonImage to display the image


In [42]:
IPythonImage(filename='sample-out.png')


Out[42]:

About the Authors:

James Reeve James Reeves is a Software Engineering intern at IBM.

Joseph Santarcangelo has a PhD in Electrical Engineering, his research focused on using machine learning, signal processing, and computer vision to determine how videos impact human cognition. Joseph has been working for IBM since he completed his PhD.


Copyright © 2018 cognitiveclass.ai. This notebook and its source code are released under the terms of the MIT License.