Skip to main content

jusText

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 the a fork of original code of jusText hosted on Google code. Below are some “forks” that I found on GitHub:

Instalation

  1. Make sure you have Python installed.

  2. Download the sources:

    $ wget https://github.com/miso-belica/jusText/archive/master.zip
  3. Extract the downloaded file:

    $ unzip master.zip
  4. Install the package (you may need sudo or a root shell for the latter command):

    $ cd jusText-master/
    $ python setup.py install

Or simply:

pip install git+git@github.com:miso-belica/jusText.git

Dependecies

lxml>=2.2.4

Usage

$ python -m justext -s english_page.html > plain_text.txt
$ 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 paragraph['class'] == 'good':
    print paragraph['text']

Acknowledgements

This software is 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 Pomikalek.

Changelog for jusText

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

1.2 (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 € to Ÿ

1.1 (2011-03-09)

  • First public release.

Metadata

Release files for jusText 1.2.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 1.2.0
File Size Uploaded Provenance Actions
jusText-1.2.0.zip 860.8 kB Without provenance Details for jusText-1.2.0.zip

Release files / jusText-1.2.0.zip

Download URL jusText-1.2.0.zip
Size 860.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6715127a631795bda60660b6b24510c1b23ba4c7855bb5fddfb3d61027be39f0
BLAKE2b-256 checksum
How to use checksums
dd67352453fc02d18e554503d42f772087d5ce42b3d89700cfd132ded6a71af0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for jusText 1.2.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