Search Python code for algorithmic features
Project description
Paroxython is a command-line tool which finds and tags algorithmic features (such as assignments, nested loops, tail-recursive functions, etc.) in a collection of small Python programs, typically gathered for educational purposes (e.g., examples, patterns, exercise corrections).
Each tag consists in a free-form label associated with its spanning lines. These labels are then mapped onto a knowledge taxonomy designed by the teacher with basic order constraints in mind (e.g., the fact that the introduction of the concept of early exit must come after that of loop, which itself requires that of control flow, is expressed with the following taxon: flow/loop/exit/early).
Source codes, labels and taxons are stored in a database, which can finally be filtered through a pipeline of inclusion, exclusion and impartment commands on programs or taxons.
Installation
pip install paroxython
Test-drive
Terminal
paroxython --help
Jupyter notebook
Load the magic command:
%load_ext paroxython
Run it on a cell of Python code (line numbers added for clarity):
1 %%paroxython
2 def fibonacci(n):
3 result = []
4 (a, b) = (0, 1)
5 while a < n:
6 result.append(a)
7 (a, b) = (b, a + b)
8 return result
Taxon | Lines |
---|---|
call/method/append |
6 |
flow/loop/exit/late |
5-7 |
flow/loop/while |
5-7 |
metadata/sloc/8 |
2-8 |
operator/arithmetic/addition |
7 |
subroutine/argument/arg |
2 |
subroutine/function |
2-8 |
test/inequality |
5 |
type/number/integer/literal |
4 |
type/number/integer/literal/zero |
4 |
type/sequence/list |
6 |
type/sequence/list/literal/empty |
3 |
type/sequence/tuple/literal |
4, 4, 7, 7 |
variable/assignment/parallel |
4 |
variable/assignment/parallel/slide |
7 |
variable/assignment/single |
3 |
Documentation
Coming soon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for paroxython-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7deece8470335807cd63b06555a2191e10567272a8abdc0c0f0caa3caa569cf |
|
MD5 | f8e1c21860c1c416fa350d9caabaf4ec |
|
BLAKE2b-256 | bd6630c7e14eecd8a10da4dcf3a4bf6425b3441856b362aa80a8f4acc9c880c4 |