-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
gummy.utils.journal_utils.html
243 lines (216 loc) · 18.8 KB
/
gummy.utils.journal_utils.html
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="gummy.utils.journal_utils module" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://iwasakishuto.github.io/Translation-Gummy/gummy.utils.journal_utils.html" />
<meta property="og:description" content="Utility programs for journals" />
<meta property="og:image" content="https://iwasakishuto.github.io/images/FacebookImage/Translation-Gummy.png" />
<meta property="og:site_name" content="Translation-Gummy" />
<meta name="twitter:site" content="@cabernet_rock" />
<meta name="twitter:card" content="summary">
<meta name="twitter:image:src" content="https://iwasakishuto.github.io/images/FacebookImage/Translation-Gummy.png">
<title>gummy.utils.journal_utils module — Translation-Gummy documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
<link rel="stylesheet" type="text/css" href="_static/font-awesome/css/solid.css" />
<link rel="stylesheet" type="text/css" href="_static/font-awesome/css/brands.css" />
<link rel="stylesheet" type="text/css" href="_static/font-awesome/css/fontawesome.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>
<script src="_static/custom.js"></script>
<link rel="shortcut icon" href="_static/favicon.png"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="gummy.utils.monitor_utils module" href="gummy.utils.monitor_utils.html" />
<link rel="prev" title="gummy.utils.generic_utils module" href="gummy.utils.generic_utils.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="gummy.utils.monitor_utils.html" title="gummy.utils.monitor_utils module"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="gummy.utils.generic_utils.html" title="gummy.utils.generic_utils module"
accesskey="P">previous</a> |</li>
<li><i class="fas fa-home"></i><a href="https://iwasakishuto.github.io/">Portfolio Top</a> »</li>
<li class="nav-item nav-item-0"><a href="index.html">Translation-Gummy documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="gummy.html" >gummy package</a> »</li>
<li class="nav-item nav-item-2"><a href="gummy.utils.html" accesskey="U">gummy.utils package</a> »</li>
<li class="nav-item nav-item-this"><a href="">gummy.utils.journal_utils module</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-gummy.utils.journal_utils">
<span id="gummy-utils-journal-utils-module"></span><h1>gummy.utils.journal_utils module<a class="headerlink" href="#module-gummy.utils.journal_utils" title="Permalink to this headline">¶</a></h1>
<p>Utility programs for <a class="reference internal" href="gummy.journals.html#module-gummy.journals" title="gummy.journals"><code class="xref py py-mod docutils literal notranslate"><span class="pre">journals</span></code></a></p>
<dl class="py data">
<dt id="gummy.utils.journal_utils.DOMAIN2JOURNAL">
<code class="sig-prename descclassname">gummy.utils.journal_utils.</code><code class="sig-name descname">DOMAIN2JOURNAL</code><em class="property"> = {'aacrjournals.org': 'AACRPublications', 'academic.oup.com': 'OxfordAcademic', 'advances.sciencemag.org': 'ScienceAdvances', 'agupubs.onlinelibrary.wiley.com': 'AGUPublications', 'aip.scitation.org': 'Scitation', 'ajp.amjpathol.org': 'ASIP', 'anatomypubs.onlinelibrary.wiley.com': 'AnatomyPubs', 'arxiv.org': 'arXiv', 'bio.biologists.org': 'Biologists', 'biologydirect.biomedcentral.com': 'BioMedCentral', 'biomedgrid.com': 'BiomedGrid', 'bloodcancerdiscov.aacrjournals.org': 'AACRPublications', 'bmcbioinformatics.biomedcentral.com': 'BioMedCentral', 'bmcevolbiol.biomedcentral.com': 'BioMedCentral', 'bmcgenomics.biomedcentral.com': 'BioMedCentral', 'bmcmedicine.biomedcentral.com': 'BioMedCentral', 'cancerdiscovery.aacrjournals.or': 'AACRPublications', 'cancerimmunolres.aacrjournals.org': 'AACRPublications', 'cancerpreventionresearch.aacrjournals.org': 'AACRPublications', 'cancerres.aacrjournals.org': 'AACRPublications', 'cebp.aacrjournals.or': 'AACRPublications', 'chemrxiv.org': 'ChemRxiv', 'clincancerres.aacrjournals.org': 'AACRPublications', 'dev.biologists.org': 'Biologists', 'dl.acm.org': 'ACM', 'eymj.org': 'YMJ', 'faseb.onlinelibrary.wiley.com': 'WileyOnlineLibrary', 'febs.onlinelibrary.wiley.com': 'WileyOnlineLibrary', 'genesdev.cshlp.org': 'GeneDev', 'genomebiology.biomedcentral.com': 'BioMedCentral', 'ieeexplore.ieee.org': 'ieeexplore', 'iopscience.iop.org': 'IOPScience', 'iovs.arvojournals.org': 'ARVOJournals', 'jamanetwork.com': 'JAMANetwork', 'jcs.biologists.org': 'Biologists', 'jkms.org': 'JKMS', 'journals.ametsoc.org': 'AMS', 'journals.aps.org': 'APS', 'journals.lww.com': 'LWWJournals', 'journals.physiology.org': 'RenalPhysiology', 'journals.plos.org': 'PLOSONE', 'journals.sagepub.com': 'SAGEjournals', 'jov.arvojournals.org': 'ARVOJournals', 'keio.pure.elsevier.com': 'UniKeio', 'learnmem.cshlp.org': 'LearningMemory', 'link.springer.com': 'Springer', 'linkinghub.elsevier.com': 'ScienceDirect', 'mcb.asm.org': 'MolCellBio', 'mcr.aacrjournals.org': 'AACRPublications', 'mct.aacrjournals.org': 'AACRPublications', 'onlinelibrary.wiley.com': 'WileyOnlineLibrary', 'psycnet.apa.org': 'PsycNet', 'pubmed.ncbi.nlm.nih.gov': 'PubMed', 'pubs.acs.org': 'ACSPublications', 'pubs.rsc.org': 'RSCPublishing', 'pubs.rsna.org': 'RadioGraphics', 'retrovirology.biomedcentral.com': 'BioMedCentral', 'rnajournal.cshlp.org': 'RNAjournal', 'science.sciencemag.org': 'ScienceMag', 'stemcellsjournals.onlinelibrary.wiley.com': 'StemCells', 'tvst.arvojournals.org': 'ARVOJournals', 'www.aclweb.org': 'ACLAnthology', 'www.biorxiv.org': 'bioRxiv', 'www.bioscience.org': 'Bioscience', 'www.cell.com': 'CellPress', 'www.e-ce.org': 'ClinicalEndoscopy', 'www.embopress.org': 'EMBOPress', 'www.frontiersin.org': 'frontiers', 'www.future-science.com': 'FutureScience', 'www.genetics.org': 'Genetics', 'www.hindawi.com': 'Hindawi', 'www.intechopen.com': 'IntechOpen', 'www.jbc.org': 'JBC', 'www.jkms.org': 'JKMS', 'www.jkns.or.kr': 'JKNS', 'www.jneurosci.org': 'JNeurosci', 'www.jpedsurg.org': 'PediatricSurgery', 'www.jsse.org': 'JSSE', 'www.jstage.jst.go.jp': 'JSTAGE', 'www.lungcancerjournal.info': 'LungCancer', 'www.mdpi.com': 'MDPI', 'www.medrxiv.org': 'medRxiv', 'www.minervamedica.it': 'MinervaMedica', 'www.nature.com': 'Nature', 'www.ncbi.nlm.nih.gov': 'NCBI', 'www.nejm.org': 'NEJM', 'www.nrcresearchpress.com': 'NRCResearchPress', 'www.nrronline.org': 'NRR', 'www.oncotarget.com': 'Oncotarget', 'www.ou.edu': 'UniOKLAHOMA', 'www.plantphysiol.org': 'ASPB', 'www.pnas.org': 'PNAS', 'www.psychiatrist.com': 'PsyChiArtist', 'www.sciencedirect.com': 'ScienceDirect', 'www.scitation.org': 'Scitation', 'www.spandidos-publications.com': 'Spandidos', 'www.tandfonline.com': 'TaylorandFrancisOnline', 'www.thelancet.com': 'TheLancet'}</em><a class="headerlink" href="#gummy.utils.journal_utils.DOMAIN2JOURNAL" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary that describes the correspondence between URL domain and the crawler of GummyCrawler.</p>
<p>How to write in a file when adding a new domain.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">gummy.utils.journal_utils</span> <span class="kn">import</span> <span class="n">DOMAIN2JOURNAL</span>
<span class="gp">>>> </span><span class="n">digit</span> <span class="o">=</span> <span class="nb">max</span><span class="p">([</span><span class="nb">len</span><span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">DOMAIN2JOURNAL</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span><span class="o">+</span><span class="mi">2</span>
<span class="gp">>>> </span><span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">DOMAIN2JOURNAL</span><span class="o">.</span><span class="n">items</span><span class="p">(),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]):</span>
<span class="gp">... </span> <span class="n">k</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">'"</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s1">"'</span>
<span class="gp">... </span> <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">' </span><span class="si">{</span><span class="n">k</span><span class="si">:</span><span class="s1"><</span><span class="si">{</span><span class="n">digit</span><span class="si">}}</span><span class="s1"> : "</span><span class="si">{</span><span class="n">v</span><span class="si">}</span><span class="s1">",'</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>dict</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="gummy.utils.journal_utils.canonicalize">
<code class="sig-prename descclassname">gummy.utils.journal_utils.</code><code class="sig-name descname">canonicalize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">url</span></em>, <em class="sig-param"><span class="n">driver</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">sleep_for_loading</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/gummy/utils/journal_utils.html#canonicalize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gummy.utils.journal_utils.canonicalize" title="Permalink to this definition">¶</a></dt>
<dd><p>canonicalize the URL by accessing the URL once.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL of the paper.</p></li>
<li><p><strong>driver</strong> (<em>WebDriver</em>) – Selenium WebDriver. (default= <code class="docutils literal notranslate"><span class="pre">None</span></code>)</p></li>
<li><p><strong>sleep_for_loading</strong> (<em>int</em>) – Number of seconds to wait for a web page to load (default= <code class="docutils literal notranslate"><span class="pre">1</span></code> )</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>canonized URL.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="gummy.utils.journal_utils.whichJournal">
<code class="sig-prename descclassname">gummy.utils.journal_utils.</code><code class="sig-name descname">whichJournal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">url</span></em>, <em class="sig-param"><span class="n">driver</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">verbose</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/gummy/utils/journal_utils.html#whichJournal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gummy.utils.journal_utils.whichJournal" title="Permalink to this definition">¶</a></dt>
<dd><p>Decide which journal from the domain of the <code class="docutils literal notranslate"><span class="pre">url</span></code></p>
<p>If the <code class="docutils literal notranslate"><span class="pre">journal_type</span></code> cannot be determined, Twitter DM <a class="reference external" href="https://www.twitter.com/messages/compose?recipient_id=1042783905697288193&text=Please%20support%20this%20journal%3A%20"><img alt="twitter badge" src="https://img.shields.io/badge/twitter-Requests-1da1f2?style=flat-square&logo=twitter" /></a> will
open automatically, so please feel free to request it to the developer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL of the paper.</p></li>
<li><p><strong>driver</strong> (<em>WebDriver</em>) – Selenium WebDriver. (default= <code class="docutils literal notranslate"><span class="pre">None</span></code>)</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) – Whether to print message or not. (default= <code class="docutils literal notranslate"><span class="pre">True</span></code>)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>journal_type</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">journal_type</span> <span class="o">=</span> <span class="n">whichJournal</span><span class="p">(</span><span class="s2">"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1573881/"</span><span class="p">)</span>
<span class="go">Estimated Journal Type : NCBI</span>
<span class="gp">>>> </span><span class="n">journal_type</span>
<span class="go">'ncbi'</span>
</pre></div>
</div>
</dd></dl>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Other contents</h4>
<ul class="social">
<li><a href="https://iwasakishuto.github.io/Blog/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Blog.png"></a></li>
<li><a href="https://iwasakishuto.github.io/University/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/University.png"></a></li>
<li><a href="https://iwasakishuto.github.io/Front-End/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Front-End.png"></a></li>
<li><a href="https://iwasakishuto.github.io/Kerasy/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Kerasy.png"></a></li>
<li><a href="https://iwasakishuto.github.io/Python-Charmers/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Python-Charmers.png"></a></li>
</ul>
<h4>Social link</h4>
<ul class="social">
<li><a class="sc-twitter" href="https://twitter.com/cabernet_rock">
<i class="fab fa-twitter" aria-hidden="true"></i>
</a></li>
<li><a class="sc-github" href="https://github.com/iwasakishuto">
<i class="fab fa-github" aria-hidden="true"></i>
</a></li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="gummy.utils.generic_utils.html"
title="previous chapter">gummy.utils.generic_utils module</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="gummy.utils.monitor_utils.html"
title="next chapter">gummy.utils.monitor_utils module</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/gummy.utils.journal_utils.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="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="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="gummy.utils.monitor_utils.html" title="gummy.utils.monitor_utils module"
>next</a> |</li>
<li class="right" >
<a href="gummy.utils.generic_utils.html" title="gummy.utils.generic_utils module"
>previous</a> |</li>
<li><i class="fas fa-home"></i><a href="https://iwasakishuto.github.io/">Portfolio Top</a> »</li>
<li class="nav-item nav-item-0"><a href="index.html">Translation-Gummy documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="gummy.html" >gummy package</a> »</li>
<li class="nav-item nav-item-2"><a href="gummy.utils.html" >gummy.utils package</a> »</li>
<li class="nav-item nav-item-this"><a href="">gummy.utils.journal_utils module</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2021, iwasakishuto.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-164333757-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-164333757-6');
</script>
</body>
</html>