Giter Club home page Giter Club logo

adif_merge's Introduction

adif_merge.py

Ham Radio ADIF Logbook format merge/resolution program written in Python

AGPL License GitHub issues PyPi Version PyPi Python Versions PyPi Downloads

Summary

This tool is designed to merge and resolve multiple ADIF files, including partial information from different reported sources (e.g. previous uploads to LoTW, QRZ, clublog, et al. Each of these sources tend to "augment" log entries with their own additional information.

The motivation for this is that GridTracker https://tagloomis.com/ and several logging programs are able to not only send log entries to remote services, but also automatically download ADIF files back from them. I found myself with a bunch of ADIF files, but none of them really gave me the whole picture of my QSOs. I also have both a home and portable station and sometimes I'd forget to move my logs between the two. This allows me to merge those logs at a later date (or reconstruct them from external servers).

The code will look at multiple log entries that occur with the same band, call, and mode within 90 seconds of each other and attempt to merge them, since some reporting tools or duplicate logging out of WSJT-X occasionally occurs (e.g. a manual log entry to correct a gridsqare, or different rounding of times on and off (to the nearest minute).

It tries to automate the decision making process for conflicts between log entries, and will tend to treat .adif files with "lotw" in their name as more authoritative for some fields.

For a complete look at the decision making process, read the code. It's commented, including caveats and is designed to be easily modifiable.

Use the -p <filename>.json option to generate problem QSO output in JSON format to see where there were conflicts and how we resolved them.

Installation

Developed under python 3 >= 3.6

    pip3 install adif_merge

Sample usage

Here's what I do to merge my WSJT and GridTracker managed logs::

adif_merge -o mergedlog.adif -c merged_wsjtx.log -p problems.json \
        ~/.local/share/WSJT-X/wsjtx_log.adi ~/Documents/GridTracker/*.adif

Please use the --problems option to look at merge issues that the program wasn't confident about resolving. For example QRZ and LoTW often differ about user-entered information like ITU and CQ zones.

The problems option will a .json file that is approximately human readable list of unresolved issues you may wish to fix--first organized by field, and again organized by QSO.

Feedback & Disclaimer

This code is learning and evolving. Please save copies of all of your log files before replacing them with this augmented file.

If you disagree with choices I've made in preference when attempting to merge, such as frequency harmonization or deferring to LoTW when there is a conflict for some fields, please let me know.

Copyright & License

Copyright (c) 2020 by Paul Traina, All rights reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

adif_merge's People

Contributors

mend-bolt-for-github[bot] avatar pleasantone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mpeuster

adif_merge's Issues

ValueError: could not convert string to float: 'NA-052'

adif_merge 1.1.2
Python 3.8.5

Problem
When trying to merge two ADIF files together, I got the following error:

$ .local/bin/adif_merge -o mergelog.adif -c log.log -p problem.json Log4OM_ADIF_20201231232432.adi qdure-123120-log_KC2IEB.adi
Traceback (most recent call last):
  File ".local/bin/adif_merge", line 8, in <module>
    sys.exit(main())
  File "/home/cwawak/.local/lib/python3.8/site-packages/adif_merge/__init__.py", line 543, in main
    qsos.append(fixup_qso(qso, filename))
  File "/home/cwawak/.local/lib/python3.8/site-packages/adif_merge/__init__.py", line 177, in fixup_qso
    qso[field] = int(float(qso[field]))
ValueError: could not convert string to float: 'NA-052'

It looks like it's choking on parsing an IOTA reference:

<ANT_AZ:1>0 <ANT_EL:1>0 <STATE:2>FL <BAND:3>30m <BAND_RX:3>30m <CALL:4>N1UL <CONT:2>NA
<COUNTRY:13>United States <CNTY:11>FL, Collier <CQZ:1>5 <DISTANCE:4>1672 <DXCC:3>291 
<EMAIL:14>xxx<EQSL_QSL_RCVD:1>R <EQSL_QSL_SENT:1>R <FREQ:9>10.137200 <FREQ_RX:9>10.137200 
<GRIDSQUARE:4>EL95 <ITUZ:1>6 <LOTW_QSLSDATE:8>20201112 <LOTW_QSL_RCVD:1>N <LOTW_QSL_SENT:1>Y 
<MODE:3>FT8 <MY_CITY:15>xxxx <MY_CNTY:10>xxxx <MY_COUNTRY:13>United States 
<MY_CQ_ZONE:1>5 <MY_DXCC:3>291 <MY_GRIDSQUARE:4>FM29 <MY_ITU_ZONE:1>8 <MY_NAME:19>xxxx 
<MY_STATE:2>xxxx <NAME:19>xxxx <STATION_CALLSIGN:6>xxxx <PROGRAMID:7>LOG4OM2 
<PROGRAMVERSION:8>2.10.0.0 <QSL_RCVD:1>N <QSL_RCVD_VIA:1>E <QSL_SENT:1>N <QSL_SENT_VIA:1>E 
<QSL_VIA:46>ARRL, BETTER DIRECT, RETURN CARD ALSO DIRECT ! <QSO_COMPLETE:1>Y <QSO_DATE:8>20201111 
<QSO_DATE_OFF:8>20201111 <QTH:12>xxxx <RST_RCVD:3>-01 <RST_SENT:3>+15 <SWL:1>N 
<TIME_OFF:6>120800 <TIME_ON:6>120800 <TX_PWR:3>100 <QSO_RANDOM:1>Y <SFI:1>0 
<QRZCOM_QSO_UPLOAD_DATE:8>20201112 <QRZCOM_QSO_UPLOAD_STATUS:1>Y <IOTA:6>NA-052 
<IOTA_ISLAND_ID:6>NA-052 <APP_L4ONG_SATELLITE_QSO:1>N <APP_L4ONG_CONTEST:1>N 
<APP_L4ONG_QSO_CONFIRMATIONS:578>[{"CT":"LOTW","S":"Yes","R":"No","SV":"Electronic","RV":"Electronic","SD":"2020-11-12T00:00:00Z"},{"CT":"QSL","S":"No","R":"No","SV":"Electronic","RV":"Electronic"},
{"CT":"QRZCOM","S":"Yes","R":"No","SV":"Electronic","RV":"Electronic","SD":"2020-11-12T00:00:00Z"},
{"CT":"EQSL","S":"Requested","R":"Requested","SV":"Electronic","RV":"Electronic"},
{"CT":"HAMQTH","S":"Requested","R":"No","SV":"Electronic","RV":"Electronic"},
{"CT":"HRDLOG","S":"Requested","R":"No","SV":"Electronic","RV":"Electronic"},
{"CT":"CLUBLOG","S":"Requested","R":"No","SV":"Electronic","RV":"Electronic"}] <APP_L4ONG_QSO_AWARD_REFERENCES:280>[{"AC":"IOTA","R":"NA-052","G":"NA-052","SUB":[],"GRA":[]},
{"AC":"DXCC","R":"291","G":"NA","SUB":[],"GRA":[]},{"AC":"USA-CA","R":"FL-COLLIER","SUB":[],"GRA":[]},
{"AC":"WAC","R":"NA","SUB":[],"GRA":[]},{"AC":"WAS","R":"FL","SUB":[],"GRA":[]},{"AC":"WAZ","R":"5","SUB":[],"GRA":[]}] 
<EOR>

Expected Behavior
I'd expect to be able to merge these files without errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.