pyhamtools/README.md

60 lines
2 KiB
Markdown
Raw Normal View History

2014-06-15 09:06:17 +02:00
# pyhamtools
2014-04-24 13:48:38 +02:00
2014-06-15 10:18:48 +02:00
Pyhamtools is a set of functions and classes for Amateur Radio purpose. Currently the core part is the Callsign
2014-06-15 10:13:09 +02:00
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](http://country-files.org)
2014-06-15 09:06:17 +02:00
* [Clublog Prefixes & Exceptions XML File](https://clublog.freshdesk.com/support/articles/54902-downloading-the-prefixes-and-exceptions-as)
* [Clublog DXCC Query API](http://clublog.freshdesk.com/support/articles/54904-how-to-query-club-log-for-dxcc)
2015-04-06 20:05:18 +02:00
* [QRZ.com XML API](http://www.qrz.com/XML/current_spec.html)
2014-06-15 09:06:17 +02:00
* [Redis.io](http://redis.io)
2014-06-15 10:18:48 +02:00
2014-06-15 09:06:17 +02:00
are supported sources.
2014-06-15 10:25:16 +02:00
All these lookup services can be accessed through a unified interface.
2014-04-24 17:46:46 +02:00
2014-09-21 20:42:52 +02:00
Other modules include location based calculations (e.g. distance, heading between Maidenhead locators) or
frequency based calculations (e.g. frequency to band).
2014-06-15 10:18:48 +02:00
## References
This Library is used in production at the [DXHeat.com DX Cluster](https://dxheat.com), performing several thousand
2014-09-21 20:42:52 +02:00
lookups and calculations per day.
2014-06-15 10:13:09 +02:00
## Documentation
Check out the full documentation at:
2014-06-15 10:18:48 +02:00
[PyHamTools.readthedocs.org](http://pyhamtools.readthedocs.org/en/latest/index.html)
2014-06-15 09:06:17 +02:00
2014-06-15 10:13:09 +02:00
## Installation
2014-06-15 09:06:17 +02:00
Easiest way to install pyhamtools is through the packet manager PIP:
2014-06-15 10:25:16 +02:00
2014-06-15 10:13:09 +02:00
`pip install pyhamtools`
2014-06-15 09:06:17 +02:00
2014-06-15 10:18:48 +02:00
## Example: How to use pyhamtools
2014-06-15 09:06:17 +02:00
```
2014-09-21 20:42:52 +02:00
>>> from pyhamtools.locator import calculate_heading
>>> calculate_heading("JN48QM", "QF67bf")
74.3136
2014-06-15 09:06:17 +02:00
>>> 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
}
```
2014-06-15 10:13:09 +02:00
## Testing
An extensive set of unit tests has been created for all Classes & Methods.