2014-04-24 14:01:53 +02:00
< !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 > LookupLib — pyhamtools 0.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.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.1 documentation" href = "index.html" / >
< link rel = "prev" title = "PyHamTools" 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 class = "right" >
< a href = "index.html" title = "PyHamTools"
accesskey="P">previous< / a > |< / li >
< li > < a href = "index.html" > pyhamtools 0.1 documentation< / a > » < / li >
< / ul >
< / div >
< div class = "document" >
< div class = "documentwrapper" >
< div class = "bodywrapper" >
< div class = "body" >
< div class = "section" id = "lookuplib" >
< h1 > LookupLib< a class = "headerlink" href = "#lookuplib" title = "Permalink to this headline" > ¶< / a > < / h1 >
< div class = "toctree-wrapper compound" >
< ul class = "simple" >
< / ul >
< / 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 >
< 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 > 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" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2014-04-24 17:05:24 +02:00
< tr class = "field-odd field" > < th class = "field-name" > Parameters:< / th > < td class = "field-body" > < ul class = "first last simple" >
< li > < strong > lookuptype< / strong > (< em > str< / em > ) – “ clublogxml” or “ clublogapi” or “ countryfile” < / li >
< li > < strong > apikey< / strong > (< em > str< / em > ) – Clublog API Key< / li >
< li > < strong > filename< / strong > (< em > str, optional< / em > ) – Filename for Clublog XML or Country-files.com cty.plist file< / li >
< li > < strong > logger< / strong > (< em > logging.getLogger(__name__), optional< / em > ) – Python logger< / li >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
< / tbody >
< / table >
< dl class = "method" >
< dt id = "pyhamtools.lookuplib.LookupLib.is_invalid_operation" >
2014-04-24 17:05:24 +02:00
< 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=< UTC> )< / em > < big > )< / big > < a class = "headerlink" href = "#pyhamtools.lookuplib.LookupLib.is_invalid_operation" title = "Permalink to this definition" > ¶< / a > < / dt >
2014-04-24 14:01:53 +02:00
< 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" / >
< col class = "field-body" / >
< tbody valign = "top" >
2014-04-24 17:05:24 +02:00
< 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 > ) – Amateur Radio callsign< / li >
< li > < strong > timestamp< / strong > (< em > datetime, optional< / em > ) – datetime in UTC (tzinfo=pytz.UTC)< / li >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< tr class = "field-even field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > < p class = "first" > True if a record exists for this callsign (at the given time)< / p >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< tr class = "field-odd field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > < p class = "first" > bool< / 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 > –
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 >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
< / tbody >
< / table >
< p class = "rubric" > Notes< / p >
< p > This method is available for:< / p >
< ul class = "simple" >
< li > clublogxml< / li >
< / ul >
< / dd > < / dl >
< dl class = "method" >
< dt id = "pyhamtools.lookuplib.LookupLib.lookup_callsign" >
2014-04-24 17:05:24 +02:00
< 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=< UTC> )< / em > < big > )< / big > < a class = "headerlink" href = "#pyhamtools.lookuplib.LookupLib.lookup_callsign" title = "Permalink to this definition" > ¶< / a > < / dt >
2014-04-24 14:01:53 +02:00
< 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" / >
< col class = "field-body" / >
< tbody valign = "top" >
2014-04-24 17:05:24 +02:00
< 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 > ) – Amateur radio callsign< / li >
< li > < strong > timestamp< / strong > (< em > datetime, optional< / em > ) – datetime in UTC (tzinfo=pytz.UTC)< / li >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< tr class = "field-even field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > < p class = "first" > Dictionary containing the country specific data of the callsign< / p >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< 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" > < ul class = "first last simple" >
< li > < tt class = "xref py py-exc docutils literal" > < span class = "pre" > NoResult< / 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 >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
< / tbody >
< / table >
< p class = "rubric" > Notes< / p >
< p > This method is available for:< / p >
< ul class = "simple" >
< li > clublogxml< / li >
< li > clublogapi< / li >
< li > countryfile< / li >
< / ul >
< / dd > < / dl >
< dl class = "method" >
< dt id = "pyhamtools.lookuplib.LookupLib.lookup_entity" >
< tt class = "descname" > lookup_entity< / tt > < big > (< / big > < em > entity=None< / em > < big > )< / big > < a class = "headerlink" href = "#pyhamtools.lookuplib.LookupLib.lookup_entity" title = "Permalink to this definition" > ¶< / a > < / dt >
< dd > < p > Returns lookup data of a ADIF Entity< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2014-04-24 17:05:24 +02:00
< tr class = "field-odd field" > < th class = "field-name" > Parameters:< / th > < td class = "field-body" > < strong > entity< / strong > (< em > int< / em > ) – ADIF identifier of country< / td >
2014-04-24 14:01:53 +02:00
< / tr >
2014-04-24 17:05:24 +02:00
< tr class = "field-even field" > < th class = "field-name" > Returns:< / th > < td class = "field-body" > Dictionary containing the country specific data< / td >
2014-04-24 14:01:53 +02:00
< / tr >
2014-04-24 17:05:24 +02:00
< 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 > –
No matching entity found< / td >
2014-04-24 14:01:53 +02:00
< / tr >
< / tbody >
< / table >
2014-04-24 17:05:24 +02:00
< 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" >
2014-04-24 14:01:53 +02:00
< li > clublogxml< / li >
< / ul >
2014-04-24 17:05:24 +02:00
< / dd >
< / dl >
< / div >
2014-04-24 14:01:53 +02:00
< / dd > < / dl >
< dl class = "method" >
< dt id = "pyhamtools.lookuplib.LookupLib.lookup_prefix" >
2014-04-24 17:05:24 +02:00
< 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=< UTC> )< / em > < big > )< / big > < a class = "headerlink" href = "#pyhamtools.lookuplib.LookupLib.lookup_prefix" title = "Permalink to this definition" > ¶< / a > < / dt >
2014-04-24 14:01:53 +02:00
< dd > < p > Returns lookup data of a Prefix< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2014-04-24 17:05:24 +02:00
< tr class = "field-odd field" > < th class = "field-name" > Parameters:< / th > < td class = "field-body" > < ul class = "first simple" >
< li > < strong > prefix< / strong > (< em > string< / em > ) – Prefix of a 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 country specific data of the Prefix< / p >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< tr class = "field-odd field" > < th class = "field-name" > Return type:< / th > < td class = "field-body" > < p class = "first" > dict< / p >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< 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 > –
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 >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
< / tbody >
< / table >
< p class = "rubric" > Notes< / p >
< p > This method is available for:< / p >
< ul class = "simple" >
< li > clublogxml< / li >
< li > countryfile< / li >
< / ul >
< / dd > < / dl >
< dl class = "method" >
< dt id = "pyhamtools.lookuplib.LookupLib.lookup_zone_exception" >
2014-04-24 17:05:24 +02:00
< 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=< UTC> )< / em > < big > )< / big > < a class = "headerlink" href = "#pyhamtools.lookuplib.LookupLib.lookup_zone_exception" title = "Permalink to this definition" > ¶< / a > < / dt >
2014-04-24 14:01:53 +02:00
< dd > < p > Returns a CQ Zone if an exception exists for the given callsign< / p >
< table class = "docutils field-list" frame = "void" rules = "none" >
< col class = "field-name" / >
< col class = "field-body" / >
< tbody valign = "top" >
2014-04-24 17:05:24 +02:00
< 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 > ) – Amateur radio callsign< / li >
< li > < strong > timestamp< / strong > (< em > datetime, optional< / em > ) – datetime in UTC (tzinfo=pytz.UTC)< / li >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< 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 >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
2014-04-24 17:05:24 +02:00
< 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 > –
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 >
< / ul >
2014-04-24 14:01:53 +02:00
< / td >
< / tr >
< / tbody >
< / table >
< p class = "rubric" > Notes< / p >
< p > This method is available for:< / p >
< ul class = "simple" >
< li > clublogxml< / li >
< / ul >
< / dd > < / dl >
< / dd > < / dl >
< / div >
< / div >
< / div >
< / div >
< div class = "sphinxsidebar" >
< div class = "sphinxsidebarwrapper" >
< h4 > Previous topic< / h4 >
< p class = "topless" > < a href = "index.html"
title="previous chapter">PyHamTools< / a > < / p >
< h3 > This Page< / h3 >
< ul class = "this-page-menu" >
< li > < a href = "_sources/LookupLib.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 class = "right" >
< a href = "index.html" title = "PyHamTools"
>previous< / a > |< / li >
< li > < a href = "index.html" > pyhamtools 0.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.2.
< / div >
< / body >
< / html >