Skip to main content

jusText

https://api.travis-ci.org/miso-belica/jusText.png?branch=master

Program jusText is a tool for removing boilerplate content, such as navigation links, headers, and footers from HTML pages. It is designed to preserve mainly text containing full sentences and it is therefore well suited for creating linguistic resources such as Web corpora. You can try it online.

This is a fork of original (currently unmaintained) code of jusText hosted on Google Code. Below are some alternatives that I found:

https://twitter.com/PavelFranc/statuses/373479198720942080 Používají hustotu odkazů a délku odstavce - tak by mohli ještě přidat zanoření blokových prvků - a měli by náš prototyp z jyxa

Installation

Make sure you have Python 2.6+/3.2+ and pip (Windows, Linux) installed. Run simply (preferred way):

$ [sudo] pip install justext

Or for the fresh version:

$ [sudo] pip install git+git://github.com/miso-belica/jusText.git

Or if you have to:

$ wget https://github.com/miso-belica/jusText/archive/master.zip # download the sources
$ unzip master.zip # extract the downloaded file
$ jusText-master/
$ [sudo] python setup.py install # install the package

Dependencies

lxml>=2.2.4

Usage

$ python -m justext -s Czech -o text.txt http://www.zdrojak.cz/clanky/automaticke-zabezpeceni/
$ python -m justext -s English -o plain_text.txt english_page.html
$ python -m justext --help # for more info

Python API

import requests
import justext

response = requests.get("http://planet.python.org/")
paragraphs = justext.justext(response.content, justext.get_stoplist("English"))
for paragraph in paragraphs:
  if not paragraph.is_boilerplate:
    print paragraph.text

Testing

Run tests via

$ nosetests-2.6 && nosetests-3.2 && nosetests-2.7 && nosetests-3.3

Acknowledgements

This software has been developed at the Natural Language Processing Centre of Masaryk University in Brno with a financial support from PRESEMT and Lexical Computing Ltd. It also relates to PhD research of Jan Pomikálek.

Changelog for jusText

2.1.0 (2014-01-25)

  • FEATURE: Added XPath selector to the paragrahs. XPath selector is also available in detailed output as xpath attribute of <p> tag #5.

2.0.0 (2013-08-26)

  • FEATURE: Added pluggable DOM preprocessor.

  • FEATURE: Added support for Python 3.2+.

  • INCOMPATIBLE CHANGE: Paragraphs are instances of justext.paragraph.Paragraph.

  • INCOMPATIBLE CHANGE: Script ‘justext’ removed in favour of command python -m justext.

  • FEATURE: It’s possible to enter an URI as input document in CLI.

  • FEATURE: It is possible to pass unicode string directly.

1.2.0 (2011-08-08)

  • FEATURE: Character counts used instead of word counts where possible in order to make the algorithm work well in the language independent mode (without a stoplist) for languages where counting words is not easy (Japanese, Chinese, Thai, etc).

  • BUG FIX: More robust parsing of meta tags containing the information about used charset.

  • BUG FIX: Corrected decoding of HTML entities &#128; to &#159;

1.1.0 (2011-03-09)

  • First public release.

Metadata

Release files for jusText 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jusText 2.1.0
File Size Uploaded Provenance Actions
jusText-2.1.0.zip 865.6 kB Without provenance Details for jusText-2.1.0.zip

Built distributions (wheels)

Table of built distributions (wheels) for jusText 2.1.0
File Interpreter ABI Platform Actions
jusText-2.1.0.win32.exe Details for jusText-2.1.0.win32.exe
jusText-2.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for jusText-2.1.0-py2.py3-none-any.whl

Total release size: 2.8 MB

Release files / jusText-2.1.0.zip

Download URL jusText-2.1.0.zip
Size 865.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c2d3cd19feff41d2ef9e4a9915decf4c14a47dc63de94ddd539739d9bfc349fd
BLAKE2b-256 checksum
How to use checksums
fc54d6ade8b5dc5adb32c9826b7f2d28fdc2788b95ec752a9eb637173008eec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / jusText-2.1.0.win32.exe

Download URL jusText-2.1.0.win32.exe
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a0263e2db06b2d4839df0503e43579d6b7685600d87d2ab50c43a56a44623365
BLAKE2b-256 checksum
How to use checksums
7765c4b88dcdd58c0f0f7825f9a3e137cb87984429d3b994a17f69f9af5a905b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / jusText-2.1.0-py2.py3-none-any.whl

Download URL jusText-2.1.0-py2.py3-none-any.whl
Size 862.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c62fc00abc25f2c7648cf9e8f649e2a40070cae9f46fdb45731d41ea34f80e04
BLAKE2b-256 checksum
How to use checksums
bbeb84a0ee05ff96a510204317dbf85fec99766d862882cf4315d644531ccf1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for jusText 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page