A Lorem Ipsum text generator¶
version: | 2.0.0b2 |
---|---|
author: | Luca De Vitis <luca@monkeython.com> |
contact: | http://www.monkeython.com |
copyright: | 2014, Luca De Vitis <luca@monkeython.com> |
Copyright (c) 2014, Luca De Vitis All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Overview¶

The purpose of this package is to generate random (plausible) text sentences and pargraphs based on a lexicon, a sample text, and a list of characted used as word or sentence delimiters. By default this package will generate Lorem Ipsum style text, but you can customize the generator to effectively load any sample text you like.
You can read more on Pythonhosted or Read the Docs. Since this package has en extensive docstring documentation as well as code comments, you can read more browsing the source code or in the python interactive shell.
History¶
Original code was taken from lorem-ipsum-generator by James Hales. James stated that his package served his purpose and he was not interested in further development, so I took it over.
Changes¶
- 2.0.0b2
- New
Sample
class that handle sample extracting, freezing, copying, as well as loading and dumping from a provided URL. - Now
Generator
class uses aSample
instance to generate text. - New pluggable framework: setted up package can let developers to
get
,set_default
and get allregistered
plugins. - New
loremipsum.samples
pluggable subpackage lets develpers to create and plug their own sample to be used by aGenerator
. - New
loremipsum.serialization
subpackage let developers to load, dump or erase a sample using pluggable set of schemes, content types and encodings.
- New
- 2.0.0-b1
- New API for the
Generator
class: now takes all the needed params from the constructor and no default value is implied. Unlike the previous version, now also wants a list of delimiters for the words and one for the sentences. - No more custom exceptions. Now
Generator
class uses python standardValueError
if the values used in the constructor are wrong. - No more property setters: Now
Generator
objects are “Read-Only”. - New property
incipit
which returns the first sample sentence. - New API for the
Generator.generate_
methods: now developers can override sentences and paragraphs mean and sigma values, as well as fixing their lienght. - New
Generator
methods to generate siply words: generate_word and generate_words - New
loremipsum
functions API to reflects the newGenerator
API. - New
loremipsum
functions to interface with newGenerator
methods: get_word and get_words - New behaviour for get_sentences, get_paragraphs, generate_sentences, generate_paragraphs functions: now return a generator.
- New API for the
- 1.0.5
- Added python3 support: fixes #8
- Added README.rst to MANIFEST.in: fixes #9
- 1.0.4
- Added MANIFEST.in
- Removed dependencies on distribute
- Applied pep8 and pylint suggested cleanup
- 1.0.3
- Fix issue #5
- 1.0.2
- Now is a package: fixes datafiles distribution.
- 1.0.1
- Added support for python 2.5
- 1.0.0
- Added unittests.
- Added documentation.
- Added stats to text generators methods in
Generator
- Added generator methods in
Generator
, for multiple text generations - Added stats-less text generators fuctions to module
- 0.1.0
- First release.