web_programming.crypto_price

Convert ETH to USD using real-time price data from CoinGecko.

Attributes

COINGECKO_URL

eth_amount

Functions

eth_to_usd(→ float)

Convert ETH amount to USD.

get_eth_price_usd(→ float)

Fetch the current ETH price in USD.

Module Contents

web_programming.crypto_price.eth_to_usd(eth_amount: float) float

Convert ETH amount to USD.

web_programming.crypto_price.get_eth_price_usd() float

Fetch the current ETH price in USD.

web_programming.crypto_price.COINGECKO_URL = 'https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd'
web_programming.crypto_price.eth_amount