Septzzz's picture
Upload folder using huggingface_hub (part 9)
9cabd68 verified
Raw
History Blame Contribute Delete
888 Bytes
import requests
import json
from datetime import date, datetime, timedelta
import os
from typing import Optional, Dict, Union, List
def qr_code_for_text_to_qr_image(text: str='Qr code text string', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"API generate the image in png of the QR code will be download automatically when the request succeeds."
"""
url = f"https://text-qr-generator.p.rapidapi.com/texttoqr"
querystring = {}
if text:
querystring['text'] = text
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "text-qr-generator.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation