A Library with Amateur Radio specific Functions and Methods
Find a file
2019-05-30 14:47:31 +02:00
.cache/v/cache python3 compatible 2018-01-27 19:52:27 +01:00
docs updated tests and fixtures. Changed Macedonia to North Macedonia 2019-05-30 14:24:22 +02:00
pyhamtools updated tests and fixtures. Changed Macedonia to North Macedonia 2019-05-30 14:24:22 +02:00
test updated tests and fixtures. Changed Macedonia to North Macedonia 2019-05-30 14:24:22 +02:00
.appveyor.yml removed python 3.3 2018-01-28 02:30:15 +01:00
.gitignore updated tests and fixtures. Changed Macedonia to North Macedonia 2019-05-30 14:24:22 +02:00
.travis.yml updated CI and dependencies 2019-05-30 14:47:31 +02:00
LICENSE Initial commit 2014-04-24 04:48:38 -07:00
README.md changed url of appveyor badge and added redis for testing 2018-01-28 13:06:26 +01:00
readthedocs-pip-requirements.txt bumped dependencies up to latest version 2019-05-30 14:23:13 +02:00
requirements-docs.txt bumped dependencies up to latest version 2019-05-30 14:23:13 +02:00
requirements-pytest.txt bumped dependencies up to latest version 2019-05-30 14:23:13 +02:00
setup.py updated CI and dependencies 2019-05-30 14:47:31 +02:00

pyhamtools

Build Status Build status codecov PyPI version

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. This and additional convenience features are provided for the following sources:

Currently,

Other modules include location based calculations (e.g. distance, heading between Maidenhead locators) or frequency based calculations (e.g. frequency to band).

References

This Library is used in production at the DXHeat.com DX Cluster, performing several thousand lookups and calculations per day.

Compatibility

Pyhamtools is since version 0.6.0 compatible with > Python 2.7 and > python 3.3. We check compatibility on OSX, Windows and Linux with the following Python versions:

  • Python 2.7
  • Python 3.4
  • Python 3.5
  • Python 3.6
  • pypy (Python 2)

Documentation

Check out the full documentation including the changelog at: pyhamtools.readthedocs.org

License

Pyhamtools is published under the permissive MIT License. You can find a good comparison of Open Source Software licenses, including the MIT license at choosealicense.com

Installation

Easiest way to install pyhamtools is through the packet manager pip:


$ pip install pyhamtools

Example: How to use 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
    }

Testing

An extensive set of unit tests has been created for all Classes & Methods. In order to be able to perform all tests you need a QRZ.com account and a Clublog API key.

pyhamtools rely on the pytest testing framework. In order to install it with all the needed dependencies run:


$ pip install -r requirements-pytest.txt

The QRZ.com credentials and the Clublog API key have to be set in environment variables:


$ export CLUBLOG_APIKEY="<your API key>"
$ export QRZ_USERNAME="<your qrz.com username>"
$ export QRZ_PWD="<your qrz.com password>"

In order to perform the tests related to the redis key/value store, a redis server has to be up & running.


$ sudo apt install redis-server
$ redis-server

To run the tests, simply execute:


$ pytest --cov pyhamtools

Generate the documentation

You can generate the documentation of pyhamtools with the following commands:


$ pip install -r requirements-docs.txt
$ cd docs
$ make html