Search Python code for algorithmic features
Project description
Presentation
Paroxython is a set of command-line tools which finds, tags and filters 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).
Intended audience
- You are a teacher, in charge of an introductory course in Python programming in an educational institution. Over the years, you have accumulated many—far too many—programs and code snippets that may be of interest to your students.
- You are a seasoned developer, and would like to share your knowledge by helping a loved one learn how to code. A cursory search for pedagogical material quickly yields an overwhelming amount of websites and repositories stuffed with Python programs of various levels (e.g., 1, 2, 3, 4, 5, 6 and a lot more from Awesome Python in Education).
For which uses?
Simple questions
Complex questions
- Should I introduce the concept of subroutine before those of conditional and loop?
- Among the loops, which should come first: the most general (
while
), or the most useful in practice (for
)? - What are the concepts to be introduced prior to that of assignment?
Paroxython won't answer these questions for you, but it will give you some quantitative arguments
These are issues on which I have personally changed my mind over the course of my teaching career.
You know some online resources offering tens, if not hundreds
https://github.com/OmkarPathak/Python-Programs
Paroxython won't answer these questions for you, but it will give you some quantitative arguments
Or simply, You know Python and would like to help a loved one learn programming.
Over the years, you have accumulated dozens of programs and code snippets which you may use .
Some are suitable for beginners, others require more advanced knowledge.
Paroxython is for people who teach Python programming.
programs
|
| paroxython collect
V
labelled programs teacher's taxonomy
| /
| /
V
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 taxa are stored in a database, which can finally be filtered through a pipeline of inclusion, exclusion, impartment and hiding commands on programs or taxa.
Installation and test-drive
pip install paroxython
The following command should print a help message and exit:
paroxython --help
Under Jupyter notebook, you should first 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/program |
2-8 |
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 |
Examples
Documentation
- User manual and tutorials (under construction)
- Developer manual (under construction)
- Module reference
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.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a549af6dbba5f42ddecaf12ebcab776815608ac68380c08454cb044655385e |
|
MD5 | 6bdc4f8cfd2c11777963fedd80d66e7d |
|
BLAKE2b-256 | 65515f7126835d8e152d19878dac530cba7a7c2c159e2802e7f0e26df6d1a26b |