Vargen is a tool for generating all possible combinations of text from templates that include placeholders in brackets. It's designed for tasks that require multiple versions of a text, simplifying the process with an intuitive bracket notation.
- Automated Variations: Generates every possible combination from text templates.
- Bracket Placeholders: Easy-to-use notation for placeholders
[option1|option2]
. - Command-line Use: Simple CLI execution with customizable options.
- Efficient Processing: Controls for batch size and memory usage optimize performance.
- Open Source Licensing: Available under MIT and CC BY 4.0 licenses for wide use and adaptation.
Vargen utilizes Python's standard libraries re
for regular expressions and concurrent.futures
for parallel execution, requiring no additional installations beyond Python itself.
- Python 3.6 or newer.
Clone the repository and you're ready to go. Vargen runs directly from the source.
git clone https://github.com/Symonovskyi/Vargen.git
Run Vargen directly from the command line, adjusting parameters as needed for your task.
python vargen.py [options]
append
: Append to output file (true
orfalse
).separator
: Separator string between text variations.input_filename
: Path to your input file.output_filename
: Path to your output file.
Basic Usage
Generate variations with default settings:
python vargen.py
Appending to Output with a Separator
Append to the output file, separating batches with "---":
python vargen.py append=true separator="---"
Using Custom Input and Output Files
Specify custom input and output files:
python vargen.py input_filename="my_input.txt" output_filename="my_output.txt"
Full Command with All Options
Append to a custom output file with a separator, using a custom input file:
python vargen.py append=true separator="-----" input_filename="custom_input.txt" output_filename="custom_output.txt"
Positional Arguments for Quick Configuration
Enable performance analysis, append mode, and set a separator, with custom file names:
python vargen.py true true "-----" custom_input.txt custom_output.txt
Default Function Call
Invoke generate_variations
with default parameters from within Python code:
from vargen import generate_variations
generate_variations()
Custom Configuration
Invoke generate_variations
with custom settings:
from vargen import generate_variations
generate_variations(append=True, separator="---", input_filename="input.txt", output_filename="output.txt")
Vargen is distributed under a dual-license: MIT License and Creative Commons Attribution 4.0 International (CC BY 4.0). By using, copying, modifying, or distributing the project, you agree to the terms of both licenses. You must credit the authorship as per CC BY requirements while also adhering to the freedom of use provided under the MIT License.
- Ensure the input file exists and is readable, and the output file is writable.
- Default values are applied for any unspecified parameters.
- The documentation within the code files provides detailed descriptions of each function's purpose and usage.