Module pydsc

Module pydsc

source code


Python Documentation Spell Checker.

The pydsc module contains functionality needed to check documentation strings
and comments for spelling errors, within Python code. The pydsc module depends
on PyEnchant spell checker. PyEnchant provides interface for different spell
engines:
    * ispell
    * aspell
    * OpenOffice

The use of the pydsc module is very simple - just import pydsc and all modules
that will be imported after it will be checked. By default all spelling errors
will be printed to sys.stdout. The pydsc checker could be customized in many
different ways:
    * you can define set of files/directories that should be included/excluded
      from check process
    * you can redefine error messages destination
    * you can redefine and/or re-configurate spell checker

Install:
python setup.py install

Usage example:

import pydsc
import readline #errors will be printed to standart output

more complex example ( taken from pygccxml project ):

import pydsc
#check only pygccxml package
pydsc.include( r'D:\pygccxml_sources\sources\pygccxml_dev' )
pydsc.ignore( [ 'Yakovenko'
    , 'Bierbaum'
    , 'org'
    , 'http'
    , 'bool'
    , 'str'
    , 'www'
    , 'param'
    , 'txt'
    , 'decl'
    , 'decls'
    , 'namespace'
    , 'namespaces'
    , 'enum'
    , 'const'
    , 'GCC'
    , 'xcc'
    , 'TODO'
    , 'typedef'
    , 'os'
    , 'normcase'
    , 'normpath'
    , 'scopedef'
    , 'ira'#part of Matthias mail address
    , 'uka'#part of Matthias mail address
    , 'de'#part of Matthias mail address
    , 'dat'#file extension of directory cache
    , 'config'#parameter description
    , 'gccxml'#parameter description
    , 'Py++'
    , 'pygccxml'
    , 'calldef'
    , 'XXX'
    , 'wstring'
    , 'py' ] )


Version: 0.2

Author: Roman Yakovenko <roman.yakovenko@gmail.com>

License: Boost Software License <http://boost.org/more/license_info.html>

Classes
  filter_by_path_t
The instance of this class will help user to define filter, that will exclude modules from being checked
  checker_t
applies spell check process on every imported module
Functions
 
normalize_path(some_path)
return os.path.normcase( os.path.normpath( some_path ) )
source code
 
exclude(what)
Convenience function.
source code
 
include(what)
Convenience function.
source code
 
ignore(what, case_sensitive=False)
Adds word or list of words to the ignore list.
source code
Variables
  __url__ = 'http://www.language-binding.net'
  doc_checker = checker_t(checker.SpellChecker("en_US"))
Function Details

exclude(what)

source code 

Convenience function. It will exclude all modules, that their source file or parent directory belongs to "what".

what - list of paths, could contain file and directory names

include(what)

source code 

Convenience function. It will include only modules, that their source file or parent directory belongs to "what".

what - list of paths, could contain file and directory names

ignore(what, case_sensitive=False)

source code 

Adds word or list of words to the ignore list.

what - word(string) or list of words(strings) to be ignored.