Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2023 13:29
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Retrieves a random quote, uses requests, json and pydantic
import requests as requests
from requests import Response
from pydantic import BaseModel
class Quote(BaseModel):
content: str
author: str
response: Response = requests.get('')
quote: Quote = Quote.parse_raw(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment