changed docstrings

This commit is contained in:
dh1tw 2014-04-24 17:46:46 +02:00
parent 366d5dc391
commit 644306bea0
6 changed files with 99 additions and 147 deletions

View file

@ -1,4 +1,6 @@
pyhamtools
==========
A Library with Amateur Radio specific Functions and Methods
A Library with Amateur Radio specific Functions and Classes.
The library is currently in Alpha state. Please do not use this library for operational code.

Binary file not shown.

Binary file not shown.

View file

@ -84,7 +84,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>3</em>, <em>44</em>, <em>979191</em>, <em>tzinfo=&lt;UTC&gt;)</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>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956076</em>, <em>tzinfo=&lt;UTC&gt;)</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,25 +103,27 @@ 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> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> &#8211;
No matching callsign found</li>
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
API Key for Clublog missing or incorrect</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>This method is available for:</p>
<ul class="simple">
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>This method is available for</p>
<ul class="last simple">
<li>clublogxml</li>
</ul>
</div>
</dd></dl>
<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>3</em>, <em>44</em>, <em>979170</em>, <em>tzinfo=&lt;UTC&gt;)</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>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956058</em>, <em>tzinfo=&lt;UTC&gt;)</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" />
@ -140,22 +142,24 @@ 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> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> &#8211;
No matching callsign found</li>
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
API Key for Clublog missing or incorrect</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>This method is available for:</p>
<ul class="simple">
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>This method is available for</p>
<ul class="last simple">
<li>clublogxml</li>
<li>clublogapi</li>
<li>countryfile</li>
</ul>
</div>
</dd></dl>
<dl class="method">
@ -179,19 +183,16 @@ No matching entity found</td>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<dl class="last docutils">
<dt>This method is available for:</dt>
<dd><ul class="first last simple">
<p>This method is available for the following lookup type</p>
<ul class="last simple">
<li>clublogxml</li>
</ul>
</dd>
</dl>
</div>
</dd></dl>
<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>3</em>, <em>44</em>, <em>979170</em>, <em>tzinfo=&lt;UTC&gt;)</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>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956058</em>, <em>tzinfo=&lt;UTC&gt;)</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" />
@ -210,58 +211,59 @@ 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> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> &#8211;
No matching Prefix found</li>
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
API Key for Clublog missing or incorrect</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>This method is available for:</p>
<ul class="simple">
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>This method is available for</p>
<ul class="last simple">
<li>clublogxml</li>
<li>countryfile</li>
</ul>
</div>
</dd></dl>
<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>3</em>, <em>44</em>, <em>979197</em>, <em>tzinfo=&lt;UTC&gt;)</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>24</em>, <em>15</em>, <em>46</em>, <em>11</em>, <em>956082</em>, <em>tzinfo=&lt;UTC&gt;)</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
timestamp (datetime, optional): datetime in UTC (tzinfo=pytz.UTC)</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>string</em>) &#8211; Amateur radio callsign</li>
<li><strong>timestamp</strong> (<em>datetime, optional</em>) &#8211; datetime in UTC (tzinfo=pytz.UTC)</li>
</ul>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Value of the the CQ Zone exception which exists for this callsign (at the given time)</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Value of the the CQ Zone exception which exists for this callsign (at the given time)</p>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">int</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"><ul class="first last simple">
<li><tt class="xref py py-exc docutils literal"><span class="pre">NoResult</span></tt> &#8211;
<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> &#8211;
No matching callsign found</li>
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
<li><tt class="xref py py-exc docutils literal"><span class="pre">APIKeyMissingError</span></tt> &#8211;
API Key for Clublog missing or incorrect</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>This method is available for:</p>
<ul class="simple">
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>This method is available for</p>
<ul class="last simple">
<li>clublogxml</li>
</ul>
</div>
</dd></dl>
</dd></dl>

View file

@ -1 +1 @@
Search.setIndex({envversion:42,terms:{all:3,code:0,identifi:3,text:[],prefix:3,radio:[0,3],same:3,follow:0,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,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:3,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,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:[]}})

View file

