A Python linter for detecting bias, subjectivity, and inaccuracy in news clippings.
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
rule
.gitignore
README.md
__init__.py
linter_class.py
lintlog.py
newslint.py
requirements.txt
result_class.py
spec_class.py
tests.py

README.md

newslint

A linter for detecting bias, subjectivity, and inaccuracy in news clippings.

A little project to lint a block of text to see how newsworthy, objective, sensationalist, pundit-prone, etc. it is. It comes from my interest in reading the news and identifying political bait. And it was enabled by the excellent joblint project originally done in JavaScript by Rowan Manning.

Run

Type python newslint.py "[block of text]" at a console to lint it. You will get a log report of errors, warnings, and notices along with what rules were found when linting the clipping.

Import

import newslint
result = newslint.newslint("SOME TEXT")

Tests

unittests:

python tests.py

coverage:

coverage run newslint.py "chris hayes obamacare death panels shit"
coverage html

To see HTML results, go to the directory and open htmlcov/index.html.

Credits

This is a Python modification/translation of Rowan Manning's excellent JavaScript package, joblint:

https://github.com/rowanmanning/joblint

My Python fork of Rowan's repo is at:

https://github.com/Xeus/joblint_python