Skip to content

blejdfist/pycodegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyCodegen Build Status PyPi Version License

Pycodegen is a tool to help you generate code in your project using powerful Jinja2 templates.

To get started:

# Install
python3 -m pip install pycodegen

# Run cli
pycodegen

# Run cli using module
python3 -m pycodegen.cli
Frontend Description
cpp Parses C/C++ using libclang
json Passes a JSON file directly to the driver

How it works

  1. The requested frontend reads the input file and generates an intermediate representation.
  2. The representation is passed to the driver
  3. Driver does any processing required of the representation.
  4. Driver selects the output filename and template to be used and render the output file.

Example usage

# Generate the simple JSON example
pycodegen json examples/simple/input_file.json --driver examples/simple/driver.py --debug

# Get intermediate representation of a C++ file (to aid in driver development)
pycodegen cpp <name-of-file.cpp> --dump-json

About

Simple code generation tool written in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages