Skip to content

Commit 74591ba

Browse files
committed
Add method to retrieve lenses from DeepskyLog.
1 parent 30badc6 commit 74591ba

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ print(pds.dsl_instruments('username'))
7272
# Get all defined eyepieces of a DeepskyLog user
7373
print(pds.dsl_eyepieces('username'))
7474

75+
# Get all defined lenses of a DeepskyLog user
76+
print(pds.dsl_lenses('username'))
77+
7578
# Get a list of possible magnifications for a given telescope and the eyepieces as defined in DeepskyLog
7679
telescope = pds.dsl_instruments('username')[0]
7780
eyepieces = pds.dsl_eyepieces('username')

pydeepskylog/deepskylog_interface.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ def dsl_eyepieces(username: str) -> dict:
2828
"""
2929
return _dsl_api_call("eyepieces", username)
3030

31+
def dsl_lenses(username: str) -> dict:
32+
"""
33+
Get all defined lenses of a DeepskyLog user.
34+
35+
This function retrieves the lenses defined by a specific user in the DeepskyLog system.
36+
37+
Args:
38+
username (str): The username of the DeepskyLog user.
39+
40+
Returns:
41+
dict: A dictionary containing the lenses' specifications, in JSON format.
42+
"""
43+
return _dsl_api_call("lenses", username)
44+
45+
3146
def calculate_magnifications(instrument: dict, eyepieces: dict) -> list:
3247
"""
3348
Calculate possible magnifications for a given telescope and eyepieces.
@@ -114,7 +129,7 @@ def _dsl_api_call(api_call: str, username: str) -> dict:
114129
115130
Args:
116131
api_call (str): The specific API endpoint to call (e.g., "instruments", "eyepieces").
117-
username (str): The username of the DeepskyLog user.
132+
username (str): The username of the DeepskyLog uphpser.
118133
119134
Returns:
120135
dict: The response from the API call, parsed as a JSON dictionary.

pydeepskylog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3.2"
1+
__version__ = "1.4.0"

0 commit comments

Comments
 (0)