This is a collection of examples using Codegen. You can use these examples to learn how to use Codegen and build custom code transformations.
We recommend using uv with Python 3.13 for the best experience.
First, install uv if you haven't already
brew install uvCreate and activate a Python 3.13 virtual environment
uv venv && source .venv/bin/activateInstall the codegen package
uv syncEach directory contains a self-contained example with:
- A README explaining the transformation
- Sample code to transform
- The Codegen script that performs the transformation
Have a useful example to share? We'd love to include it! Please see our Contributing Guide for instructions.
The Apache 2.0 license.