wmt-2020-pl-en/docs/_build/html/index.html
Terry Zhuo 3d2e775855
doc: update the sphinx docs (#224)
* doc: update Readthedoc

* doc: update Readthedoc

* doc: update Readthedoc
2020-10-03 04:59:42 +10:00

656 lines
52 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Googletrans: Free and Unlimited Google translate API for Python &#8212; Googletrans 3.0.0 documentation</title>
<link rel="stylesheet" href="_static/solar.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="search" title="Search" href="search.html" /><link href='http://fonts.googleapis.com/css?family=Source+Code+Pro|Open+Sans:300italic,400italic,700italic,400,300,700' rel='stylesheet' type='text/css'>
<link href="_static/solarized-dark.css" rel="stylesheet">
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="py-modindex.html" title="Python Module Index"
>modules</a></li>
<li class="nav-item nav-item-0"><a href="#">Googletrans 3.0.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Googletrans: Free and Unlimited Google translate API for Python</a></li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Googletrans: Free and Unlimited Google translate API for Python</a><ul>
<li><a class="reference internal" href="#features">Features</a><ul>
<li><a class="reference internal" href="#note-on-library-usage">Note on library usage</a></li>
</ul>
</li>
<li><a class="reference internal" href="#quickstart">Quickstart</a><ul>
<li><a class="reference internal" href="#http-2-support">HTTP/2 support</a></li>
<li><a class="reference internal" href="#basic-usage">Basic Usage</a></li>
<li><a class="reference internal" href="#customize-service-url">Customize service URL</a></li>
<li><a class="reference internal" href="#advanced-usage-bulk">Advanced Usage (Bulk)</a></li>
<li><a class="reference internal" href="#language-detection">Language detection</a></li>
</ul>
</li>
<li><a class="reference internal" href="#api-guide">API Guide</a></li>
</ul>
</li>
<li><a class="reference internal" href="#googletrans-translator">googletrans.Translator</a></li>
<li><a class="reference internal" href="#module-googletrans.models">googletrans.models</a></li>
<li><a class="reference internal" href="#googletrans-gtoken">googletrans.gtoken</a></li>
<li><a class="reference internal" href="#googletrans-languages">googletrans.LANGUAGES</a></li>
<li><a class="reference internal" href="#googletrans-default-service-urls">googletrans.DEFAULT_SERVICE_URLS</a></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="googletrans-free-and-unlimited-google-translate-api-for-python">
<h1>Googletrans: Free and Unlimited Google translate API for Python<a class="headerlink" href="#googletrans-free-and-unlimited-google-translate-api-for-python" title="Permalink to this headline"></a></h1>
<a class="reference external image-reference" href="http://opensource.org/licenses/MIT"><img alt="https://img.shields.io/github/license/mashape/apistatus.svg" src="https://img.shields.io/github/license/mashape/apistatus.svg" /></a>
<a class="reference external image-reference" href="https://travis-ci.org/ssut/py-googletrans"><img alt="https://travis-ci.org/ssut/py-googletrans.svg?branch=master" src="https://travis-ci.org/ssut/py-googletrans.svg?branch=master" /></a>
<a class="reference external image-reference" href="https://readthedocs.org/projects/py-googletrans/?badge=latest"><img alt="https://readthedocs.org/projects/py-googletrans/badge/?version=latest" src="https://readthedocs.org/projects/py-googletrans/badge/?version=latest" /></a>
<a class="reference external image-reference" href="http://badge.fury.io/py/googletrans"><img alt="https://badge.fury.io/py/googletrans.svg" src="https://badge.fury.io/py/googletrans.svg" /></a>
<a class="reference external image-reference" href="https://coveralls.io/github/ssut/py-googletrans"><img alt="https://coveralls.io/repos/github/ssut/py-googletrans/badge.svg" src="https://coveralls.io/repos/github/ssut/py-googletrans/badge.svg" /></a>
<a class="reference external image-reference" href="https://codeclimate.com/github/ssut/py-googletrans"><img alt="https://codeclimate.com/github/ssut/py-googletrans/badges/gpa.svg" src="https://codeclimate.com/github/ssut/py-googletrans/badges/gpa.svg" /></a>
<p>Googletrans is a <strong>free</strong> and <strong>unlimited</strong> python library that
implemented Google Translate API. This uses the <a class="reference external" href="https://translate.google.com">Google Translate Ajax
API</a> to make calls to such methods as
detect and translate.</p>
<div class="section" id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p>Fast and reliable - it uses the same servers that
translate.google.com uses</p></li>
<li><p>Auto language detection</p></li>
<li><p>Bulk translations</p></li>
<li><p>Customizable service URL</p></li>
<li><p>Connection pooling (the advantage of using requests.Session)</p></li>
<li><p>HTTP/2 support</p></li>
</ul>
<div class="section" id="note-on-library-usage">
<h3>Note on library usage<a class="headerlink" href="#note-on-library-usage" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p>The maximum character limit on a single text is 15k.</p></li>
<li><p>Due to limitations of the web version of google translate, this API
does not guarantee that the library would work properly at all times.
(so please use this library if you dont care about stability.)</p></li>
<li><p>If you want to use a stable API, I highly recommend you to use
<a class="reference external" href="https://cloud.google.com/translate/docs">Googles official translate
API</a>.</p></li>
<li><p>If you get HTTP 5xx error or errors like #6, its probably because
Google has banned your client IP address.</p></li>
</ul>
</div>
</div>
<div class="section" id="quickstart">
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h2>
<p>You can install it from <a class="reference external" href="https://pypi.python.org/pypi/googletrans">PyPI</a>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ pip install googletrans
</pre></div>
</div>
<div class="section" id="http-2-support">
<h3>HTTP/2 support<a class="headerlink" href="#http-2-support" title="Permalink to this headline"></a></h3>
<p>This is a great deal for everyone! (up to 2x times faster in my test) If
you want to get googletrans faster you should install
<a class="reference external" href="https://github.com/Lukasa/hyper">hyper</a> package. Googletrans will
automatically detect if hyper is installed and if so, it will be used
for http networking.</p>
</div>
<div class="section" id="basic-usage">
<h3>Basic Usage<a class="headerlink" href="#basic-usage" title="Permalink to this headline"></a></h3>
<p>If source language is not given, google translate attempts to detect the
source language.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">googletrans</span> <span class="kn">import</span> <span class="n">Translator</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span> <span class="o">=</span> <span class="n">Translator</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">(</span><span class="s1">&#39;안녕하세요.&#39;</span><span class="p">)</span>
<span class="go"># &lt;Translated src=ko dest=en text=Good evening. pronunciation=Good evening.&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">(</span><span class="s1">&#39;안녕하세요.&#39;</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s1">&#39;ja&#39;</span><span class="p">)</span>
<span class="go"># &lt;Translated src=ko dest=ja text=こんにちは。 pronunciation=Kon&#39;nichiwa.&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">(</span><span class="s1">&#39;veritas lux mea&#39;</span><span class="p">,</span> <span class="n">src</span><span class="o">=</span><span class="s1">&#39;la&#39;</span><span class="p">)</span>
<span class="go"># &lt;Translated src=la dest=en text=The truth is my light pronunciation=The truth is my light&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="customize-service-url">
<h3>Customize service URL<a class="headerlink" href="#customize-service-url" title="Permalink to this headline"></a></h3>
<p>You can use another google translate domain for translation. If multiple
URLs are provided it then randomly chooses a domain.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">googletrans</span> <span class="kn">import</span> <span class="n">Translator</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span> <span class="o">=</span> <span class="n">Translator</span><span class="p">(</span><span class="n">service_urls</span><span class="o">=</span><span class="p">[</span>
<span class="go"> &#39;translate.google.com&#39;,</span>
<span class="go"> &#39;translate.google.co.kr&#39;,</span>
<span class="go"> ])</span>
</pre></div>
</div>
</div>
<div class="section" id="advanced-usage-bulk">
<h3>Advanced Usage (Bulk)<a class="headerlink" href="#advanced-usage-bulk" title="Permalink to this headline"></a></h3>
<p>Array can be used to translate a batch of strings in a single method
call and a single HTTP session. The exact same method shown above work
for arrays as well.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">translations</span> <span class="o">=</span> <span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">([</span><span class="s1">&#39;The quick brown fox&#39;</span><span class="p">,</span> <span class="s1">&#39;jumps over&#39;</span><span class="p">,</span> <span class="s1">&#39;the lazy dog&#39;</span><span class="p">],</span> <span class="n">dest</span><span class="o">=</span><span class="s1">&#39;ko&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">translation</span> <span class="ow">in</span> <span class="n">translations</span><span class="p">:</span>
<span class="gp">... </span> <span class="nb">print</span><span class="p">(</span><span class="n">translation</span><span class="o">.</span><span class="n">origin</span><span class="p">,</span> <span class="s1">&#39; -&gt; &#39;</span><span class="p">,</span> <span class="n">translation</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
<span class="go"># The quick brown fox -&gt; 빠른 갈색 여우</span>
<span class="go"># jumps over -&gt; 이상 점프</span>
<span class="go"># the lazy dog -&gt; 게으른 개</span>
</pre></div>
</div>
</div>
<div class="section" id="language-detection">
<h3>Language detection<a class="headerlink" href="#language-detection" title="Permalink to this headline"></a></h3>
<p>The detect method, as its name implies, identifies the language used in
a given sentence.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;이 문장은 한글로 쓰여졌습니다.&#39;</span><span class="p">)</span>
<span class="go"># &lt;Detected lang=ko confidence=0.27041003&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;この文章は日本語で書かれました。&#39;</span><span class="p">)</span>
<span class="go"># &lt;Detected lang=ja confidence=0.64889508&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;This sentence is written in English.&#39;</span><span class="p">)</span>
<span class="go"># &lt;Detected lang=en confidence=0.22348526&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;Tiu frazo estas skribita en Esperanto.&#39;</span><span class="p">)</span>
<span class="go"># &lt;Detected lang=eo confidence=0.10538048&gt;</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="api-guide">
<h2>API Guide<a class="headerlink" href="#api-guide" title="Permalink to this headline"></a></h2>
</div>
</div>
<div class="section" id="googletrans-translator">
<h1>googletrans.Translator<a class="headerlink" href="#googletrans-translator" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="googletrans.Translator">
<em class="property">class </em><code class="sig-prename descclassname">googletrans.</code><code class="sig-name descname">Translator</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">service_urls</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">user_agent</span><span class="o">=</span><span class="default_value">'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'</span></em>, <em class="sig-param"><span class="n">raise_exception</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">proxies</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a><span class="p">, </span>httpcore._sync.base.SyncHTTPTransport<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">timeout</span><span class="p">:</span> <span class="n">httpx._config.Timeout</span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">http2</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#googletrans.Translator" title="Permalink to this definition"></a></dt>
<dd><p>Google Translate ajax API implementation class</p>
<p>You have to create an instance of Translator to use this API</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>service_urls</strong> (<em>a sequence of strings</em>) google translate url list. URLs will be used randomly.
For example <code class="docutils literal notranslate"><span class="pre">['translate.google.com',</span> <span class="pre">'translate.google.co.kr']</span></code></p></li>
<li><p><strong>user_agent</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>) the User-Agent header to send when making requests.</p></li>
<li><p><strong>proxies</strong> (<em>dictionary</em>) proxies configuration.
Dictionary mapping protocol or protocol and host to the URL of the proxy
For example <code class="docutils literal notranslate"><span class="pre">{'http':</span> <span class="pre">'foo.bar:3128',</span> <span class="pre">'http://host.name':</span> <span class="pre">'foo.bar:4012'}</span></code></p></li>
<li><p><strong>timeout</strong> (<em>number</em><em> or </em><em>a double of numbers</em>) Definition of timeout for httpx library.
Will be used for every request.</p></li>
<li><p><strong>proxies</strong> proxies configuration.
Dictionary mapping protocol or protocol and host to the URL of the proxy
For example <code class="docutils literal notranslate"><span class="pre">{'http':</span> <span class="pre">'foo.bar:3128',</span> <span class="pre">'http://host.name':</span> <span class="pre">'foo.bar:4012'}</span></code></p></li>
<li><p><strong>raise_exception</strong> (<em>boolean</em>) if <cite>True</cite> then raise exception if smth will go wrong</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="googletrans.Translator.translate">
<code class="sig-name descname">translate</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">text</span></em>, <em class="sig-param"><span class="n">dest</span><span class="o">=</span><span class="default_value">'en'</span></em>, <em class="sig-param"><span class="n">src</span><span class="o">=</span><span class="default_value">'auto'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#googletrans.Translator.translate" title="Permalink to this definition"></a></dt>
<dd><p>Translate text from source language to destination language</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (UTF-8 <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>; <code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code>; string sequence (list, tuple, iterator, generator)) The source text(s) to be translated. Batch translation is supported via sequence input.</p></li>
<li><p><strong>dest</strong> The language to translate the source text into.
The value should be one of the language codes listed in <code class="xref py py-const docutils literal notranslate"><span class="pre">googletrans.LANGUAGES</span></code>
or one of the language names listed in <code class="xref py py-const docutils literal notranslate"><span class="pre">googletrans.LANGCODES</span></code>.</p></li>
<li><p><strong>dest</strong> <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>; <code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code></p></li>
<li><p><strong>src</strong> The language of the source text.
The value should be one of the language codes listed in <code class="xref py py-const docutils literal notranslate"><span class="pre">googletrans.LANGUAGES</span></code>
or one of the language names listed in <code class="xref py py-const docutils literal notranslate"><span class="pre">googletrans.LANGCODES</span></code>.
If a language is not specified,
the system will attempt to identify the source language automatically.</p></li>
<li><p><strong>src</strong> <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>; <code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#googletrans.models.Translated" title="googletrans.models.Translated">Translated</a></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></a> (when a list is passed)</p>
</dd>
</dl>
<dl>
<dt>Basic usage:</dt><dd><div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">googletrans</span> <span class="kn">import</span> <span class="n">Translator</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span> <span class="o">=</span> <span class="n">Translator</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">(</span><span class="s1">&#39;안녕하세요.&#39;</span><span class="p">)</span>
<span class="go">&lt;Translated src=ko dest=en text=Good evening. pronunciation=Good evening.&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">(</span><span class="s1">&#39;안녕하세요.&#39;</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s1">&#39;ja&#39;</span><span class="p">)</span>
<span class="go">&lt;Translated src=ko dest=ja text=こんにちは。 pronunciation=Kon&#39;nichiwa.&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">(</span><span class="s1">&#39;veritas lux mea&#39;</span><span class="p">,</span> <span class="n">src</span><span class="o">=</span><span class="s1">&#39;la&#39;</span><span class="p">)</span>
<span class="go">&lt;Translated src=la dest=en text=The truth is my light pronunciation=The truth is my light&gt;</span>
</pre></div>
</div>
</dd>
<dt>Advanced usage:</dt><dd><div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">translations</span> <span class="o">=</span> <span class="n">translator</span><span class="o">.</span><span class="n">translate</span><span class="p">([</span><span class="s1">&#39;The quick brown fox&#39;</span><span class="p">,</span> <span class="s1">&#39;jumps over&#39;</span><span class="p">,</span> <span class="s1">&#39;the lazy dog&#39;</span><span class="p">],</span> <span class="n">dest</span><span class="o">=</span><span class="s1">&#39;ko&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">translation</span> <span class="ow">in</span> <span class="n">translations</span><span class="p">:</span>
<span class="gp">... </span> <span class="nb">print</span><span class="p">(</span><span class="n">translation</span><span class="o">.</span><span class="n">origin</span><span class="p">,</span> <span class="s1">&#39; -&gt; &#39;</span><span class="p">,</span> <span class="n">translation</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
<span class="go">The quick brown fox -&gt; 빠른 갈색 여우</span>
<span class="go">jumps over -&gt; 이상 점프</span>
<span class="go">the lazy dog -&gt; 게으른 개</span>
</pre></div>
</div>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="googletrans.Translator.detect">
<code class="sig-name descname">detect</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">text</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#googletrans.Translator.detect" title="Permalink to this definition"></a></dt>
<dd><p>Detect language of the input text</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>text</strong> (UTF-8 <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>; <code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code>; string sequence (list, tuple, iterator, generator)) The source text(s) whose language you want to identify.
Batch detection is supported via sequence input.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#googletrans.models.Detected" title="googletrans.models.Detected">Detected</a></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></a> (when a list is passed)</p>
</dd>
</dl>
<dl>
<dt>Basic usage:</dt><dd><div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">googletrans</span> <span class="kn">import</span> <span class="n">Translator</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span> <span class="o">=</span> <span class="n">Translator</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;이 문장은 한글로 쓰여졌습니다.&#39;</span><span class="p">)</span>
<span class="go">&lt;Detected lang=ko confidence=0.27041003&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;この文章は日本語で書かれました。&#39;</span><span class="p">)</span>
<span class="go">&lt;Detected lang=ja confidence=0.64889508&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;This sentence is written in English.&#39;</span><span class="p">)</span>
<span class="go">&lt;Detected lang=en confidence=0.22348526&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="s1">&#39;Tiu frazo estas skribita en Esperanto.&#39;</span><span class="p">)</span>
<span class="go">&lt;Detected lang=eo confidence=0.10538048&gt;</span>
</pre></div>
</div>
</dd>
<dt>Advanced usage:</dt><dd><div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">langs</span> <span class="o">=</span> <span class="n">translator</span><span class="o">.</span><span class="n">detect</span><span class="p">([</span><span class="s1">&#39;한국어&#39;</span><span class="p">,</span> <span class="s1">&#39;日本語&#39;</span><span class="p">,</span> <span class="s1">&#39;English&#39;</span><span class="p">,</span> <span class="s1">&#39;le français&#39;</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">lang</span> <span class="ow">in</span> <span class="n">langs</span><span class="p">:</span>
<span class="gp">... </span> <span class="nb">print</span><span class="p">(</span><span class="n">lang</span><span class="o">.</span><span class="n">lang</span><span class="p">,</span> <span class="n">lang</span><span class="o">.</span><span class="n">confidence</span><span class="p">)</span>
<span class="go">ko 1</span>
<span class="go">ja 0.92929292</span>
<span class="go">en 0.96954316</span>
<span class="go">fr 0.043500196</span>
</pre></div>
</div>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-googletrans.models">
<span id="googletrans-models"></span><h1>googletrans.models<a class="headerlink" href="#module-googletrans.models" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="googletrans.models.Translated">
<em class="property">class </em><code class="sig-prename descclassname">googletrans.models.</code><code class="sig-name descname">Translated</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">src</span></em>, <em class="sig-param"><span class="n">dest</span></em>, <em class="sig-param"><span class="n">origin</span></em>, <em class="sig-param"><span class="n">text</span></em>, <em class="sig-param"><span class="n">pronunciation</span></em>, <em class="sig-param"><span class="n">extra_data</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#googletrans.models.Translated" title="Permalink to this definition"></a></dt>
<dd><p>Translate result object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>src</strong> source language (default: auto)</p></li>
<li><p><strong>dest</strong> destination language (default: en)</p></li>
<li><p><strong>origin</strong> original text</p></li>
<li><p><strong>text</strong> translated text</p></li>
<li><p><strong>pronunciation</strong> pronunciation</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt id="googletrans.models.Detected">
<em class="property">class </em><code class="sig-prename descclassname">googletrans.models.</code><code class="sig-name descname">Detected</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lang</span></em>, <em class="sig-param"><span class="n">confidence</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#googletrans.models.Detected" title="Permalink to this definition"></a></dt>
<dd><p>Language detection result object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lang</strong> detected language</p></li>
<li><p><strong>confidence</strong> the confidence of detection result (0.00 to 1.00)</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="googletrans-gtoken">
<h1>googletrans.gtoken<a class="headerlink" href="#googletrans-gtoken" title="Permalink to this headline"></a></h1>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>This is for internal use only to generate a valid token to access
translate.google.com ajax API.</p>
</div>
<span class="target" id="module-googletrans.gtoken"></span><dl class="py class">
<dt id="googletrans.gtoken.TokenAcquirer">
<em class="property">class </em><code class="sig-prename descclassname">googletrans.gtoken.</code><code class="sig-name descname">TokenAcquirer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">client</span><span class="p">:</span> <span class="n">httpx._client.Client</span></em>, <em class="sig-param"><span class="n">tkk</span><span class="o">=</span><span class="default_value">'0'</span></em>, <em class="sig-param"><span class="n">host</span><span class="o">=</span><span class="default_value">'translate.google.com'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#googletrans.gtoken.TokenAcquirer" title="Permalink to this definition"></a></dt>
<dd><p>Google Translate API token generator</p>
<p>translate.google.com uses a token to authorize the requests. If you are
not Google, you do have this token and will have to pay for use.
This class is the result of reverse engineering on the obfuscated and
minified code used by Google to generate such token.</p>
<p>The token is based on a seed which is updated once per hour and on the
text that will be translated.
Both are combined - by some strange math - in order to generate a final
token (e.g. 744915.856682) which is used by the API to validate the
request.</p>
<p>This operation will cause an additional request to get an initial
token from translate.google.com.</p>
<dl>
<dt>Example usage:</dt><dd><div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">googletrans.gtoken</span> <span class="kn">import</span> <span class="n">TokenAcquirer</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acquirer</span> <span class="o">=</span> <span class="n">TokenAcquirer</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">text</span> <span class="o">=</span> <span class="s1">&#39;test&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tk</span> <span class="o">=</span> <span class="n">acquirer</span><span class="o">.</span><span class="n">do</span><span class="p">(</span><span class="n">text</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tk</span>
<span class="go">950629.577246</span>
</pre></div>
</div>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="googletrans-languages">
<h1>googletrans.LANGUAGES<a class="headerlink" href="#googletrans-languages" title="Permalink to this headline"></a></h1>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>iso639-1 language codes for
<a class="reference external" href="https://developers.google.com/translate/v2/using_rest#language-params">supported languages</a>
for translation. Some language codes also include a country code, like zh-CN or zh-TW.</p>
</div>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113</pre></div></td><td class="code"><div class="highlight"><pre><span></span>
<span class="n">SPECIAL_CASES</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;ee&#39;</span><span class="p">:</span> <span class="s1">&#39;et&#39;</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">LANGUAGES</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;af&#39;</span><span class="p">:</span> <span class="s1">&#39;afrikaans&#39;</span><span class="p">,</span>
<span class="s1">&#39;sq&#39;</span><span class="p">:</span> <span class="s1">&#39;albanian&#39;</span><span class="p">,</span>
<span class="s1">&#39;am&#39;</span><span class="p">:</span> <span class="s1">&#39;amharic&#39;</span><span class="p">,</span>
<span class="s1">&#39;ar&#39;</span><span class="p">:</span> <span class="s1">&#39;arabic&#39;</span><span class="p">,</span>
<span class="s1">&#39;hy&#39;</span><span class="p">:</span> <span class="s1">&#39;armenian&#39;</span><span class="p">,</span>
<span class="s1">&#39;az&#39;</span><span class="p">:</span> <span class="s1">&#39;azerbaijani&#39;</span><span class="p">,</span>
<span class="s1">&#39;eu&#39;</span><span class="p">:</span> <span class="s1">&#39;basque&#39;</span><span class="p">,</span>
<span class="s1">&#39;be&#39;</span><span class="p">:</span> <span class="s1">&#39;belarusian&#39;</span><span class="p">,</span>
<span class="s1">&#39;bn&#39;</span><span class="p">:</span> <span class="s1">&#39;bengali&#39;</span><span class="p">,</span>
<span class="s1">&#39;bs&#39;</span><span class="p">:</span> <span class="s1">&#39;bosnian&#39;</span><span class="p">,</span>
<span class="s1">&#39;bg&#39;</span><span class="p">:</span> <span class="s1">&#39;bulgarian&#39;</span><span class="p">,</span>
<span class="s1">&#39;ca&#39;</span><span class="p">:</span> <span class="s1">&#39;catalan&#39;</span><span class="p">,</span>
<span class="s1">&#39;ceb&#39;</span><span class="p">:</span> <span class="s1">&#39;cebuano&#39;</span><span class="p">,</span>
<span class="s1">&#39;ny&#39;</span><span class="p">:</span> <span class="s1">&#39;chichewa&#39;</span><span class="p">,</span>
<span class="s1">&#39;zh-cn&#39;</span><span class="p">:</span> <span class="s1">&#39;chinese (simplified)&#39;</span><span class="p">,</span>
<span class="s1">&#39;zh-tw&#39;</span><span class="p">:</span> <span class="s1">&#39;chinese (traditional)&#39;</span><span class="p">,</span>
<span class="s1">&#39;co&#39;</span><span class="p">:</span> <span class="s1">&#39;corsican&#39;</span><span class="p">,</span>
<span class="s1">&#39;hr&#39;</span><span class="p">:</span> <span class="s1">&#39;croatian&#39;</span><span class="p">,</span>
<span class="s1">&#39;cs&#39;</span><span class="p">:</span> <span class="s1">&#39;czech&#39;</span><span class="p">,</span>
<span class="s1">&#39;da&#39;</span><span class="p">:</span> <span class="s1">&#39;danish&#39;</span><span class="p">,</span>
<span class="s1">&#39;nl&#39;</span><span class="p">:</span> <span class="s1">&#39;dutch&#39;</span><span class="p">,</span>
<span class="s1">&#39;en&#39;</span><span class="p">:</span> <span class="s1">&#39;english&#39;</span><span class="p">,</span>
<span class="s1">&#39;eo&#39;</span><span class="p">:</span> <span class="s1">&#39;esperanto&#39;</span><span class="p">,</span>
<span class="s1">&#39;et&#39;</span><span class="p">:</span> <span class="s1">&#39;estonian&#39;</span><span class="p">,</span>
<span class="s1">&#39;tl&#39;</span><span class="p">:</span> <span class="s1">&#39;filipino&#39;</span><span class="p">,</span>
<span class="s1">&#39;fi&#39;</span><span class="p">:</span> <span class="s1">&#39;finnish&#39;</span><span class="p">,</span>
<span class="s1">&#39;fr&#39;</span><span class="p">:</span> <span class="s1">&#39;french&#39;</span><span class="p">,</span>
<span class="s1">&#39;fy&#39;</span><span class="p">:</span> <span class="s1">&#39;frisian&#39;</span><span class="p">,</span>
<span class="s1">&#39;gl&#39;</span><span class="p">:</span> <span class="s1">&#39;galician&#39;</span><span class="p">,</span>
<span class="s1">&#39;ka&#39;</span><span class="p">:</span> <span class="s1">&#39;georgian&#39;</span><span class="p">,</span>
<span class="s1">&#39;de&#39;</span><span class="p">:</span> <span class="s1">&#39;german&#39;</span><span class="p">,</span>
<span class="s1">&#39;el&#39;</span><span class="p">:</span> <span class="s1">&#39;greek&#39;</span><span class="p">,</span>
<span class="s1">&#39;gu&#39;</span><span class="p">:</span> <span class="s1">&#39;gujarati&#39;</span><span class="p">,</span>
<span class="s1">&#39;ht&#39;</span><span class="p">:</span> <span class="s1">&#39;haitian creole&#39;</span><span class="p">,</span>
<span class="s1">&#39;ha&#39;</span><span class="p">:</span> <span class="s1">&#39;hausa&#39;</span><span class="p">,</span>
<span class="s1">&#39;haw&#39;</span><span class="p">:</span> <span class="s1">&#39;hawaiian&#39;</span><span class="p">,</span>
<span class="s1">&#39;iw&#39;</span><span class="p">:</span> <span class="s1">&#39;hebrew&#39;</span><span class="p">,</span>
<span class="s1">&#39;he&#39;</span><span class="p">:</span> <span class="s1">&#39;hebrew&#39;</span><span class="p">,</span>
<span class="s1">&#39;hi&#39;</span><span class="p">:</span> <span class="s1">&#39;hindi&#39;</span><span class="p">,</span>
<span class="s1">&#39;hmn&#39;</span><span class="p">:</span> <span class="s1">&#39;hmong&#39;</span><span class="p">,</span>
<span class="s1">&#39;hu&#39;</span><span class="p">:</span> <span class="s1">&#39;hungarian&#39;</span><span class="p">,</span>
<span class="s1">&#39;is&#39;</span><span class="p">:</span> <span class="s1">&#39;icelandic&#39;</span><span class="p">,</span>
<span class="s1">&#39;ig&#39;</span><span class="p">:</span> <span class="s1">&#39;igbo&#39;</span><span class="p">,</span>
<span class="s1">&#39;id&#39;</span><span class="p">:</span> <span class="s1">&#39;indonesian&#39;</span><span class="p">,</span>
<span class="s1">&#39;ga&#39;</span><span class="p">:</span> <span class="s1">&#39;irish&#39;</span><span class="p">,</span>
<span class="s1">&#39;it&#39;</span><span class="p">:</span> <span class="s1">&#39;italian&#39;</span><span class="p">,</span>
<span class="s1">&#39;ja&#39;</span><span class="p">:</span> <span class="s1">&#39;japanese&#39;</span><span class="p">,</span>
<span class="s1">&#39;jw&#39;</span><span class="p">:</span> <span class="s1">&#39;javanese&#39;</span><span class="p">,</span>
<span class="s1">&#39;kn&#39;</span><span class="p">:</span> <span class="s1">&#39;kannada&#39;</span><span class="p">,</span>
<span class="s1">&#39;kk&#39;</span><span class="p">:</span> <span class="s1">&#39;kazakh&#39;</span><span class="p">,</span>
<span class="s1">&#39;km&#39;</span><span class="p">:</span> <span class="s1">&#39;khmer&#39;</span><span class="p">,</span>
<span class="s1">&#39;ko&#39;</span><span class="p">:</span> <span class="s1">&#39;korean&#39;</span><span class="p">,</span>
<span class="s1">&#39;ku&#39;</span><span class="p">:</span> <span class="s1">&#39;kurdish (kurmanji)&#39;</span><span class="p">,</span>
<span class="s1">&#39;ky&#39;</span><span class="p">:</span> <span class="s1">&#39;kyrgyz&#39;</span><span class="p">,</span>
<span class="s1">&#39;lo&#39;</span><span class="p">:</span> <span class="s1">&#39;lao&#39;</span><span class="p">,</span>
<span class="s1">&#39;la&#39;</span><span class="p">:</span> <span class="s1">&#39;latin&#39;</span><span class="p">,</span>
<span class="s1">&#39;lv&#39;</span><span class="p">:</span> <span class="s1">&#39;latvian&#39;</span><span class="p">,</span>
<span class="s1">&#39;lt&#39;</span><span class="p">:</span> <span class="s1">&#39;lithuanian&#39;</span><span class="p">,</span>
<span class="s1">&#39;lb&#39;</span><span class="p">:</span> <span class="s1">&#39;luxembourgish&#39;</span><span class="p">,</span>
<span class="s1">&#39;mk&#39;</span><span class="p">:</span> <span class="s1">&#39;macedonian&#39;</span><span class="p">,</span>
<span class="s1">&#39;mg&#39;</span><span class="p">:</span> <span class="s1">&#39;malagasy&#39;</span><span class="p">,</span>
<span class="s1">&#39;ms&#39;</span><span class="p">:</span> <span class="s1">&#39;malay&#39;</span><span class="p">,</span>
<span class="s1">&#39;ml&#39;</span><span class="p">:</span> <span class="s1">&#39;malayalam&#39;</span><span class="p">,</span>
<span class="s1">&#39;mt&#39;</span><span class="p">:</span> <span class="s1">&#39;maltese&#39;</span><span class="p">,</span>
<span class="s1">&#39;mi&#39;</span><span class="p">:</span> <span class="s1">&#39;maori&#39;</span><span class="p">,</span>
<span class="s1">&#39;mr&#39;</span><span class="p">:</span> <span class="s1">&#39;marathi&#39;</span><span class="p">,</span>
<span class="s1">&#39;mn&#39;</span><span class="p">:</span> <span class="s1">&#39;mongolian&#39;</span><span class="p">,</span>
<span class="s1">&#39;my&#39;</span><span class="p">:</span> <span class="s1">&#39;myanmar (burmese)&#39;</span><span class="p">,</span>
<span class="s1">&#39;ne&#39;</span><span class="p">:</span> <span class="s1">&#39;nepali&#39;</span><span class="p">,</span>
<span class="s1">&#39;no&#39;</span><span class="p">:</span> <span class="s1">&#39;norwegian&#39;</span><span class="p">,</span>
<span class="s1">&#39;or&#39;</span><span class="p">:</span> <span class="s1">&#39;odia&#39;</span><span class="p">,</span>
<span class="s1">&#39;ps&#39;</span><span class="p">:</span> <span class="s1">&#39;pashto&#39;</span><span class="p">,</span>
<span class="s1">&#39;fa&#39;</span><span class="p">:</span> <span class="s1">&#39;persian&#39;</span><span class="p">,</span>
<span class="s1">&#39;pl&#39;</span><span class="p">:</span> <span class="s1">&#39;polish&#39;</span><span class="p">,</span>
<span class="s1">&#39;pt&#39;</span><span class="p">:</span> <span class="s1">&#39;portuguese&#39;</span><span class="p">,</span>
<span class="s1">&#39;pa&#39;</span><span class="p">:</span> <span class="s1">&#39;punjabi&#39;</span><span class="p">,</span>
<span class="s1">&#39;ro&#39;</span><span class="p">:</span> <span class="s1">&#39;romanian&#39;</span><span class="p">,</span>
<span class="s1">&#39;ru&#39;</span><span class="p">:</span> <span class="s1">&#39;russian&#39;</span><span class="p">,</span>
<span class="s1">&#39;sm&#39;</span><span class="p">:</span> <span class="s1">&#39;samoan&#39;</span><span class="p">,</span>
<span class="s1">&#39;gd&#39;</span><span class="p">:</span> <span class="s1">&#39;scots gaelic&#39;</span><span class="p">,</span>
<span class="s1">&#39;sr&#39;</span><span class="p">:</span> <span class="s1">&#39;serbian&#39;</span><span class="p">,</span>
<span class="s1">&#39;st&#39;</span><span class="p">:</span> <span class="s1">&#39;sesotho&#39;</span><span class="p">,</span>
<span class="s1">&#39;sn&#39;</span><span class="p">:</span> <span class="s1">&#39;shona&#39;</span><span class="p">,</span>
<span class="s1">&#39;sd&#39;</span><span class="p">:</span> <span class="s1">&#39;sindhi&#39;</span><span class="p">,</span>
<span class="s1">&#39;si&#39;</span><span class="p">:</span> <span class="s1">&#39;sinhala&#39;</span><span class="p">,</span>
<span class="s1">&#39;sk&#39;</span><span class="p">:</span> <span class="s1">&#39;slovak&#39;</span><span class="p">,</span>
<span class="s1">&#39;sl&#39;</span><span class="p">:</span> <span class="s1">&#39;slovenian&#39;</span><span class="p">,</span>
<span class="s1">&#39;so&#39;</span><span class="p">:</span> <span class="s1">&#39;somali&#39;</span><span class="p">,</span>
<span class="s1">&#39;es&#39;</span><span class="p">:</span> <span class="s1">&#39;spanish&#39;</span><span class="p">,</span>
<span class="s1">&#39;su&#39;</span><span class="p">:</span> <span class="s1">&#39;sundanese&#39;</span><span class="p">,</span>
<span class="s1">&#39;sw&#39;</span><span class="p">:</span> <span class="s1">&#39;swahili&#39;</span><span class="p">,</span>
<span class="s1">&#39;sv&#39;</span><span class="p">:</span> <span class="s1">&#39;swedish&#39;</span><span class="p">,</span>
<span class="s1">&#39;tg&#39;</span><span class="p">:</span> <span class="s1">&#39;tajik&#39;</span><span class="p">,</span>
<span class="s1">&#39;ta&#39;</span><span class="p">:</span> <span class="s1">&#39;tamil&#39;</span><span class="p">,</span>
<span class="s1">&#39;te&#39;</span><span class="p">:</span> <span class="s1">&#39;telugu&#39;</span><span class="p">,</span>
<span class="s1">&#39;th&#39;</span><span class="p">:</span> <span class="s1">&#39;thai&#39;</span><span class="p">,</span>
<span class="s1">&#39;tr&#39;</span><span class="p">:</span> <span class="s1">&#39;turkish&#39;</span><span class="p">,</span>
<span class="s1">&#39;uk&#39;</span><span class="p">:</span> <span class="s1">&#39;ukrainian&#39;</span><span class="p">,</span>
<span class="s1">&#39;ur&#39;</span><span class="p">:</span> <span class="s1">&#39;urdu&#39;</span><span class="p">,</span>
<span class="s1">&#39;ug&#39;</span><span class="p">:</span> <span class="s1">&#39;uyghur&#39;</span><span class="p">,</span>
<span class="s1">&#39;uz&#39;</span><span class="p">:</span> <span class="s1">&#39;uzbek&#39;</span><span class="p">,</span>
<span class="s1">&#39;vi&#39;</span><span class="p">:</span> <span class="s1">&#39;vietnamese&#39;</span><span class="p">,</span>
<span class="s1">&#39;cy&#39;</span><span class="p">:</span> <span class="s1">&#39;welsh&#39;</span><span class="p">,</span>
<span class="s1">&#39;xh&#39;</span><span class="p">:</span> <span class="s1">&#39;xhosa&#39;</span><span class="p">,</span>
<span class="s1">&#39;yi&#39;</span><span class="p">:</span> <span class="s1">&#39;yiddish&#39;</span><span class="p">,</span>
<span class="s1">&#39;yo&#39;</span><span class="p">:</span> <span class="s1">&#39;yoruba&#39;</span><span class="p">,</span>
<span class="s1">&#39;zu&#39;</span><span class="p">:</span> <span class="s1">&#39;zulu&#39;</span><span class="p">,</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="googletrans-default-service-urls">
<h1>googletrans.DEFAULT_SERVICE_URLS<a class="headerlink" href="#googletrans-default-service-urls" title="Permalink to this headline"></a></h1>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p><a class="reference external" href="https://github.com/ssut/py-googletrans/blob/master/googletrans/constants.py#L3:1">DEFAULT_SERVICE_URLS</a> is the list of current available Google Translation service urls.</p>
<p>For using these service urls, please check <a class="reference internal" href="#customize-service-url">Customize service URL</a>.</p>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<a href="https://github.com/ssut/py-googletrans" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="py-modindex.html" title="Python Module Index"
>modules</a></li>
<li class="nav-item nav-item-0"><a href="#">Googletrans 3.0.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Googletrans: Free and Unlimited Google translate API for Python</a></li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, SuHun Han (ssut).
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 3.2.1.Theme by <a href="http://github.com/vkvn">vkvn</a>
</div>
</body>
</html>