in osci/postprocess/osci_change_report/process.py [0:0]
def get_change_report(date: datetime):
previous_date = get_previous_date(date=date)
ranking = OSCIRankingYTD(date=date)
ranking_df = ranking.read().reset_index().rename(columns={'index': ranking.schema.position})
old_ranking = OSCIRankingYTD(date=previous_date)
old_ranking_df = old_ranking.read().reset_index().rename(columns={'index': old_ranking.schema.position})
report = OSCIChangeRanking(date=date)
change_report = get_osci_ranking_change_report(old_report=old_ranking_df,
new_report=ranking_df,
company_field=ranking.schema.company,
active_contributors_field=ranking.schema.active,
active_contributors_change_field=report.schema.active_change,
total_community_field=ranking.schema.total,
total_community_change_field=report.schema.total_change,
rank_field=ranking.schema.position,
rank_change_field=report.schema.position_change)
report.save(df=change_report)
excel_report = OSCIChangeRankingExcel(from_date=previous_date, to_date=date)
excel_report.save(df=change_report)