A Python library for generating Lorem Ipsum text.
Project description
About • Features • Layout • How to Run • Technologies • Contribute • License • Contributors
💻 About the project
The pyloremgen
library is a Python package designed to easily generate Lorem Ipsum text and create PDFs with Lorem Ipsum content. Lorem Ipsum is placeholder text commonly used in the printing and typesetting industry.
⚙️ Features
-
Lorem Ipsum Paragraphs: Generate Lorem Ipsum paragraphs effortlessly with the
paragraphs
method. -
Random Words Generation: Create a string of random words using the
words
method, allowing customization of the number of words. -
Shopping List Generation: Quickly generate a shopping list with randomly selected items using the
shopping_list
method. -
PDF Generation: Create PDF documents with Lorem Ipsum content using the
PDFGenerator
class. You can specify the number of pages and choose whether to include a cover page.
🎨 Layout
🚀 How to run the project
Installation
To use the pyloremgen
library, you first need to install it. You can install it using pip:
pip install pyloremgen
Usage
Using LoremIpsum
for Text Generation
Import the LoremIpsum
class and create an instance:
from pyloremgen.generator.lorem_text import LoremIpsum
lorem_generator = LoremIpsum()
Generating Paragraphs
To generate Lorem Ipsum paragraphs, use the paragraphs
method:
lorem_paragraphs = lorem_generator.paragraphs(paragraphs_numbers=3, size="medium", start_with_lorem_ipsum=True)
print(lorem_paragraphs)
This will generate three Lorem Ipsum paragraphs, starting with the default "Lorem ipsum" text.
Generating Words
To generate a string of random words, use the words
method:
lorem_words = lorem_generator.words(words_numbers=50)
print(lorem_words)
This will generate a string containing 50 random words.
Generating a Shopping List
To generate a shopping list of randomly selected items, use the shopping_list
method:
shopping_list = lorem_generator.shopping_list(items_count=5)
print(shopping_list)
This will generate a shopping list with 5 randomly selected items.
Using PDFGenerator
for PDF Generation
Import the PDFGenerator
class and create an instance:
from pyloremgen.generator.lorem_pdf import PDFGenerator
pdf_generator = PDFGenerator()
Generating a PDF
To generate a PDF document, use the generate_pdf
method:
pdf_generator.generate_pdf(filename="example.pdf", num_pages=5, cover_page_count=True)
This will create a PDF named example.pdf
with 5 pages, including a cover page.
Examples
Here are some additional examples:
# Example 1: Generating 2 paragraphs without starting with "Lorem ipsum"
lorem_text = lorem_generator.paragraphs(paragraphs_numbers=2, start_with_lorem_ipsum=False)
# Example 2: Generating a string of 20 random words
random_words = lorem_generator.words(words_numbers=20)
# Example 3: Generating a shopping list with 3 items
shopping_items = lorem_generator.shopping_list(items_count=3)
# Example 4: Generating a PDF with 3 pages and no cover page
pdf_generator.generate_pdf(filename="sample.pdf", num_pages=3, cover_page_count=False)
Feel free to customize the parameters based on your needs.
🛠 Technologies
- Python
reportlab
(for PDF generation)pyloremgen
(for Lorem Ipsum text generation)
Contribution ✨
Help the community make this project even more amazing. Read how to contribute by clicking here. I am convinced that together we will achieve incredible things!
📝 License
This project is licensed under the MIT License.
👨💻 Contributors
💜 A big thanks 👏 to these folks who brought this project from the realm of ideas to execution!
Vitório Cavaleheiro 👨🚀 |
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
Built Distribution
File details
Details for the file pyloremgen-2.0.0.tar.gz
.
File metadata
- Download URL: pyloremgen-2.0.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e59d71f8b74a6ab12973ba2b0cc12ec93ff1085b9af8d006a27e68b21588970 |
|
MD5 | 8055cf943fe6c9f2b883232d364ae643 |
|
BLAKE2b-256 | 8696ee15625807837cc205d214f0cd47720e739395bd9085d0670ec1dca009b2 |
File details
Details for the file pyloremGen-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: pyloremGen-2.0.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c995ef468f0e6d5e50a49b7cf06e99fec16b47da7e3ba1e87693fb56e1b4c579 |
|
MD5 | 3eec629c423fdd5b60cc761526f2e087 |
|
BLAKE2b-256 | c2261c62683ece5ce741fc2f651555c96ede832d4196fa6c92a14112cd192c98 |