mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2026-04-05 14:35:49 +00:00
updated tests & docstrings of LookupLib
This commit is contained in:
parent
644306bea0
commit
4e4e94091d
19 changed files with 329 additions and 137 deletions
BIN
docs/build/doctrees/environment.pickle
vendored
BIN
docs/build/doctrees/environment.pickle
vendored
Binary file not shown.
BIN
docs/build/doctrees/license.doctree
vendored
BIN
docs/build/doctrees/license.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/lookuplib.doctree
vendored
BIN
docs/build/doctrees/lookuplib.doctree
vendored
Binary file not shown.
23
docs/build/html/_sources/license.txt
vendored
23
docs/build/html/_sources/license.txt
vendored
|
|
@ -1,10 +1,27 @@
|
|||
license
|
||||
=======
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
bla bla bla
|
||||
Copyright (c) 2014 Tobias Wellnitz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Contact:
|
||||
========
|
||||
Contact DH1TW
|
||||
Contact Tobias@dh1tw.de
|
||||
|
|
|
|||
25
docs/build/html/license.html
vendored
25
docs/build/html/license.html
vendored
|
|
@ -32,9 +32,6 @@
|
|||
<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><a href="index.html">pyhamtools 0.1 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -47,11 +44,26 @@
|
|||
<div class="section" id="license">
|
||||
<h1>license<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h1>
|
||||
<p>The MIT License (MIT)</p>
|
||||
<p>bla bla bla</p>
|
||||
<p>Copyright (c) 2014 Tobias Wellnitz</p>
|
||||
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the “Software”), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:</p>
|
||||
<p>The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.</p>
|
||||
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.</p>
|
||||
</div>
|
||||
<div class="section" id="contact">
|
||||
<h1>Contact:<a class="headerlink" href="#contact" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Contact DH1TW</p>
|
||||
<p>Contact <a class="reference external" href="mailto:Tobias%40dh1tw.de">Tobias<span>@</span>dh1tw<span>.</span>de</a></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -94,9 +106,6 @@
|
|||
<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><a href="index.html">pyhamtools 0.1 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
107
docs/build/html/lookuplib.html
vendored
107
docs/build/html/lookuplib.html
vendored
|
|
@ -56,16 +56,17 @@
|
|||
</div>
|
||||
<span class="target" id="module-pyhamtools.lookuplib"></span><dl class="class">
|
||||
<dt id="pyhamtools.lookuplib.LookupLib">
|
||||
<em class="property">class </em><tt class="descclassname">pyhamtools.lookuplib.</tt><tt class="descname">LookupLib</tt><big>(</big><em>lookuptype='clublogxml'</em>, <em>apikey=None</em>, <em>filename=None</em>, <em>logger=None</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This class provides a homogeneous interface to three different Amateur Radio Callsign lookup sources:</p>
|
||||
<em class="property">class </em><tt class="descclassname">pyhamtools.lookuplib.</tt><tt class="descname">LookupLib</tt><big>(</big><em>lookuptype='countryfile'</em>, <em>apikey=None</em>, <em>filename=None</em>, <em>logger=None</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This class is a wrapper for the following three Amateur Radio databases:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Clublog.org (daily updated XML File)</li>
|
||||
<li>Clublog.org (HTTPS lookup)</li>
|
||||
<li>Country-files.com (infrequently updated PLIST File)</li>
|
||||
</ol>
|
||||
<p>The class provides getters to access the data in a structured way. Even the interface is the same
|
||||
for all lookup sources, the returning data can be different. The documentation of the various
|
||||
methods provide more detail.</p>
|
||||
<p>It’s aim is to provide a homogeneous interface to different data sources.</p>
|
||||
<p>Typically it is injected as a dependency in the Callinfo class, but can also be used directly.</p>
|
||||
<p>Even the interface is the same for all lookup sources, the returning data can be different.
|
||||
The documentation of the various methods provide more detail.</p>
|
||||
<p>By default, LookupLib requires an Internet connection to download the libraries or perform the
|
||||
lookup against the Clublog API.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
|
|
@ -84,7 +85,7 @@ lookup against the Clublog API.</p>
|
|||
</table>
|
||||
<dl class="method">
|
||||
<dt id="pyhamtools.lookuplib.LookupLib.is_invalid_operation">
|
||||
<tt class="descname">is_invalid_operation</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956076</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.is_invalid_operation" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">is_invalid_operation</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>25</em>, <em>21</em>, <em>44</em>, <em>34</em>, <em>169942</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.is_invalid_operation" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns True if an operations is known as invalid</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
|
|
@ -103,7 +104,7 @@ lookup against the Clublog API.</p>
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> –
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
||||
No matching callsign found</li>
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> –
|
||||
API Key for Clublog missing or incorrect</li>
|
||||
|
|
@ -112,6 +113,22 @@ API Key for Clublog missing or incorrect</li>
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="rubric">Example</p>
|
||||
<p>The following code checks the Clublog XML database if the operation is valid for two dates.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pyhamtools</span> <span class="kn">import</span> <span class="n">LookupLib</span>
|
||||
<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
|
||||
<span class="gp">>>> </span><span class="kn">import</span> <span class="nn">pytz</span>
|
||||
<span class="gp">>>> </span><span class="n">my_lookuplib</span> <span class="o">=</span> <span class="n">LookupLib</span><span class="p">(</span><span class="n">lookuptype</span><span class="o">=</span><span class="s">"clublogxml"</span><span class="p">,</span> <span class="n">apikey</span><span class="o">=</span><span class="s">"myapikey"</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="k">print</span> <span class="n">my_lookuplib</span><span class="o">.</span><span class="n">is_invalid_operation</span><span class="p">(</span><span class="s">"5W1CFN"</span><span class="p">)</span>
|
||||
<span class="go">True</span>
|
||||
<span class="gp">>>> </span><span class="k">try</span><span class="p">:</span>
|
||||
<span class="gp">>>> </span> <span class="n">timestamp</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="o">=</span><span class="mi">2012</span><span class="p">,</span> <span class="n">month</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">day</span><span class="o">=</span><span class="mi">31</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">tzinfo</span><span class="o">=</span><span class="n">pytz</span><span class="o">.</span><span class="n">UTC</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span> <span class="n">my_lookuplib</span><span class="o">.</span><span class="n">is_invalid_operation</span><span class="p">(</span><span class="s">"5W1CFN"</span><span class="p">,</span> <span class="n">timestamp</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
|
||||
<span class="gp">>>> </span> <span class="k">print</span> <span class="s">"Seems to be invalid operation before 31.1.2012"</span>
|
||||
<span class="go">Seems to be an invalid operation before 31.1.2012</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p>This method is available for</p>
|
||||
|
|
@ -123,7 +140,7 @@ API Key for Clublog missing or incorrect</li>
|
|||
|
||||
<dl class="method">
|
||||
<dt id="pyhamtools.lookuplib.LookupLib.lookup_callsign">
|
||||
<tt class="descname">lookup_callsign</tt><big>(</big><em>callsign=None</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956058</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.lookup_callsign" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">lookup_callsign</tt><big>(</big><em>callsign=None</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>25</em>, <em>21</em>, <em>44</em>, <em>34</em>, <em>169924</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.lookup_callsign" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns lookup data if an exception exists for a callsign</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
|
|
@ -142,7 +159,7 @@ API Key for Clublog missing or incorrect</li>
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> –
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
||||
No matching callsign found</li>
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> –
|
||||
API Key for Clublog missing or incorrect</li>
|
||||
|
|
@ -151,6 +168,24 @@ API Key for Clublog missing or incorrect</li>
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="rubric">Example</p>
|
||||
<p>The following code queries the the online Clublog API for the callsign “VK9XO” on a specific date.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pyhamtools</span> <span class="kn">import</span> <span class="n">LookupLib</span>
|
||||
<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
|
||||
<span class="gp">>>> </span><span class="kn">import</span> <span class="nn">pytz</span>
|
||||
<span class="gp">>>> </span><span class="n">my_lookuplib</span> <span class="o">=</span> <span class="n">LookupLib</span><span class="p">(</span><span class="n">lookuptype</span><span class="o">=</span><span class="s">"clublogapi"</span><span class="p">,</span> <span class="n">apikey</span><span class="o">=</span><span class="s">"myapikey"</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="n">timestamp</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="n">year</span><span class="o">=</span><span class="mi">1962</span><span class="p">,</span> <span class="n">month</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">day</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">tzinfo</span><span class="o">=</span><span class="n">pytz</span><span class="o">.</span><span class="n">UTC</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="k">print</span> <span class="n">my_lookuplib</span><span class="o">.</span><span class="n">lookup_callsign</span><span class="p">(</span><span class="s">"VK9XO"</span><span class="p">,</span> <span class="n">timestamp</span><span class="p">)</span>
|
||||
<span class="go">{</span>
|
||||
<span class="go"> 'country': 'CHRISTMAS ISLAND',</span>
|
||||
<span class="go"> 'longitude': -105.7,</span>
|
||||
<span class="go"> 'cqz': 29,</span>
|
||||
<span class="go"> 'adif': 35,</span>
|
||||
<span class="go"> 'latitude': -10.5,</span>
|
||||
<span class="go"> 'continent': 'OC'</span>
|
||||
<span class="go">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p>This method is available for</p>
|
||||
|
|
@ -176,11 +211,28 @@ API Key for Clublog missing or incorrect</li>
|
|||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> –
|
||||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
||||
No matching entity found</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="rubric">Example</p>
|
||||
<p>The following code queries the the Clublog XML database for the ADIF entity Turkmenistan, which has
|
||||
the id 273.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pyhamtools</span> <span class="kn">import</span> <span class="n">LookupLib</span>
|
||||
<span class="gp">>>> </span><span class="n">my_lookuplib</span> <span class="o">=</span> <span class="n">LookupLib</span><span class="p">(</span><span class="n">lookuptype</span><span class="o">=</span><span class="s">"clublogapi"</span><span class="p">,</span> <span class="n">apikey</span><span class="o">=</span><span class="s">"myapikey"</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="k">print</span> <span class="n">my_lookuplib</span><span class="o">.</span><span class="n">lookup_entity</span><span class="p">(</span><span class="mi">273</span><span class="p">)</span>
|
||||
<span class="go">{</span>
|
||||
<span class="go"> 'deleted': False,</span>
|
||||
<span class="go"> 'country': 'TURKMENISTAN',</span>
|
||||
<span class="go"> 'longitude': -58.4,</span>
|
||||
<span class="go"> 'cqz': 17,</span>
|
||||
<span class="go"> 'prefix': 'EZ',</span>
|
||||
<span class="go"> 'latitude': 38.0,</span>
|
||||
<span class="go"> 'continent': 'AS'</span>
|
||||
<span class="go">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p>This method is available for the following lookup type</p>
|
||||
|
|
@ -192,7 +244,7 @@ No matching entity found</td>
|
|||
|
||||
<dl class="method">
|
||||
<dt id="pyhamtools.lookuplib.LookupLib.lookup_prefix">
|
||||
<tt class="descname">lookup_prefix</tt><big>(</big><em>prefix</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956058</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.lookup_prefix" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">lookup_prefix</tt><big>(</big><em>prefix</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>25</em>, <em>21</em>, <em>44</em>, <em>34</em>, <em>169924</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.lookup_prefix" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns lookup data of a Prefix</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
|
|
@ -211,7 +263,7 @@ No matching entity found</td>
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> –
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
||||
No matching Prefix found</li>
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> –
|
||||
API Key for Clublog missing or incorrect</li>
|
||||
|
|
@ -220,6 +272,23 @@ API Key for Clublog missing or incorrect</li>
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="rubric">Example</p>
|
||||
<p>The following code shows how to obtain the information for the prefix “DH” from the countryfile.com
|
||||
database (default database).</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pyhamtools</span> <span class="kn">import</span> <span class="n">LookupLib</span>
|
||||
<span class="gp">>>> </span><span class="n">myLookupLib</span> <span class="o">=</span> <span class="n">LookupLib</span><span class="p">()</span>
|
||||
<span class="gp">>>> </span><span class="k">print</span> <span class="n">myLookupLib</span><span class="o">.</span><span class="n">lookup_prefix</span><span class="p">(</span><span class="s">"DH"</span><span class="p">)</span>
|
||||
<span class="go">{</span>
|
||||
<span class="go"> 'adif': 230,</span>
|
||||
<span class="go"> 'country': 'Fed. Rep. of Germany',</span>
|
||||
<span class="go"> 'longitude': -10.0,</span>
|
||||
<span class="go"> 'cqz': 14,</span>
|
||||
<span class="go"> 'ituz': 28,</span>
|
||||
<span class="go"> 'latitude': 51.0,</span>
|
||||
<span class="go"> 'continent': 'EU'</span>
|
||||
<span class="go">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p>This method is available for</p>
|
||||
|
|
@ -232,7 +301,7 @@ API Key for Clublog missing or incorrect</li>
|
|||
|
||||
<dl class="method">
|
||||
<dt id="pyhamtools.lookuplib.LookupLib.lookup_zone_exception">
|
||||
<tt class="descname">lookup_zone_exception</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956082</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.lookup_zone_exception" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">lookup_zone_exception</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>4</em>, <em>25</em>, <em>21</em>, <em>44</em>, <em>34</em>, <em>169948</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.lookuplib.LookupLib.lookup_zone_exception" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a CQ Zone if an exception exists for the given callsign</p>
|
||||
<p>Args:
|
||||
callsign (string): Amateur radio callsign
|
||||
|
|
@ -248,7 +317,7 @@ timestamp (datetime, optional): datetime in UTC (tzinfo=pytz.UTC)</p>
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> –
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
||||
No matching callsign found</li>
|
||||
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> –
|
||||
API Key for Clublog missing or incorrect</li>
|
||||
|
|
@ -257,6 +326,16 @@ API Key for Clublog missing or incorrect</li>
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="rubric">Example</p>
|
||||
<p>The following code checks the Clublog XML database if a CQ Zone exception exists for the callsign DP0GVN.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pyhamtools</span> <span class="kn">import</span> <span class="n">LookupLib</span>
|
||||
<span class="gp">>>> </span><span class="n">my_lookuplib</span> <span class="o">=</span> <span class="n">LookupLib</span><span class="p">(</span><span class="n">lookuptype</span><span class="o">=</span><span class="s">"clublogxml"</span><span class="p">,</span> <span class="n">apikey</span><span class="o">=</span><span class="s">"myapikey"</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="k">print</span> <span class="n">my_lookuplib</span><span class="o">.</span><span class="n">lookup_zone_exception</span><span class="p">(</span><span class="s">"DP0GVN"</span><span class="p">)</span>
|
||||
<span class="go">38</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The prefix “DP” It is assigned to Germany, but the station is located in Antarctica, and therefore
|
||||
in CQ Zone 38</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p>This method is available for</p>
|
||||
|
|
|
|||
2
docs/build/html/searchindex.js
vendored
2
docs/build/html/searchindex.js
vendored
|
|
@ -1 +1 @@
|
|||
Search.setIndex({envversion:42,terms:{all:3,code:0,identifi:3,text:[],prefix:3,radio:[0,3],same:3,follow:[0,3],entiti:3,xml:3,current:0,clublogxml:3,zone:3,explain:[],except:3,dict:3,tzinfo:3,bool:3,logger:3,match:3,applic:0,lookup_ent:3,sourc:3,"return":3,string:3,variou:3,utc:3,python:[0,3],timestamp:3,veri:[],requir:3,infrequ:3,like:0,specif:3,bla:2,"default":3,stuff:[],necessari:0,contain:[0,3],found:3,readthedoc:0,page:0,some:0,see:0,callsign:[0,3],connect:3,arg:3,download:3,librari:[0,3],even:3,index:0,lookuptyp:3,lookup_prefix:3,lookup_zone_except:3,content:[],version:0,internet:3,print:[],irc:0,complic:[],method:3,kei:3,differ:3,dictionari:3,org:[0,3],come:0,lookup_callsign:3,valu:3,search:0,cty:3,against:3,datetim:3,countri:3,dh1tw:[0,1,2],com:[0,3],frequent:0,oper:3,apikeymissingerror:3,modul:[],filenam:3,api:3,"__name__":3,noresult:3,miss:3,given:3,log:3,wai:3,three:3,avail:3,interfac:3,paramet:3,type:3,more:3,amateur:[0,3],option:3,is_invalid_oper:3,pytz:3,pars:0,known:3,getter:3,"true":3,countryfil:3,none:3,provid:3,access:3,structur:3,record:3,apikei:3,can:3,str:3,webirc:0,creat:0,"int":3,clublogapi:3,exist:3,file:[0,3],deltaxrai:0,plist:3,incorrect:3,perform:3,detail:3,invalid:3,note:[],lookup:3,which:[0,3],you:0,mit:2,lookuplib:[],updat:3,http:[0,3],clublog:3,rais:3,adif:3,bsd:0,data:3,"class":[0,3],homogen:3,github:0,faster:0,descript:[],issu:0,hamtest:0,contact:[],getlogg:3,thi:3,time:3,hello:[],daili:3},objtypes:{"0":"py:module","1":"py:method","2":"py:class"},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","class","Python class"]},filenames:["index","help","license","LookupLib"],titles:["PyHamTools","help","license","LookupLib"],objects:{pyhamtools:{lookuplib:[3,0,0,"-"]},"pyhamtools.lookuplib":{LookupLib:[3,2,1,""]},"pyhamtools.lookuplib.LookupLib":{lookup_prefix:[3,1,1,""],lookup_entity:[3,1,1,""],lookup_zone_exception:[3,1,1,""],lookup_callsign:[3,1,1,""],is_invalid_operation:[3,1,1,""]}},titleterms:{help:1,anoth:[],licens:2,clase:0,indic:0,content:[],header:[],contact:2,tabl:0,pyhamtool:0,document:[],simpl:[],modul:0,lookuplib:3,welcom:[]}})
|
||||
Search.setIndex({envversion:42,terms:{all:[3,2],code:[0,3],identifi:3,show:3,illustr:[],text:[],clublog:3,obtain:[3,2],myapikei:3,prefix:3,radio:[0,3],same:3,permiss:2,follow:[0,3,2],data:3,bsd:0,entiti:3,xml:3,current:0,clublogxml:3,depend:3,copyright:2,how:3,holder:2,explain:[],tobia:2,except:3,should:[],tort:2,valid:3,dict:3,ituz:3,queri:3,tzinfo:3,aris:2,logger:3,therefor:3,match:3,merchant:2,applic:0,lookup_ent:3,sourc:3,"return":3,string:3,variou:3,utc:3,python:[0,3],timestamp:3,express:2,kind:2,softwar:2,whether:2,condit:2,veri:[],liabl:2,month:3,charg:2,requir:3,infrequ:3,warranti:2,like:0,specif:3,bla:[],"try":3,provid:[3,2],stuff:[],necessari:0,contain:[0,3],found:3,readthedoc:0,page:0,impli:2,right:2,deal:2,replac:3,some:0,see:0,callsign:[0,3],connect:[3,2],arg:3,download:3,http:[0,3],event:2,librari:[0,3],out:2,even:3,index:0,lookuptyp:3,turkmenistan:3,lookup_prefix:3,databas:3,rep:3,publish:2,lookup_zone_except:3,content:[],delet:3,written:[],version:0,inject:3,action:2,internet:3,print:3,"import":3,irc:0,complic:[],method:3,abov:2,kei:3,differ:3,free:2,dictionari:3,locat:3,come:0,lookup_callsign:3,valu:3,log:3,search:0,fit:2,island:3,cty:3,against:3,datetim:3,person:2,doctest:[],permit:2,fals:3,countri:3,typic:3,dh1tw:[0,1,2],com:[0,3],assign:3,frequent:0,oper:3,apikeymissingerror:3,directli:3,merg:2,modul:[],two:3,restrict:2,filenam:3,api:3,org:[0,3],noresult:[],bool:3,miss:3,damag:2,liabil:2,given:3,from:[3,2],christma:3,wai:[],whom:2,modifi:2,three:3,wrapper:3,avail:3,cqz:3,station:3,interfac:3,includ:2,paramet:3,type:3,more:3,"function":[],amateur:[0,3],option:3,copi:2,keyerror:3,notic:2,is_invalid_oper:3,pytz:3,pars:0,callinfo:3,particular:2,known:3,getter:[],herebi:2,"true":3,countryfil:3,none:3,sell:2,"default":3,access:[],structur:[],exampl:3,aim:3,record:3,contin:3,limit:2,can:3,str:3,webirc:0,otherwis:2,purpos:2,latitud:3,claim:2,substanti:2,creat:0,"int":3,clublogapi:3,year:3,my_lookuplib:3,ani:2,dp0gvn:3,antarctica:3,inform:3,exist:3,contract:2,file:[0,3,2],onlin:3,seem:3,deltaxrai:0,plist:3,incorrect:3,issu:0,mylookuplib:3,author:2,perform:3,apikei:3,detail:3,invalid:3,check:3,note:[],also:3,other:2,lookup:3,which:[0,3],you:0,subject:2,mit:2,lookuplib:[],updat:3,furnish:2,example_gener:[],"5w1cfn":3,germani:3,distribut:2,shall:2,fed:3,dai:3,befor:3,zone:3,rais:3,adif:3,sublicens:2,date:3,associ:2,"class":[0,3],longitud:3,homogen:3,noninfring:2,github:0,faster:0,"__name__":3,grant:2,descript:[],wellnitz:2,without:2,vk9xo:3,hamtest:0,portion:2,contact:[],getlogg:3,thi:[3,2],time:3,format:[],hello:[],daili:3},objtypes:{"0":"py:module","1":"py:method","2":"py:class"},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","class","Python class"]},filenames:["index","help","license","LookupLib"],titles:["PyHamTools","help","license","LookupLib"],objects:{pyhamtools:{lookuplib:[3,0,0,"-"]},"pyhamtools.lookuplib":{LookupLib:[3,2,1,""]},"pyhamtools.lookuplib.LookupLib":{lookup_prefix:[3,1,1,""],lookup_entity:[3,1,1,""],lookup_zone_exception:[3,1,1,""],lookup_callsign:[3,1,1,""],is_invalid_operation:[3,1,1,""]}},titleterms:{help:1,anoth:[],licens:2,clase:0,indic:0,content:[],header:[],contact:2,tabl:0,pyhamtool:0,document:[],simpl:[],modul:0,lookuplib:3,welcom:[]}})
|
||||
|
|
@ -1,10 +1,27 @@
|
|||
license
|
||||
=======
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
bla bla bla
|
||||
Copyright (c) 2014 Tobias Wellnitz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Contact:
|
||||
========
|
||||
Contact DH1TW
|
||||
Contact Tobias@dh1tw.de
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue