https://github.com/thegoodduck/pattern_generator
Pattern Generator
https://github.com/thegoodduck/pattern_generator
algorithm generator noai notai pattern
Last synced: 4 months ago
JSON representation
Pattern Generator
- Host: GitHub
- URL: https://github.com/thegoodduck/pattern_generator
- Owner: thegoodduck
- License: mit
- Created: 2025-03-30T22:42:15.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-24T00:18:21.000Z (6 months ago)
- Last Synced: 2025-05-12T19:15:38.741Z (6 months ago)
- Topics: algorithm, generator, noai, notai, pattern
- Language: Python
- Homepage: https://ptgen.pythonanywhere.com
- Size: 9.26 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Pattern Generator
## ๐ Overview
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.
### ๐ฏ Key Features
- **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)](https://ptgen.pythonanywhere.com)
## ๐ Installation
### Prerequisites
- Python 3.7+
- pip (Python package manager)
### Setup
1. Clone the repository:
```bash
git clone https://github.com/thegoodduck/Pattern_Generator.git
cd Pattern_Generator
```
2. Create a virtual environment (recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install flask weasyprint reportlab
```
## ๐ป Usage
### Running the Application
1. Start the Flask server:
```bash
python main.py
```
2. Open your web browser and navigate to:
```
http://127.0.0.1:5000
```
### Creating Patterns
1. Set your desired **Difficulty Level** (higher values create more complex patterns)
2. Enter a **Character Set** (digits for numeric patterns, any characters for text patterns)
3. Optionally add additional patterns using the "Add Another Pattern" button
4. Click "Generate PDF" to create and download your custom pattern document
### Examples
#### Numeric Pattern
- **Difficulty**: 5
- **Character Set**: 0123456789
- **Result**: A pattern using random digits with mathematical operations applied
#### Text Pattern
- **Difficulty**: 3
- **Character Set**: ABCDEF
- **Result**: A repeating sequence of randomly selected letters
## โ๏ธ Pattern Generation Algorithms
The application uses three different algorithms to generate patterns:
1. **Simple Repetition**: Repeats a randomly generated character sequence
2. **Selective Digit Modification**: Applies mathematical operations to specific positions in a sequence
3. **Full Sequence Transformation**: Applies operations to every character in a sequence
## ๐ง Customization
### PDF Backend Selection
The application supports two PDF generation backends:
```python
# 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
## ๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
## ๐ค Author
Made with โค๏ธ by [@thegoodduck](https://github.com/thegoodduck)
---