<commit_before>import requests
import json

api_token = None
with open('token.txt', 'r') as f:
	api_token = f.readline()

payload = {'user_agent':'<EMAIL>', 'workspace_id':644218,
			 'since':'2015-04-24', 'until':'2015-04-24', 'grouping':'clients',
			 'subgrouping':'projects'}

r = requests.get('https://www.toggl.com/reports/api/v2/summary', auth=(api_token, 'api_token'), params=payload)

print(json.dumps(r.json(), sort_keys=True,
				indent=4, separators=(',',':')))

rjson = r.json()

for key,val in rjson.items():
	print(str(key) + ':' + str(val))

total_grand_hours = rjson['total_grand']/3600000

<commit_msg>Dynamically yesterday's date, just the hours<commit_after>import requests
import json
from datetime import date, timedelta

api_token = None
with open('token.txt', 'r') as f:
	api_token = f.readline()

yesterday = date.today() - timedelta(days=1)

yesterday = yesterday.isoformat()

print(yesterday)

payload = {'user_agent':'<EMAIL>', 'workspace_id':644218,
			 'since':yesterday, 'until':yesterday, 'grouping':'clients',
			 'subgrouping':'projects'}

r = requests.get('https://www.toggl.com/reports/api/v2/summary', auth=(api_token, 'api_token'), params=payload)

# print(json.dumps(r.json(), sort_keys=True, indent=4, separators=(',',':')))

# rjson = r.json()

total_grand_hours = r.json()['total_grand']/3600000

print(str(yesterday) + ':' + str(total_grand_hours))

{'fraction_non_alphanumeric': 0.1961206896551724, 'fraction_numerical': 0.033764367816091954, 'mean_word_length': 6.180412371134021, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2153860', 'n_tokens_mistral': 572, 'n_tokens_neox': 513, 'n_words': 90}