Skip to content
Python module for generating placeholder text using the https://loripsum.net/ API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
.gitignore
LICENSE
MANIFEST.in
README.rst
VERSION
loremipsum.py
setup.py
update-gh-pages.sh
update-pypi.sh

README.rst

Lorem Ipsum Generator

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.

You can’t perform that action at this time.