Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sengiv committed Feb 17, 2025
1 parent 1c73533 commit eca11a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions demo_all_astro_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#PART 2 : CALCULATE ALL DATA
#-----------------------------------

#HOROSCOPE PREDICTIONS
horoscopePredictions = Calculate.HoroscopePredictions(birth_time, "Empty")
print(json.dumps(horoscopePredictions, indent=4))

#PLANETS
allPlanetDataList = Calculate.AllPlanetData(PlanetName.Sun, birth_time)
print(json.dumps(allPlanetDataList, indent=4))
Expand Down
5 changes: 4 additions & 1 deletion vedastro/calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def _make_request(cls, endpoint, params):
if "Status" in data and data["Status"] == "Fail":
print(data["Payload"])
if "Payload" in data and data["Payload"]:
return list(data["Payload"].values())[0]
if isinstance(data["Payload"], list):
return data["Payload"]
else:
return list(data["Payload"].values())[0]
else:
raise ValueError("Payload is missing or empty")
else:
Expand Down

0 comments on commit eca11a1

Please sign in to comment.