Skip to main content

A lipsum.com API for Python.

Project description

Python-Lipsum-API

Generates Lorem Ipsum from https://www.lipsum.com/

Basic use

One time use
import lipsum

lipsum(mode, amount, start)

modes:

  • words - generate x words
  • paras - generate x paragraphs
  • bytes - generate x characters
  • lists - generate x lists

amount: How much is generated

start: Whether to start section with "Lorem ipsum dolor sit amet"

Repeated use
import lipsum


Lipsum = lipsum.LipsumGen()

Lipsum.amount(x)
Lipsum.start(True)

Lipsum.words()
Lipsum.bytes()
  1. First we create a grabber object LipsumGen
  2. Then we set the amount to be generated using LipsumGen.amount
  3. Set LipsumGen object to start with "Lorem ipsum dolor sit amet"
  4. Now we can generate Lorem Ipsum using the various functions inside our LipsumGen object. See below for various functions:
  • LipsumGen.words()
  • LipsumGen.paras()
  • LipsumGen.bytes()
  • LipsumGen.lists()

Note: you can set the amount when calling these functions LipsumGen.words(100)

Examples

Generate 100 characters of text:

import lipsum

lipsum.byte(100)

Generate 3 paragraphs the first of which starts with "Lorem ipsum dolor sit amet":

import lipsum

lipsum.paras(100, True)

Generate 10 sets of Loren Ipsum of Increasing size

import lipsum

Lipsum = lipsum.LipsumGen()
Lipsum.amount = 500

output = []

for i in range(10):
    Lipsum.amount *= 2
    output.append(Lipsum.bytes())

Latest Changes

  • Initial release

for full changelog click here

TODO

  • CLI
    • text output
    • file IO
  • GUI
    • visual output
    • file IO

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

lipsumAPI-1.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

lipsumAPI-1.1-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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