Skip to content

Commit

Permalink
Merge pull request #34 from devfinwiz/feature/clean_responses
Browse files Browse the repository at this point in the history
Clean API responses with unnecessary data, symbols
  • Loading branch information
devfinwiz authored May 11, 2024
2 parents e11aa51 + 8c2ddb2 commit cc4b276
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def process_data(data, key):
label = report.get("")
if label:
formatted_label = label.replace('+', '').strip()
formatted_reports[formatted_label] = {key: value for key, value in report.items() if key != ""}
formatted_reports[formatted_label] = {key: value.replace('%','').replace(',','') for key, value in report.items() if key != ""}
return {'symbol': stock_name, key: formatted_reports}

@staticmethod
def process_key_metrics_data(value):
return value.replace('\n', '').replace('\u20b9', '').replace(' ', '').replace(' ', '').replace(' ','').replace(' ','').replace(',','').replace('Cr.','Cr')
return value.replace('\n', '').replace('\u20b9', '').replace(' ', '').replace(' ', '').replace(' ','').replace(' ','').replace(',','').replace('Cr.','').replace('%','')

@staticmethod
def handle_key_metrics_response(response, company_code):
Expand Down

0 comments on commit cc4b276

Please sign in to comment.