Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.58 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.58 KB

tara automata

Automate python type hints for params and return values

Getting Started

Windows

git clone https://github.com/Donny-GUI/Tara.git
cd Tara
python main.py <yourfile>

Linux

git clone https://github.com/Donny-GUI/Tara.git
cd Tara
python3 main.py <yourfile>

BEFORE 📷

before

AFTER 📸

after after

How?

Parameters use a mix of symbolic execution, natural language processing and static analysis. Then finally a large language model to find a reasonable type if none is assigned.

For Return Types

  1. Determine if the function has a return ast
  2. Find those statements that push return
  3. Check if it has a type hint or type annotation
  4. Analyize the literal string of the return value for lexigraphical hints
  5. if no result, use language syntax to infer type.
  6. Reanalyze to make sure the type or types makes sense

To Come

  1. Secondary Types - Genrators/iters, slices, Callable, Array, etc
  2. Standard Library Types - Index the standard library return types and objects. build a map to function -> return object