diff --git a/docs/build/doctrees/Callinfo.doctree b/docs/build/doctrees/Callinfo.doctree new file mode 100644 index 0000000..13b3186 Binary files /dev/null and b/docs/build/doctrees/Callinfo.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 37dca23..516b185 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index 4a983f5..e538b6e 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/docs/build/doctrees/lookuplib.doctree b/docs/build/doctrees/lookuplib.doctree index 93713fe..c788d02 100644 Binary files a/docs/build/doctrees/lookuplib.doctree and b/docs/build/doctrees/lookuplib.doctree differ diff --git a/docs/build/html/Callinfo.html b/docs/build/html/Callinfo.html new file mode 100644 index 0000000..43e6330 --- /dev/null +++ b/docs/build/html/Callinfo.html @@ -0,0 +1,132 @@ + + + + + + + + Callinfo — pyhamtools 0.1 documentation + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Callinfo

+
+
    +
+
+
+
+class pyhamtools.callinfo.Callinfo(lookuplib)
+

This is going to going to return information for a callsign

+
+
+getHomeCall(callsign)
+

verify call and strip off any /ea1 vp5/ /qrp etc

+
+ +
+ +
+ + +
+
+
+
+
+

Previous topic

+

PyHamTools

+

Next topic

+

LookupLib

+

This Page

+ + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/build/html/_sources/Callinfo.txt b/docs/build/html/_sources/Callinfo.txt new file mode 100644 index 0000000..68f7758 --- /dev/null +++ b/docs/build/html/_sources/Callinfo.txt @@ -0,0 +1,10 @@ +Callinfo +======== + +.. toctree:: + :maxdepth: 2 + +.. automodule:: pyhamtools.callinfo + +.. autoclass:: Callinfo + :members: \ No newline at end of file diff --git a/docs/build/html/_sources/index.txt b/docs/build/html/_sources/index.txt index af9d1fe..3690c4f 100644 --- a/docs/build/html/_sources/index.txt +++ b/docs/build/html/_sources/index.txt @@ -6,7 +6,7 @@ :Version: |release| :Code: https://github.com/dh1tw/pyhamtools -:License: BSD; see LICENSE file +:License: MIT; see LICENSE file :Issues: https://github.com/dh1tw/pyhamtools/issues :Documentation: http://pyhamtools.readthedocs.org/ :IRC: #hamtests on webirc.deltaxray.org @@ -26,6 +26,7 @@ Clases: .. toctree:: :maxdepth: 2 + Callinfo LookupLib diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index a6aa760..c353f6e 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -49,11 +49,33 @@

Index

- I + C + | G + | I | L | P
+

C

+ + +
+ +
Callinfo (class in pyhamtools.callinfo) +
+ +
+ +

G

+ + +
+ +
getHomeCall() (pyhamtools.callinfo.Callinfo method) +
+ +
+

I

@@ -96,6 +118,12 @@ + - + @@ -78,6 +78,9 @@ with some modules and classes which are frequently necessary, like parsing of an

Clases:

    +
  • Callinfo
      +
    +
  • LookupLib
  • @@ -113,8 +116,8 @@ with some modules and classes which are frequently necessary, like parsing of an

Next topic

-

LookupLib

+

Callinfo

This Page

diff --git a/docs/build/html/lookuplib.html b/docs/build/html/lookuplib.html index 61abe05..8bf869a 100644 --- a/docs/build/html/lookuplib.html +++ b/docs/build/html/lookuplib.html @@ -24,7 +24,7 @@ - +
@@ -85,7 +85,7 @@ lookup against the Clublog API.

+
pyhamtools.callinfo (module) +
+ +
+
pyhamtools.lookuplib (module)
diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 6ac3f6f..0bfdbd4 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -24,7 +24,7 @@ - +
Code:https://github.com/dh1tw/pyhamtools
License:BSD; see LICENSE file
License:MIT; see LICENSE file
Issues:https://github.com/dh1tw/pyhamtools/issues
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
  • +
  • filename (str, optional) – Filename for Clublog XML or Country-files.com cty.plist file. When a local file is used, no Internet connection not API Key is necessary.
  • logger (logging.getLogger(__name__), optional) – Python logger
-is_invalid_operation(callsign, timestamp=datetime.datetime(2014, 4, 25, 21, 44, 34, 169942, tzinfo=<UTC>))
+is_invalid_operation(callsign, timestamp=datetime.datetime(2014, 4, 25, 22, 19, 33, 219680, tzinfo=<UTC>))

Returns True if an operations is known as invalid

@@ -140,7 +140,7 @@ API Key for Clublog missing or incorrect
-lookup_callsign(callsign=None, timestamp=datetime.datetime(2014, 4, 25, 21, 44, 34, 169924, tzinfo=<UTC>))
+lookup_callsign(callsign=None, timestamp=datetime.datetime(2014, 4, 25, 22, 19, 33, 219601, tzinfo=<UTC>))

Returns lookup data if an exception exists for a callsign

