Python Streamlit example app for API calls and data visualization.
- Stremlit Emoji Shortcodes
- Streamlit Hello World Script
- Pandas Dataframe Query
- Pandas Dataframe Filter
- Streamlit Docs
- Pandas Docs
- Python API Docs
- LaTeX Supported Functions
- OpenMeteo API Docs - Weather Forecast
- OpenMeteo API Docs - Geocoding
- Altair Library Docs
- Streamlit Elements You Should Know About in 2023
- How to convert a 2D vector logo into 3D
- Convert a 2D image to a perfect 3D character model
- Streamlit & Google Sheets: The Easiest "Database"
def prRed(skk): print("\033[91m {}\033[00m" .format(skk))
def prPurple(skk): print("\033[95m {}\033[00m" .format(skk))
response = rq.get("https://api.example.com")
if response.status_code == 200:
prPurple("----------- JSON -----------")
print(response.json())
else:
match response.status_code:
case 201:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + str(response.status_code) + ": Created")
prPurple("----------- HEADERS -----------")
print(response.headers)
case 400:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + str(response.status_code) + ": Bad Request")
prPurple("----------- HEADERS -----------")
print(response.headers)
case 401:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + str(response.status_code) + ": Unauthorized")
prPurple("----------- HEADERS -----------")
print(response.headers)
case 404:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + str(response.status_code) + ": Not Found")
prPurple("----------- HEADERS -----------")
print(response.headers)
case 405:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + str(response.status_code) + ": Method Not Allowed")
prPurple("----------- HEADERS -----------")
print(response.headers)
case 500:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + str(response.status_code) + ": Internal Server Error")
prPurple("----------- HEADERS -----------")
print(response.headers)
case _:
prPurple("----------- STATUS CODE -----------")
prRed("Code " + response.status_code)