mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2025-12-06 06:52:00 +01:00
450 lines
24 KiB
HTML
450 lines
24 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>Callinfo — pyhamtools 0.4.1 documentation</title>
|
|
|
|
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: './',
|
|
VERSION: '0.4.1',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<link rel="top" title="pyhamtools 0.4.1 documentation" href="index.html" />
|
|
</head>
|
|
<body>
|
|
<div class="related">
|
|
<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><a href="index.html">pyhamtools 0.4.1 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="callinfo">
|
|
<h1>Callinfo<a class="headerlink" href="#callinfo" title="Permalink to this headline">¶</a></h1>
|
|
<div class="toctree-wrapper compound">
|
|
<ul class="simple">
|
|
</ul>
|
|
</div>
|
|
<span class="target" id="module-pyhamtools.callinfo"></span><dl class="class">
|
|
<dt id="pyhamtools.callinfo.Callinfo">
|
|
<em class="property">class </em><tt class="descclassname">pyhamtools.callinfo.</tt><tt class="descname">Callinfo</tt><big>(</big><em>lookuplib</em>, <em>logger=None</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>The purpose of this class is to return data (country, latitude, longitude, CQ Zone...etc) for an
|
|
Amateur Radio callsign. The class can be used with any lookup database,
|
|
provided through an Instance of <tt class="xref py py-class docutils literal"><span class="pre">LookupLib</span></tt>.
|
|
An instance of <tt class="xref py py-class docutils literal"><span class="pre">Lookuplib</span></tt> has to be injected on object construction.</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
|
<li><strong>lookuplib</strong> (<tt class="xref py py-class docutils literal"><span class="pre">LookupLib</span></tt>) – instance of <tt class="xref py py-class docutils literal"><span class="pre">LookupLib</span></tt></li>
|
|
<li><strong>logger</strong> (<em>logging.getLogger(__name__), optional</em>) – Python logger</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_adif_id">
|
|
<tt class="descname">get_adif_id</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_adif_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns ADIF id of a callsign’s country</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">containing the country ADIF id</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">int</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
No Country found for callsign</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_all">
|
|
<tt class="descname">get_all</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_all" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Lookup a callsign and return all data available from the underlying database</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Dictionary containing the callsign specific data</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">dict</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
Callsign could not be identified</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p class="rubric">Example</p>
|
|
<p>The following code returns all available information from the country-files.com database for the
|
|
callsign “DH1TW”</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="p">,</span> <span class="n">Callinfo</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">"countryfile"</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span> <span class="o">=</span> <span class="n">Callinfo</span><span class="p">(</span><span class="n">my_lookuplib</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span><span class="o">.</span><span class="n">get_all</span><span class="p">(</span><span class="s">"DH1TW"</span><span class="p">)</span>
|
|
<span class="go">{</span>
|
|
<span class="go"> 'country': 'Fed. Rep. of Germany',</span>
|
|
<span class="go"> 'adif': 230,</span>
|
|
<span class="go"> 'continent': 'EU',</span>
|
|
<span class="go"> 'latitude': 51.0,</span>
|
|
<span class="go"> 'longitude': -10.0,</span>
|
|
<span class="go"> 'cqz': 14,</span>
|
|
<span class="go"> 'ituz': 28</span>
|
|
<span class="go">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">The content of the returned data depends entirely on the injected
|
|
<tt class="xref py py-class docutils literal"><span class="pre">LookupLib</span></tt> (and the used database). While the country-files.com provides
|
|
for example the ITU Zone, Clublog doesn’t. Consequently, the item “ituz”
|
|
would be missing with Clublog (API or XML) <tt class="xref py py-class docutils literal"><span class="pre">LookupLib</span></tt>.</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_continent">
|
|
<tt class="descname">get_continent</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_continent" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns the continent Identifier of a callsign</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">continent identified</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">str</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
No Continent found for callsign</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p>The following continent identifiers are used:</p>
|
|
<ul class="last simple">
|
|
<li>EU: Europe</li>
|
|
<li>NA: North America</li>
|
|
<li>SA: South America</li>
|
|
<li>AS: Asia</li>
|
|
<li>AF: Africa</li>
|
|
<li>OC: Oceania</li>
|
|
<li>AN: Antarctica</li>
|
|
</ul>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_country_name">
|
|
<tt class="descname">get_country_name</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_country_name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns the country name where the callsign is located</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">name of the Country</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">str</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
No Country found for callsign</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p>Don’t rely on the country name when working with several instances of
|
|
py:class:<cite>Callinfo</cite>. Clublog and Country-files.org use slightly different names
|
|
for countries. Example:</p>
|
|
<ul class="last simple">
|
|
<li>Country-files.com: “Fed. Rep. of Germany”</li>
|
|
<li>Clublog: “FEDERAL REPUBLIC OF GERMANY”</li>
|
|
</ul>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_cqz">
|
|
<tt class="descname">get_cqz</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_cqz" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns CQ Zone of a callsign</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">containing the callsign’s CQ Zone</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">int</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
no CQ Zone found for callsign</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="staticmethod">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_homecall">
|
|
<em class="property">static </em><tt class="descname">get_homecall</tt><big>(</big><em>callsign</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_homecall" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Strips off country prefixes (HC2/DH1TW) and activity suffixes (DH1TW/P).</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">callsign without country/activity pre/suffixes</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</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">ValueError</span></tt> –
|
|
No callsign found in string</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p class="rubric">Example</p>
|
|
<p>The following code retrieves the home call for “HC2/DH1TW/P”</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="p">,</span> <span class="n">Callinfo</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">"countryfile"</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span> <span class="o">=</span> <span class="n">Callinfo</span><span class="p">(</span><span class="n">my_lookuplib</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span><span class="o">.</span><span class="n">get_homecall</span><span class="p">(</span><span class="s">"HC2/DH1TW/P"</span><span class="p">)</span>
|
|
<span class="go">DH1TW</span>
|
|
</pre></div>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_ituz">
|
|
<tt class="descname">get_ituz</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_ituz" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns ITU Zone of a callsign</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">containing the callsign’s CQ Zone</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">int</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
No ITU Zone found for callsign</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">Currently, only Country-files.com lookup database contains ITU Zones</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.get_lat_long">
|
|
<tt class="descname">get_lat_long</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.get_lat_long" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns Latitude and Longitude for a callsign</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Containing Latitude and Longitude</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">dict</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">KeyError</span></tt> –
|
|
No data found for callsign</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p class="rubric">Example</p>
|
|
<p>The following code returns Latitude & Longitude for “DH1TW”</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="p">,</span> <span class="n">Callinfo</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">"countryfile"</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span> <span class="o">=</span> <span class="n">Callinfo</span><span class="p">(</span><span class="n">my_lookuplib</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span><span class="o">.</span><span class="n">get_lat_long</span><span class="p">(</span><span class="s">"DH1TW"</span><span class="p">)</span>
|
|
<span class="go">{</span>
|
|
<span class="go"> 'latitude': 51.0,</span>
|
|
<span class="go"> 'longitude': -10.0</span>
|
|
<span class="go">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">Unfortunately, in most cases the returned Latitude and Longitude are not very precise.
|
|
Clublog and Country-files.com use the country’s capital coordinates in most cases, if no
|
|
dedicated entry in the database exists.</p>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="pyhamtools.callinfo.Callinfo.is_valid_callsign">
|
|
<tt class="descname">is_valid_callsign</tt><big>(</big><em>callsign</em>, <em>timestamp=datetime.datetime(2014</em>, <em>9</em>, <em>26</em>, <em>23</em>, <em>10</em>, <em>28</em>, <em>995737</em>, <em>tzinfo=<UTC>)</em><big>)</big><a class="headerlink" href="#pyhamtools.callinfo.Callinfo.is_valid_callsign" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Checks if a callsign is valid</p>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
|
<li><strong>callsign</strong> (<em>str</em>) – Amateur Radio callsign</li>
|
|
<li><strong>timestamp</strong> (<em>datetime, optional</em>) – datetime in UTC (tzinfo=pytz.UTC)</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">True / False</p>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p class="rubric">Example</p>
|
|
<p>The following checks if “DH1TW” is a valid callsign</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="p">,</span> <span class="n">Callinfo</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">"countryfile"</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span> <span class="o">=</span> <span class="n">Callinfo</span><span class="p">(</span><span class="n">my_lookuplib</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">cic</span><span class="o">.</span><span class="n">is_valid_callsign</span><span class="p">(</span><span class="s">"DH1TW"</span><span class="p">)</span>
|
|
<span class="go">True</span>
|
|
</pre></div>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/callinfo.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related">
|
|
<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><a href="index.html">pyhamtools 0.4.1 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2014, Tobias Wellnitz, DH1TW.
|
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
|
|
</div>
|
|
</body>
|
|
</html> |