@@ -200,7 +200,7 @@ API Key for Clublog missing or incorrect
lookup_entity(entity=None)
-

Returns lookup data of a ADIF Entity

+

Returns lookup data of an ADIF Entity

@@ -244,7 +244,7 @@ the id 273.

-lookup_prefix(prefix, timestamp=datetime.datetime(2014, 4, 25, 21, 44, 34, 169924, tzinfo=<UTC>))
+lookup_prefix(prefix, timestamp=datetime.datetime(2014, 4, 25, 22, 19, 33, 219601, tzinfo=<UTC>))

Returns lookup data of a Prefix

@@ -301,7 +301,7 @@ database (default database).

-lookup_zone_exception(callsign, timestamp=datetime.datetime(2014, 4, 25, 21, 44, 34, 169948, tzinfo=<UTC>))
+lookup_zone_exception(callsign, timestamp=datetime.datetime(2014, 4, 25, 22, 19, 33, 219687, tzinfo=<UTC>))

Returns a CQ Zone if an exception exists for the given callsign

Args: callsign (string): Amateur radio callsign @@ -356,8 +356,8 @@ in CQ Zone 38

Previous topic

-

PyHamTools

+

Callinfo

This Page

diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 048b7e7..122f8d0 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/py-modindex.html b/docs/build/html/py-modindex.html index 1c9b3de..49cbf51 100644 --- a/docs/build/html/py-modindex.html +++ b/docs/build/html/py-modindex.html @@ -64,6 +64,11 @@
+ + +
pyhamtools
    + pyhamtools.callinfo +
    diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index d96d428..53333c6 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -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:[]}}) \ No newline at end of file +Search.setIndex({envversion:42,terms:{oper:4,all:[4,3],code:[0,4],identifi:4,show:4,illustr:[],text:[],obtain:[4,3],myapikei:4,prefix:4,radio:[0,4],invalid:4,permiss:3,follow:[0,4,3],lookup:4,apikeymissingerror:4,entiti:4,xml:4,content:[],clublogxml:4,depend:4,copyright:3,also:4,"true":4,explain:[],tobia:3,except:4,should:[],tort:3,other:3,dict:4,ituz:4,queri:4,tzinfo:4,aris:3,logger:4,therefor:4,local:4,match:4,merchant:3,applic:0,lookup_ent:4,sourc:4,"return":[1,4],string:4,variou:4,countryfil:4,python:[0,4],timestamp:4,express:3,dai:4,"import":4,veri:[],liabl:3,month:4,associ:3,requir:4,warranti:3,like:0,specif:4,complic:[],"try":4,provid:[4,3],stuff:[],necessari:[0,4],contain:[0,4],found:4,readthedoc:0,page:0,impli:3,right:3,deal:3,example_gener:[],replac:4,some:0,see:0,callsign:[0,1,4],connect:[4,3],arg:4,download:4,germani:4,event:3,librari:[0,4],out:3,even:4,index:0,lookuptyp:4,turkmenistan:4,lookup_prefix:4,databas:4,rep:4,publish:3,lookup_zone_except:4,current:0,delet:4,written:[],version:0,inject:4,action:3,internet:4,print:4,condit:3,irc:0,bla:[],method:4,str:4,kei:4,longitud:4,given:4,free:3,dictionari:4,locat:4,come:0,lookup_callsign:4,valu:4,christma:4,search:0,fit:3,island:4,cty:4,against:4,datetim:4,instanc:4,doctest:[],permit:3,fals:4,countri:4,typic:4,dh1tw:[0,2,3],com:[0,4],assign:4,frequent:0,"default":4,vp5:1,softwar:3,adif:4,directli:4,modul:[],damag:3,three:4,qrp:1,filenam:4,api:4,strip:1,ea1:1,noresult:[],miss:4,merg:3,liabil:3,differ:4,from:[4,3],log:4,wai:[],cqz:4,modifi:3,etc:1,contact:[],two:4,wrapper:4,github:0,avail:4,whom:3,station:4,interfac:4,includ:3,paramet:4,call:1,daili:4,type:4,more:4,"function":[],amateur:[0,4],option:4,copi:3,keyerror:4,notic:3,is_invalid_oper:4,pytz:4,pars:0,callinfo:[],particular:3,known:4,herebi:3,holder:3,utc:4,kind:3,whether:3,access:[],structur:[],exampl:4,aim:4,record:4,contin:4,limit:3,can:4,abov:3,webirc:0,otherwis:3,hamtest:0,purpos:3,latitud:4,claim:3,file:[0,4,3],creat:0,"int":4,descript:[],year:4,my_lookuplib:4,ani:[1,3],dp0gvn:4,antarctica:4,inform:[1,4],exist:4,contract:3,substanti:3,onlin:4,seem:4,deltaxrai:0,plist:4,sell:3,vk9xo:4,mylookuplib:4,date:4,author:3,perform:4,apikei:4,when:4,detail:4,same:4,check:4,note:[],how:4,valid:4,bool:4,which:[0,4],none:4,verifi:1,you:0,subject:3,mit:[0,3],lookuplib:[],updat:4,incorrect:4,"5w1cfn":4,http:[0,4],clublog:4,shall:3,org:[0,4],fed:4,restrict:3,befor:4,zone:4,rais:4,distribut:3,sublicens:3,bsd:[],data:4,"class":[0,1,4],charg:3,homogen:4,noninfring:3,infrequ:4,off:1,faster:0,"__name__":4,grant:3,clublogapi:4,wellnitz:3,without:3,issu:0,person:3,portion:3,getter:[],gethomecal:1,getlogg:4,thi:[1,4,3],time:4,format:[],hello:[],furnish: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","Callinfo","help","license","LookupLib"],titles:["PyHamTools","Callinfo","help","license","LookupLib"],objects:{pyhamtools:{callinfo:[1,0,0,"-"],lookuplib:[4,0,0,"-"]},"pyhamtools.callinfo.Callinfo":{getHomeCall:[1,1,1,""]},"pyhamtools.lookuplib":{LookupLib:[4,2,1,""]},"pyhamtools.lookuplib.LookupLib":{lookup_prefix:[4,1,1,""],lookup_entity:[4,1,1,""],lookup_zone_exception:[4,1,1,""],lookup_callsign:[4,1,1,""],is_invalid_operation:[4,1,1,""]},"pyhamtools.callinfo":{Callinfo:[1,2,1,""]}},titleterms:{help:2,anoth:[],licens:3,clase:0,simpl:[],indic:0,content:[],header:[],contact:3,tabl:0,pyhamtool:0,document:[],callinfo:1,modul:0,lookuplib:4,welcom:[]}}) \ No newline at end of file diff --git a/docs/source/Callinfo.rst b/docs/source/Callinfo.rst new file mode 100644 index 0000000..68f7758 --- /dev/null +++ b/docs/source/Callinfo.rst @@ -0,0 +1,10 @@ +Callinfo +======== + +.. toctree:: + :maxdepth: 2 + +.. automodule:: pyhamtools.callinfo + +.. autoclass:: Callinfo + :members: \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index af9d1fe..3690c4f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,7 +6,7 @@ :Version: |release| :Code: https://github.com/dh1tw/pyhamtools -:License: BSD; see LICENSE file +:License: MIT; see LICENSE file :Issues: https://github.com/dh1tw/pyhamtools/issues :Documentation: http://pyhamtools.readthedocs.org/ :IRC: #hamtests on webirc.deltaxray.org @@ -26,6 +26,7 @@ Clases: .. toctree:: :maxdepth: 2 + Callinfo LookupLib diff --git a/pyhamtools/callinfo.py b/pyhamtools/callinfo.py new file mode 100644 index 0000000..a3f7890 --- /dev/null +++ b/pyhamtools/callinfo.py @@ -0,0 +1,41 @@ + + + +class Callinfo(object): + """ + This is going to going to return information for a callsign + """ + + def __init__(self, lookuplib): + pass + + def getHomeCall(self, callsign): + """verify call and strip off any /ea1 vp5/ /qrp etc""" + raise NotImplementedError + + def isValidCall(self, callsign): + raise NotImplementedError + + def get_prefix(self, callsign): + raise NotImplementedError + + def getLatLong(self, callsign): + raise NotImplementedError + + def getCQZone(self, callsign): + raise NotImplementedError + + def getITUZone(self, prefix): + raise NotImplementedError + + def getCountry(self, prefix): + raise NotImplementedError + + def getAdifID(self, prefix): + raise NotImplementedError + + def getContinent(self, prefix): + raise NotImplementedError + + def getAll(self, callsign): + raise NotImplementedError diff --git a/pyhamtools/lookuplib.py b/pyhamtools/lookuplib.py index 26694d5..78a59f1 100644 --- a/pyhamtools/lookuplib.py +++ b/pyhamtools/lookuplib.py @@ -3,7 +3,7 @@ import logging import logging.config import re import random, string -from datetime import datetime, timedelta +from datetime import datetime import xml.etree.ElementTree as ET import urllib import json @@ -30,9 +30,9 @@ class LookupLib(object): 2. Clublog.org (HTTPS lookup) 3. Country-files.com (infrequently updated PLIST File) - It's aim is to provide a homogeneous interface to different data sources. + It's aim is to provide a homogeneous interface to different databases. - Typically it is injected as a dependency in the Callinfo class, but can also be used directly. + Typically an instance of this class is injected as a dependency in the :py:class:`Callinfo` class, but it can also be used directly. 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. @@ -43,7 +43,7 @@ class LookupLib(object): 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 + filename (str, optional): Filename for Clublog XML or Country-files.com cty.plist file. When a local file is used, no Internet connection not API Key is necessary. logger (logging.getLogger(__name__), optional): Python logger """ @@ -83,7 +83,7 @@ class LookupLib(object): raise AttributeError("Lookup type missing") def lookup_entity(self, entity=None): - """Returns lookup data of a ADIF Entity + """Returns lookup data of an ADIF Entity Args: entity (int): ADIF identifier of country