A pure Python library for fill-in-the-blank word games.
Project description
fill-the-blanks-lib
A lightweight, pure-Python library to easily build and run interactive fill-in-the-blanks (Mad Libs style) word games. It requires no external dependencies.
Installation
You can install the library directly from PyPI using pip:
pip install fill-the-blanks-lib
Quick Start / Usage
Since the package name is long, we highly recommend importing it using the shorthand alias ftb in your projects.
Example for 1 Word Substitution (madlibs_1x):
import fill_the_blanks_lib as ftb
Define your prompt and the output template containing {entered}
prompt = "Enter a funny noun: " template = "The quick brown fox jumps over the lazy {entered1}."
Run the function
ftb.madlibs_1x(prompt, template)
Supporting Multiple Substitutions (Up to 10x):
The library scales according to your story needs. If you have 3 slots to fill, simply use madlibs_3x:
import fill_the_blanks_lib as ftb
prompt1 = "Enter a name: " template1 = "Hello {entered1},"
prompt2 = "Enter an adjective: " template2 = "Today is a {entered2} day."
prompt3 = "Enter a place: " template3 = "Welcome to {entered3}!"
Executes all 3 prompts sequentially and prints the results
ftb.madlibs_3x(prompt1, template1, prompt2, template2, prompt3, template3)
Available Functions
- madlibs_1x(...) up to madlibs_10x(...)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fill_the_blanks_lib-1.0.0.tar.gz.
File metadata
- Download URL: fill_the_blanks_lib-1.0.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
948bd470cf3f80d000375adda5d3d7b430e1599f8047df1f3a39d968f24bbc09
|
|
| MD5 |
b379caadb03c24edcd3f0315f460f4d7
|
|
| BLAKE2b-256 |
17cf6d4dc353cd45a1a50d770127076e786ebc3034f4c9a3ec2d92fca04286f9
|
File details
Details for the file fill_the_blanks_lib-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fill_the_blanks_lib-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5669274389d0b6f41b79b895e661fbc44c77589bc53c7157bc76b7b0d9cdc839
|
|
| MD5 |
58a26e092a197b34a06a094479dcba8c
|
|
| BLAKE2b-256 |
d0ba8fd3413c95557a24951c5f31b32ee7d6007e6e5b1c3a4542ff348a046a52
|