Pyhamtools is a set of functions and classes for Amateur Radio purpose. Currently the core part is the Callsign Lookup which decodes any amateur radio callsign string and provides the corresponding information (Country, DXCC entity, CQ Zone...etc). This basic functionality is needed for Logbooks, DX-Clusters or Log Checking.
Currently,
- Country-Files.org
- Clublog Prefixes & Exceptions XML File
- Clublog DXCC Query API
- QRZ.com XML API
- Redis.io
are supported sources. All these lookup services can be accessed through a unified interface.
Other modules include location based calculations (e.g. distance, heading between Maidenhead locators) or frequency based calculations (e.g. frequency to band).
This Library is used in production at the DXHeat.com DX Cluster, performing several thousand lookups and calculations per day.
Check out the full documentation at: PyHamTools.readthedocs.org
PyHamTools are published under the permissive MIT License. You can find a good comparison of Open Source Software licenses, including the MIT license at choosealicense.com
Easiest way to install pyhamtools is through the packet manager PIP:
pip install pyhamtools
>>> from pyhamtools.locator import calculate_heading
>>> calculate_heading("JN48QM", "QF67bf")
74.3136
>>> from pyhamtools import LookupLib, Callinfo
>>> my_lookuplib = LookupLib(lookuptype="countryfile")
>>> cic = Callinfo(my_lookuplib)
>>> cic.get_all("DH1TW")
{
'country': 'Fed. Rep. of Germany',
'adif': 230,
'continent': 'EU',
'latitude': 51.0,
'longitude': -10.0,
'cqz': 14,
'ituz': 28
}
An extensive set of unit tests has been created for all Classes & Methods.