Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I've reinstalled Python 3.96/windows and can't seem to have any luck running this script. I just get the "Please wait while we establish a connection to python" spinning window that never changes. Any ideas?
P.S. Yes, I did put in the correct authorization info in the headers 🙂
import requests
import json
def get_all_time_entries():
url_address = "https://api.harvestapp.com/v2/time_entries"
headers = {
"Authorization": "Bearer " + "xxxxxxxxxx",
"Harvest-Account-ID": "xxxxxx"
}
# find out total number of pages
r = requests.get(url=url_address, headers=headers).json()
total_pages = int(r['total_pages'])
# results will be appended to this list
all_time_entries = []
# loop through all pages and return JSON object
for page in range(1, total_pages):
url = "https://api.harvestapp.com/v2/time_entries?page="+str(page)
response = requests.get(url=url, headers=headers).json()
all_time_entries.append(response)
page += 1
# prettify JSON
data = json.dumps(all_time_entries, sort_keys=True, indent=4)
return data
print(get_all_time_entries())
No resolution... ultimately I ran on another machine to test and still had query issues even after making sure all additional packages were in.
Hi @fooddata15
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem.
Best Regards,
Rico Zhou
Hi @fooddata15
Currently you have installed Python 3.96/windows , when you connect to data source by python, it alway show loading.
1. Please check your network setting, the fire wall and check .Net in your PC.
2. Please download the latest version of Power BI Desktop and try again.
Link: Download Microsoft Power BI Desktop from Official Microsoft Download Center
3. According to your code, I think you may want to get data by Rest API. You can try to connect to Rest API by Web connector.
For Reference: Using a REST API as a data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
94 | |
78 | |
73 | |
64 | |
60 |
User | Count |
---|---|
106 | |
97 | |
76 | |
63 | |
61 |