Python wrapper for After the Deadline API
Installation and Requirements
The default branch should work with Python 2.5 and its standard libraries.
The Python3 branch should work with Python 3.1 and its standard libraries.
The idea behind this code is to provide wrapper methods and classes for accessing After the Deadline API and returning python objects for easy usage. You can know more about After the Deadline on their homepage.
Currently supported methods are:
checkDocumentwhich returns a list of
Errorobjects with the following properties:
stringthe wrong part
precontextwhat comes just before the wrong part
typeof the error...
urlurl to obtain page with pretty error explanation
suggestionslist of strings with the suggested alternatives
statswhich returns a list of
Metricobjects with the following properties:
Example interactions with the python shell
Checking document for errors
import ATD ATD.setDefaultKey("your API key") errors = ATD.checkDocument("Looking too the water. Fixing your writing typoss.") for error in errors: print "%s error for: %s **%s**" % (error.type, error.precontext, error.string) print "some suggestions: %s" % (", ".join(error.suggestions),)
grammar error for: Looking **too the** some suggestions: to the spelling error for: writing **typoss** some suggestions: typos
import ATD ATD.setDefaultKey("your API key") metrics = ATD.stats("Looking too the water. Fixing your writing typoss.") print [str(m) for m in metrics]
['spell(misused words:1)', 'spell(raw:1)', 'stats(sentences:2)', 'stats(words:8)']
Feedback (bug reports, suggestions, etc...)
Submit an issue or contact me on gmail at miguel.ventura.