Pattern Generator is a web application that creates customized patterns for various use cases including testing, education, and creative projects. The tool allows users to generate patterns with different complexity levels and character sets, outputting the results in a visually appealing PDF format with random placement and colorful text.
- Customizable Pattern Generation: Control pattern complexity with adjustable difficulty levels
- Character Set Selection: Use digits, letters, or custom character sets for pattern creation
- Multiple Pattern Generation: Create several different patterns in a single PDF document
- Beautiful Output: Colorful, visually appealing PDF output with rainbow-colored text
- Flexible Rendering Options: Supports WeasyPrint (emoji-friendly) and ReportLab PDF backends
Proof of Concept (ptgen.pythonanywhere.com)
- Python 3.7+
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/thegoodduck/Pattern_Generator.git
cd Pattern_Generator- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install flask weasyprint reportlab- Start the Flask server:
python main.py- Open your web browser and navigate to:
http://127.0.0.1:5000
- Set your desired Difficulty Level (higher values create more complex patterns)
- Enter a Character Set (digits for numeric patterns, any characters for text patterns)
- Optionally add additional patterns using the "Add Another Pattern" button
- Click "Generate PDF" to create and download your custom pattern document
- Difficulty: 5
- Character Set: 0123456789
- Result: A pattern using random digits with mathematical operations applied
- Difficulty: 3
- Character Set: ABCDEF
- Result: A repeating sequence of randomly selected letters
The application uses three different algorithms to generate patterns:
- Simple Repetition: Repeats a randomly generated character sequence
- Selective Digit Modification: Applies mathematical operations to specific positions in a sequence
- Full Sequence Transformation: Applies operations to every character in a sequence
The application supports two PDF generation backends:
# In main.py:
USE_WEASYPRINT = True # Set to False to use ReportLab instead- WeasyPrint: Better support for emoji and complex characters
- ReportLab: More lightweight, fewer dependencies
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by @thegoodduck
⭐ Star this repository if you find it useful! ⭐