Skip to content

Commit a8b0bc1

Browse files
authored
Misc cleanup & adding a couple wrappers (#7)
* iterate version * shuffle module functions to static methods * formatted with pyink * added wrappers for fetch_logbook to LOTW --------- Co-authored-by: Jacob Humble <contact@jacobhumble.com>
1 parent e9cd294 commit a8b0bc1

File tree

8 files changed

+842
-506
lines changed

8 files changed

+842
-506
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25-
pip install setuptools wheel
25+
pip install setuptools wheel build
2626
- name: Build package
2727
run: |
2828
python -m build

src/qspylib/_version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""unified version string"""
2-
__version__ = '1.0.0a2'
2+
3+
__version__ = "1.0.0a3"

src/qspylib/clublog.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,44 @@
66
import requests
77
from .logbook import Logbook
88

9+
910
class ClubLogError(Exception):
1011
"""An error raised when an issue occurs with the ClubLog API."""
11-
def __init__(self, message="An error occurred while interfacing with the ClubLog API"):
12+
13+
def __init__(
14+
self, message="An error occurred while interfacing with the ClubLog API"
15+
):
1216
super().__init__(message)
1317

18+
1419
class ClubLogClient:
1520
"""This is a wrapper for the ClubLog API, holding a user's authentication\
1621
to perform actions on their behalf.
1722
"""
1823

19-
def __init__(self, email: str, callsign: str, password: str,
20-
timeout: int = 15):
24+
def __init__(self, email: str, callsign: str, password: str, timeout: int = 15):
2125
"""Initializes a ClubLogClient object.
2226
23-
Args:
24-
email (str): Email address for the ClubLog account
25-
callsign (str): Callsign for the ClubLog account
26-
password (str): Password for the ClubLog account
27-
timeout (int, optional): Timeout for requests. Defaults to 15.
27+
Args:
28+
email (str): Email address for the ClubLog account
29+
callsign (str): Callsign for the ClubLog account
30+
password (str): Password for the ClubLog account
31+
timeout (int, optional): Timeout for requests. Defaults to 15.
2832
"""
2933
self.email = email
3034
self.callsign = callsign
3135
self.password = password
3236
self.timeout = timeout
3337
self.base_url = "https://clublog.org/getadif.php"
3438

35-
3639
def fetch_logbook(self) -> Logbook:
3740
"""Fetch the user's ClubLog logbook.
3841
Raises:
3942
HTTPError: An error occurred while trying to make a connection.
4043
Returns:
4144
qspylib.logbook.Logbook: A logbook containing the user's QSOs.
4245
"""
43-
data = {
44-
'email': self.email,
45-
'password': self.password,
46-
'call': self.callsign
47-
}
46+
data = {"email": self.email, "password": self.password, "call": self.callsign}
4847
# filter down to only used params
4948
data = {k: v for k, v in data.items() if v is not None}
5049

0 commit comments

Comments
 (0)