Format all code.

This commit is contained in:
2025-07-25 23:22:37 +02:00
parent f940470de3
commit 56e0965a5f
19 changed files with 850 additions and 353 deletions

View File

@@ -12,17 +12,17 @@ if __name__ == "__main__":
if len(sys.argv) < 2:
# Exit with an error code if no ticker is provided
sys.exit(1)
ticker_symbol = sys.argv[1]
try:
# Directly get the market cap
market_cap = yf.Ticker(ticker_symbol).info.get('marketCap')
market_cap = yf.Ticker(ticker_symbol).info.get("marketCap")
# On success, print JSON to stdout and exit cleanly
print(json.dumps({"market_cap": market_cap}))
sys.exit(0)
except Exception:
# If any error occurs, print an empty JSON and exit with an error code
print(json.dumps({"market_cap": None}))
sys.exit(1)
sys.exit(1)