Code checking tool for teaching Python
Project description
PyTA
PyTA is a Python program which uses static code analysis to help students find and fix common coding errors in introductory Python courses. Python already has great static analysis tools like pep8 and pylint, but these tools do not necessarily have the most beginner-friendly format. PyTA has two central goals:
- Statically identify common coding errors by using existing linting tools and building custom linters (e.g., as pylint checkers).
- Present beautiful, intuitive messages to students that are both helpful for fixing errors, and good preparation for the terser messages they will see in their careers.
This is a new project started in the Summer of 2016, and takes the form of a wrapper around pylint (with custom checkers) that operates directly on Python modules, as well as a website with some supplementary material going into further detail for the emitted errors.
For greater details on the errors PyTA checks for: Help Documentation.
Installation
If you're developing PyTA, simply clone this repo. If you are working on type inference, note that some debugging tools require graphviz to be installed on your system.
If you want to just check it out, you can install it using pip
(or possibly pip3
on OSX, depending on what previous versions of
pip
and Python you have installed):
> pip install python-ta
Demo
You can currently see a proof of concept in this repository. Clone it,
and then run python
in this directory (PyTA is primarily meant to be
included as a library). In the Python interpreter, try running:
>>> import python_ta
>>> python_ta.check_all('examples.forbidden_import_example')
[Some output should be shown]
>>> python_ta.doc('E9999')
Tests
We have a test suite which checks every example file to see if PyTA actually picks up on the error the file is supposed to illustrate.
To run the tests, enter python tests/test_examples.py
in the terminal. (If you're on a Mac, you'll likely need to do python3 tests/test_examples.py
instead.)
Contributors
Nigel Fong, Niayesh Ilkhani, Rebecca Kay, Christopher Koehler, David Kim, Simeon Krastnikov, Ryan Lee, Hayley Lin, Wendy Liu, Shweta Mogalapalli, Ignas Panero Armoska, Justin Park, Amr Sharaf, Kavin Singh, Alexey Strokach, Jasmine Wu, Philippe Yu
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 python_ta-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fe955dbc3bb047719d1e58619713963f80ca98df9aab1def3896cedb94e4e0a |
|
MD5 | 1d2df1829650cd426efa60a53b03d30e |
|
BLAKE2b-256 | 73620f2f33308c3da22f56eb7212acc7de5fd2431ca74b6d9c95e4e64e5f33af |