Skip to main content

Random news articles in any language

Project description

gobbet - Random news articles in any language

Wikinews is a wonderful free source of long-form text in a variety of world languages. gobbet provides you with access to words, sentences and paragraphs taken from Wikinews articles in any of its supported languages. This can be used as filler text for type specimens, web layouts, etc.

Example usage

from gobbet import get_news, unicode_ranges

words, headlines, paragraphs = get_news("el") # ISO language code

# words is a Wordlist object; like Counter, but with a few more methods
words = (
    words.filter_popularity(2) # Only words which occur >=2 times
         .filter_length(5)     # ... of five letters or more ...
         .filter_unicodes(unicode_ranges["Greek"]) # .. in Greek script
)

# Want to find some kerning pair words?
bigrams = words.bigrams()
# bigrams['οώ'] === {'προώθησε', 'προώθηση', 'προώθησης', 'προώρων'}

# headlines and paragraphs are just lists, but...
from gobbet import filter_length, filter_unicodes

renderable = filter_unicodes(headlines, [font.getBestCmap().keys()])

License

gobbet was written by Simon Cozens. See LICENSE for the terms of this library.

Note that Wikinews text is provided under the CC-BY 2.5 license, and your application must comply with the terms of that license in its use of the content.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gobbet-0.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gobbet-0.0.3-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file gobbet-0.0.3.tar.gz.

File metadata

  • Download URL: gobbet-0.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for gobbet-0.0.3.tar.gz
Algorithm Hash digest
SHA256 df1178e40f16852cb4dd733c395e3e75679cfde22941bf4d701f23a3b75e8c01
MD5 96baf1db96a8e14fbb118111b7fd62e7
BLAKE2b-256 9b9ceee2a1031d8ec85d33281cc5c2afb2f74ba4b305ff890528dc294c0e95c0

See more details on using hashes here.

File details

Details for the file gobbet-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: gobbet-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for gobbet-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 01691bf482f9db285b761e24199c81495044cb70812a636c14997f437aafe1ab
MD5 d96c6aa8c694a45217d3c0a003d01f3e
BLAKE2b-256 bec9fddf5520318718a5cbf119015059689a175446965ae204d38a33750120f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page