Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Integrating Jinja2 for Enhanced Templating and Transformations #7

Open
MisterGC opened this issue Jul 3, 2024 · 0 comments

Comments

@MisterGC
Copy link
Contributor

MisterGC commented Jul 3, 2024

Description

Evaluate the potential benefits and feasibility of integrating Jinja2 into our YAML processing workflow. This could potentially replace or complement our current built-in transformation functions and YamlTransformer, offering more powerful and flexible templating capabilities.

Potential Benefits

  • More powerful templating features (loops, conditionals, macros)
  • Simplified and more declarative approach to transformations
  • Improved performance through template caching
  • Better consistency with other Python projects
  • Enhanced extensibility through custom filters and functions

Considerations

  • Learning curve for users familiar with the current system
  • Ensuring all current functionality can be replicated
  • Potential performance implications for very large or complex transformations
  • Maintaining backwards compatibility

Possible Approaches

  1. Full replacement of current templating system with Jinja2
  2. Hybrid approach: Integrate Jinja2 while retaining custom Python functions for edge cases
  3. Gradual integration: Start with simple substitutions, then expand to more complex transformations

Next Steps

  • Research Jinja2 capabilities and limitations in context of our use cases
  • Create proof-of-concept implementation
  • Evaluate impact on existing codebase and user workflows
  • Gather feedback from team and potential users

Related

  • Current templating system
  • YamlTransformer class
  • Built-in transformation functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant