Skip to content

iritkatriel/codoscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codoscope

Visualize the python compile pipeline

Install

This requires:

  • CPython 3.13 (tested with 3.13.0b1)
  • dependencies in requirements.txt
    • You will have to manually install tree-sitter-languages to have syntax highlighting. See step-by-step instructions below

The code uses internal, undocumented CPython APIs. It is very likely to break in future CPython versions. When it does you get to keep both pieces.

You can run this code under python 3.12 or lower, but many features will be disabled.

Step by step

The code is not packaged, due to some dependencies not being available yet in Python 3.13 (See this issue). I was able to get everything up by running the following commands:

python3.13 -m venv env
git clone https://github.com/grantjenks/py-tree-sitter-languages.git
git clone https://github.com/iritkatriel/codoscope.git
cd py-tree-sitter-languages/
../env/bin/pip install Cython tree_sitter==0.20.4 setuptools
../env/bin/python build.py
../env/bin/python setup.py install
cd ../codoscope
../env/bin/pip install -r requirements.txt

Usage

env/bin/python codoscope/src/main.py

Will start the application. You can press e to edit the code, and CTRL+S to go back to the inspector. You can enable different code views in the inspectors with the numbers from 1 to 7. You can quit with q

You can pre-load source from a file by running:

env/bin/python codoscope/src/main.py source-file-to-analyze.py

For testing compilation of a single line you can use:

env/bin/python codoscope/src/main.py -c 'x = [y*y for y in range(10)]'

For showing the code of a python module you can run:

env/bin/python codoscope/src/main.py -m package.module

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages