Expand prompt matrix strings
Project description
Prompt Matrix
A Python package to expand prompt matrix strings, e.g. the string "The <dog|cat> in the hat"
expands to the list ["The dog in the hat", "The cat in the hat"]
.
import prompt_matrix
prompt_matrix.expand("The <dog|cat> in the <cardigan|hat>")
["The dog in the cardigan",
"The dog in the hat",
"The cat in the cardigan",
"The cat in the hat"]
prompt_matrix.expand("The <<small|large> <brown|black> dog|<red|blue> fish>")
["The small brown dog",
"The small black dog",
"The large brown dog",
"The large black dog",
"The red fish",
"The blue fish"]
prompt_matrix.expand("The {dog,cat} in the {cardigan,hat}", brackets=['{', '}'], alt=',')
["The dog in the cardigan",
"The dog in the hat",
"The cat in the cardigan",
"The cat in the hat"]
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prompt_matrix-0.1.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for prompt_matrix-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b17731c812940d9b028e5d0c294758afcbc6537a9b501c4de3ea72c7a3a170 |
|
MD5 | b4af49643ec7ff12e87ce749756b72ab |
|
BLAKE2b-256 | 51065bb15153d755a3d089b600e24d88d2de0a0ec0dc188089783d61373c7847 |