QSLGen is a utility for Ham Radio operators to generate QSL cards for station operators with public email addresses on QRZ.com and email them via Gmail OAuth API or save them locally for use in any email client. It can also update eQSL Sent info for each emailed QSL card on QRZ.com.
Note
You must be at least an XML subscription holder at QRZ.com to use your API key(s) in QSLGen.
Important
QSLGen requires the following packages in the Python environment. Please install them properly before trying to run QSLGen.
| Beautiful Soup 4 | html2image | html2text |
| adif_io | cryptography | google-auth-oauthlib |
| google-api-python-client | apiclient | requests |
Please go into the settings menu when you first launch QSLGen.
If you wish to use the Gmail API, you need to setup OAuth for your account and download the OAuth Client Secrets JSON file. You will be able to copy and paste the contents into QSLGen at runtime. QSLGen will encrypt the json data and save it for future use.
Important
You do NOT need to, but you can choose to publish and verify the app in your cloud console whenever you desire. The instructions below only take you as far as setting up your OAuth Client in testing status (which is perfectly fine for personal use).
To setup your API:
- Go to the Google Cloud Console
- Create a new project or select an existing one.
- Navigate to APIs & Services > Library and search for "Gmail API."
- Select the Gmail API and click Enable.
- Go to APIs & Services > OAuth consent screen.
- Select User Type: External
- Fill in the required App Information (App name, user support email, and developer contact info).
- Add the Send Email Scope (Search for Gmail API scopes).
- Add Test Users: While in "Testing" status, only added test users can authorize the app.
- Go to APIs & Services > Credentials.
- Click Create Credentials and select OAuth client ID.
- Select the Application type: Desktop app
- Click Create to receive your Client ID and Client Secret.
- Download the JSON file containing these credentials for use in your application.
Your QSL card's background image filename MUST follow the naming convention of the included file for ALL callsigns/API keys QSLGen will run through. The naming convention is your callsign in all caps followed by underscore ( _ ) followed by "bg". If you have a prefix or suffix on a callsign, replace the slash ( / ) with an underscore ( _ ).
- Regular callsign (ex. DA6AJP):
DA6AJP_bg.jpg - Callsign with prefix (ex. SO/DA6AJP):
SO_DA6AJP_bg.jpg
QSLGen uses two html files.
- QSLGen.html
- Curr_QSLGen.html
The QSLGen.html file ships with/is included with the QSLGen package and is where the script uses DOM selectors to create a customized QSL Card. You can edit the file to your preference, but be aware of variables that the script may be searching to edit.
The Curr_QSLGen.html file is created on the fly while QSLGen is running and iterating through your QSOs.
QSLGen needs your API key(s). You will enter them in the settings menu, and it will create and encrypt an apikeys.txt file with the API keys given.
Simply run the python script after fulfilling the requirements above, and follow the onscreen prompts.
python main.py