Zuora: Python/Pandas Transform

Zuora: Python/Pandas Transform

Often times there's a need to export certain details from Zuora for the purpose of importing into another system. Zuora facilitates this sort of operation to a certain degree - in the sense that it provides making/scheduling/emailing of reports. After the report is received in the email it's the job of the receipient to transform/upload into the downstream/target system.

I use Python/Pandas to perform the transform operation. I've given below sample code that perform a simple transformation. The code reads the report generated by Zuora which is in USC-2 Little Endian format, strips out the dollars, and commas from the number columns, add an additional column based on calculation, and finally writes out the transformed output, in CSV format, by pre-pending current date (in DD-MON-YYYY) format in UTF-8 encoding that's suitable for several other downstream/target systems.

The Spyder IDE below is showing the code "zuora_ns_invoice_transform.py" script with annotations.

(Oh yes ... and the Spyder IDE is also showing tabs for scripts like 'TDA_Get_Account_Balances.py', 'TDA_Refresh_Bearer_Token.py', etc. which are the programs I've developed for my algorithmic trading . BTW it so happens that I've published the script 'TDA_Get_Account_Balances.py' at URL http://salilgangal.com/info/idle_cash_vis_a_vis_inflation.html.)



Here's the execution of the above script in Windows CMD.


Copyright © 2019 Salil V Gangal, All Rights Reserved.