Custom templates for report creation
Hi, I have a use case where i need more flexibility in the report creation. I would love to use my own templates and pass them to the report() method.
Additionally, I feel like there is an weird split between the content of the report coming from the templates folder and the report() method.
Parts like these might be better located in templates but would require logic in the templates:
if any_mismatch:
report += "Columns with Unequal Values or Types\n"
report += "------------------------------------\n"
report += "\n"
I know that i could just create a report() method in my own project and that I already have all the flexibility which I am describing here. But if there exists any interest in this project, I am happy to submit a PR.
Hi there @alexanderschmitz always happy to accept PRs. We did talk about this offline as a team and I think having custom reporting would be a welcome feature.
Would love to discuss further if you would be open to submitting a solution here.
Ok I am really glad to hear this :)
What is your opinion on using jinja templates for this?
Ok I am really glad to hear this :)
What is your opinion on using jinja templates for this?
Totally fine with that. Seems like a pretty logical option. If you do purpose a solution it would be nice to convert all the existing templates into jinja too. I think right now it's broken down into bits and pieces. One standard template would be nice with the option to bring your own.
@alexanderschmitz I made some changes here: https://github.com/capitalone/datacompy/tree/templates-jinja, was sort of just messing around. Feel free to use this is you like or roll your own. It doesn't accept a custom template yet.