Skip to content
/ pytl Public

Command line tool that parses python file, enumerates classes and methods as a tree structure.

License

Notifications You must be signed in to change notification settings

ryo-ma/pytl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytl

0.2.4 MIT License

Overview

Command line tool that parses python file, enumerates classes and methods as a tree structure.

Install

$ pip install pytl

Usage

$ pytl test.py

 2: class Test
 3:   |_def __init__(self)
 6:   |_def walk(self, distance)
 9:   |_def stop(self)
12: def method1()
13:   |_def method2()
14:     |_def method3()
15:       |_def method4()
18: def main()

Show only the def line.

$ pytl test.py -d

 3: def __init__(self)
 6: def walk(self, distance)
 9: def stop(self)
12: def method1()
13:   |_def method2()
14:     |_def method3()
15:       |_def method4()
18: def main()

Show only the class line.

$ pytl test.py -c

 2: class Test

Tips

Using percol makes pytl even more useful.

percol

Incremental search from pytl and open in vi.

function ppytl(){
  if [ -z "$1" ]; then
    pytl
  else
    file=$1
    line=$(pytl $file | percol | awk '{ print $1 }')
    vi -c $line $file
  fi
}
$ ppytl test.py

Licence

MIT

About

Command line tool that parses python file, enumerates classes and methods as a tree structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages