Send daily email alerts of the Bitcoin Price My script sends daily alerts of the bitcoin price to my inbox. I am using CoinDesks API, and the following libraries:

requests==2.18.4

schedule==0.5.0

and gmail sender: https://github.com/paulchakravarti/gmail-sender

Here is my code:

"""Send daily Bitcoin price alerts to inbox."""
from time import sleep

from requests import get
import schedule
from gmail import GMail, Message


def get_bitcoin_price():
    """Get current Bitcoin price in USD using Coindesk's real-time API"""
    response = get('https://api.coindesk.com/v1/bpi/currentprice.json').json()

    return response['bpi']['USD']['rate']


def send_email(recipient: str='walid.mujahid.dev@gmail.com'):
    bitcoin_price = get_bitcoin_price()

    # enter actual password, otherwise, nothing happens.
    gmail = GMail('Price Alert &lt;walid.mujahid.open@gmail.com&gt;',
                  password='password')
    message = Message(f'Bitcoin is at {bitcoin_price} right now!',
                      to=recipient,
                      text=f'The current Bitcoin price is {bitcoin_price}.')

    gmail.send(message)


if __name__ == '__main__':
    schedule.every().day.at("06:30").do(send_email)

    while True:
        schedule.run_pending()
        sleep(1)
Define some constants
I'd make some constants and put them at the top of the program because if your program becomes bigger, it'll be harder to change their values:
EMAIL_TIME = '06:30'
SLEEP_TIME = 1
URL = 'https://api.coindesk.com/v1/bpi/currentprice.json'


Never store your credentials in clear-text
Here, you replaced your actual password with a placeholder, but what if you mistakenly commit&amp;push it to your public git repository? More, at the moment I can also take your email and send those nice Viagra emails.
What I usually do is store my credentials in a different config file which is in .gitignore as well (it's not A LOT safer, but at least you can't see them + it adds an extra layer of security anyways).
As an alternative, you can create environment variables to store them there if you'd like.

Error handling
Try to add some exception handling to let the user know if something went wrong with its script. You can even create your own exception class:
class RetrieveUrlException(Exception):
    pass

Which you can then call like this:
...
raise RetrieveUrlException('The URL could not be accessed')