Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Statically check your Python code

Project Description


py_static_check can statically check your Python code for a lot of common errors. It uses a modified pyflakes code and extends with following things:

  • Ability to specify what star imports resolve to (-s argument)
  • Ability to ignore unused import warnings (-i argument)
  • Better sorting of warnings/errors

For more information check out:

To install it do following:

sudo easy_install py_static_check

Here are some of the things py_static_check can do.

Catch undefined names, even for star imports

Example code:

from os import *

def function_with_error():
    print path
    print paths

import os
    'os': os.__all__,

When ran with py_static_check:

$ py_static_check -s tests/ tests/
tests/ undefined name 'paths

Ignore not used warnings

Exampel code:

from os import path

When ran with py_static_check -i option:

$ py_static_check -i tests/

$ py_static_check tests/
tests/ 'path' imported but unused

Assigned but never used

Like pyflakes it can catch a lot of errors, such as defining a variable without using it.

Exampel code:

def some_function():
    def inner_fn():
        local_var = ""

When ran with py_static_check:

$ py_static_check tests/

tests/ local variable 'local_var' is assigned to but never used

Copyright: 2011 by amix License: MIT.

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
py_static_check-1.2-py2.7.egg (22.0 kB) Copy SHA256 Checksum SHA256 2.7 Egg Dec 19, 2011
py_static_check-1.2.tar.gz (10.5 kB) Copy SHA256 Checksum SHA256 Source Dec 19, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting