Septzzz's picture
Upload folder using huggingface_hub (part 2)
7f5786b verified
Raw
History Blame Contribute Delete
8.36 kB
import requests
import json
from datetime import date, datetime, timedelta
import os
from typing import Optional, Dict, Union, List
def venues_venue_id_events(venue_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"Returns event list with performer artists by venue id"
"""
url = f"https://cuttime1.p.rapidapi.com/venues/{venue_id}/events"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def lyrics_artists(lyric: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This method returns list of artists matched by lyrics search request"
"""
url = f"https://cuttime1.p.rapidapi.com/lyrics/artists"
querystring = {'lyric': lyric, }
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def lyrics_songs(lyric: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This method returns list of songs matched by lyrics search request"
"""
url = f"https://cuttime1.p.rapidapi.com/lyrics/songs"
querystring = {'lyric': lyric, }
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def brands_brand_id_band_brand_affinities_score(brand_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
brand_id: Brand ID
"""
url = f"https://cuttime1.p.rapidapi.com/brands/{brand_id}/band-brand-affinities-score"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def artists_artist_id_brand_affinities(artist_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
artist_id: ID of artist to return
"""
url = f"https://cuttime1.p.rapidapi.com/artists/{artist_id}/brand-affinities"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def artists(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
"""
url = f"https://cuttime1.p.rapidapi.com/artists"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def artists_artist_id(artist_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"Optional extended description in Markdown."
artist_id: ID of artist to return
"""
url = f"https://cuttime1.p.rapidapi.com/artists/{artist_id}"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def artists_artist_id_events(artist_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
artist_id: ID of artist to return
"""
url = f"https://cuttime1.p.rapidapi.com/artists/{artist_id}/events"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def artists_artist_id_top_tracks(artist_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
artist_id: ID of artist to return
"""
url = f"https://cuttime1.p.rapidapi.com/artists/{artist_id}/top-tracks"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def brands(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
"""
url = f"https://cuttime1.p.rapidapi.com/brands"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def brands_brand_id(brand_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
brand_id: Brand ID
"""
url = f"https://cuttime1.p.rapidapi.com/brands/{brand_id}"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def brands_brand_id_band_affinities(brand_id: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
brand_id: Brand ID
"""
url = f"https://cuttime1.p.rapidapi.com/brands/{brand_id}/band-affinities"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def events_search(longitude: int, latitude: int, distance: int=100, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
" "
longitude: longitude value
latitude: latitude value
distance: The distance between point and event that shows in miles
"""
url = f"https://cuttime1.p.rapidapi.com/events/search"
querystring = {'longitude': longitude, 'latitude': latitude, }
if distance:
querystring['distance'] = distance
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "cuttime1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation