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()
- First we create a grabber object
LipsumGen
- Then we set the amount to be generated using
LipsumGen.amount
- Set
LipsumGen
object to start with "Lorem ipsum dolor sit amet" - 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
Release history Release notifications | RSS feed
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)