Skip to main content

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.

Source Distribution

py-loremipsum-1.1.0.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file py-loremipsum-1.1.0.tar.gz.

File metadata

  • Download URL: py-loremipsum-1.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/38.5.2 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.4

File hashes

Hashes for py-loremipsum-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2c958732343c6e1062f428a2fd7237b2d3cfaba8e0bd899e6a9e9358f103e30c
MD5 4014ffbcf0775b85dc195fbcc097accb
BLAKE2b-256 e1ded0df5d4e57b5564bcbdc9e91849f1b5f808d4f4c0825de8e00d4d099c943

See more details on using hashes here.

Supported by

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