Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Python module for generating placeholder text using the https://loripsum.net/ API

Project description

PyPI PyPI - License GitHub

Python module for generating placeholder text using the loripsum.net API.

Basic Usage

import loremipsum

# Generate plain text paragraphs with API default settings
no_options = loremipsum.generate()

# Generate 3 medium length paragraphs in plain text
plaintext = loremipsum.generate(3, loremipsum.ParagraphLength.MEDIUM)

# Generate 1 long paragraph with HTML tags
simple_html = loremipsum.generate(1, loremipsum.ParagraphLength.LONG, plaintext=False)

# Generate 1 long paragraph with HTML headers and decorated text
options = ['headers', 'decorate']
decorated_html = loremipsum.generate(1, loremipsum.ParagraphLength.LONG, plaintext=False, html_options=options)

Command Line

Basic

This package includes the loremipsum command to generate text from the command line. For details on command line options:

loremipsum --help

Example Usage

Generate 3 short paragraphs with trailing new lines and pipe output to placeholder.txt:

loremipsum 3 --length short --trailing-newlines > placeholder.txt

Generate 4 HTML paragraphs and pipe output to placeholder.html:

loremipsum 4 --html > placeholder.html

Copy to Clipboard

This package includes an additional lorem-copy command to generate text and copy it to the clipboard using pyperclip. For details on command line options:

lorem-copy --help

Note: pyperclip should work out of the box on macOS and Windows, but may need some additional packages on Linux distros. Check their documentation first if you’re having difficulty with the lorem-copy command.

For more details, see the documentation.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
py-loremipsum-1.1.0.tar.gz (4.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page