Lorem Text Generator

0.1.1 · maintenance · verified Sat Apr 11

The `lorem` library (version 0.1.1) is a lightweight Python package designed to generate random text that resembles Latin, commonly known as 'Lorem Ipsum'. It provides simple functions for generating words, sentences, and paragraphs, as well as a more configurable class for advanced text generation. The project has not seen updates since 2016, indicating a stable but inactive development cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates both the direct utility functions for basic Lorem Ipsum generation and the `TextLorem` class for more customized output, such as specific word separators or sentence length ranges.

import lorem
from lorem.text import TextLorem

# Simple usage
sentence = lorem.sentence()
paragraph = lorem.paragraph()
text = lorem.text()

print(f"Sentence: {sentence}")
print(f"Paragraph: {paragraph}")
print(f"Text (multiple paragraphs): {text}")

# Complex usage with TextLorem for custom generation
custom_lorem = TextLorem(wsep='-', srange=(2,3), words="alpha beta gamma delta".split())
custom_sentence = custom_lorem.sentence()
print(f"Custom sentence: {custom_sentence}")

view raw JSON →