@ -37,20 +37,11 @@ class LookupLib(object):
By default, LookupLib requires an Internet connection to download the libraries or perform the
lookup against the Clublog API.
Parameters
----------
lookuptype : str
"clublogxml" or "clublogapi" or "countryfile"
apikey : str
Clublog API Key
filename : str, optional
Filename for Clublog XML or Country-files.com cty.plist file
logger : logging.getLogger(__name__), optional
Python logger
Args:
lookuptype (str) : "clublogxml" or "clublogapi" or "countryfile"
apikey (str): Clublog API Key
filename (str, optional): Filename for Clublog XML or Country-files.com cty.plist file
logger (logging.getLogger(__name__), optional): Python logger
"""
def __init__(self, lookuptype = "clublogxml", apikey=None, filename=None, logger=None):
@ -103,8 +94,9 @@ class LookupLib(object):
NoResult: No matching entity found
Note:
This method is available for:
- clublogxml
This method is available for the following lookup type
- clublogxml
"""
@ -125,34 +117,23 @@ class LookupLib(object):
"""
Returns lookup data if an exception exists for a callsign
Parameters
----------
callsign : string
Amateur radio callsign
Args:
callsign (string): Amateur radio callsign
timestamp (datetime, optional): datetime in UTC (tzinfo=pytz.UTC)
timestamp : datetime, optional
datetime in UTC (tzinfo=pytz.UTC)
Returns:
dict: Dictionary containing the country specific data of the callsign
Returns
-------
dict
Dictionary containing the country specific data of the callsign
Raises:
NoResult: No matching callsign found
APIKeyMissingError: API Key for Clublog missing or incorrect
Raises
------
NoResult
No matching callsign found
Note:
This method is available for
APIKeyMissingError
API Key for Clublog missing or incorrect
Notes
-----
This method is available for:
- clublogxml
- clublogapi
- countryfile
- clublogxml
- clublogapi
- countryfile
"""
callsign = callsign.strip().upper()
@ -195,33 +176,22 @@ class LookupLib(object):
"""
Returns lookup data of a Prefix
Parameters
----------
prefix : string
Prefix of a Amateur Radio callsign
Args:
prefix (string): Prefix of a Amateur Radio callsign
timestamp (datetime, optional): datetime in UTC (tzinfo=pytz.UTC)
timestamp : datetime, optional
datetime in UTC (tzinfo=pytz.UTC)
Returns:
dict: Dictionary containing the country specific data of the Prefix
Returns
-------
dict
Dictionary containing the country specific data of the Prefix
Raises:
NoResult: No matching Prefix found
APIKeyMissingError: API Key for Clublog missing or incorrect
Raises
------
NoResult
No matching Prefix found
Note:
This method is available for
APIKeyMissingError
API Key for Clublog missing or incorrect
Notes
-----
This method is available for:
- clublogxml
- countryfile
- clublogxml
- countryfile
"""
@ -257,32 +227,21 @@ class LookupLib(object):
"""
Returns True if an operations is known as invalid
Parameters
----------
callsign : string
Amateur Radio callsign
Args:
callsign (string): Amateur Radio callsign
timestamp (datetime, optional): datetime in UTC (tzinfo=pytz.UTC)
timestamp : datetime, optional
datetime in UTC (tzinfo=pytz.UTC)
Returns:
bool: True if a record exists for this callsign (at the given time)
Returns
-------
bool
True if a record exists for this callsign (at the given time)
Raises:
NoResult: No matching callsign found
APIKeyMissingError: API Key for Clublog missing or incorrect
Raises
------
NoResult
No matching callsign found
Note:
This method is available for
APIKeyMissingError
API Key for Clublog missing or incorrect
Notes
-----
This method is available for:
- clublogxml
- clublogxml
"""
@ -323,32 +282,21 @@ class LookupLib(object):
"""
Returns a CQ Zone if an exception exists for the given callsign
Parameters
----------
callsign : string
Amateur radio callsign
Args:
callsign (string): Amateur radio callsign
timestamp (datetime, optional): datetime in UTC (tzinfo=pytz.UTC)
timestamp : datetime, optional
datetime in UTC (tzinfo=pytz.UTC)
Returns:
int: Value of the the CQ Zone exception which exists for this callsign (at the given time)
Returns
-------
int
Value of the the CQ Zone exception which exists for this callsign (at the given time)
Raises:
NoResult: No matching callsign found
APIKeyMissingError: API Key for Clublog missing or incorrect
Raises
------
NoResult
No matching callsign found
Note:
This method is available for
APIKeyMissingError
API Key for Clublog missing or incorrect
Notes
-----
This method is available for:
- clublogxml
- clublogxml
"""