Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

🎭 Theme-Based Random Poem Generator

Overview

Theme-Based Poem Generator is a Python script that fetches poems from the PoetryDB API based on a user-provided theme or keyword.
Simply type a word or concept (e.g., love, rain, night) and get a beautifully formatted poem in your terminal.


Features

  • 🔎 Fetch poems by keyword or theme.
  • 🎲 Randomly selects a poem if multiple matches exist.
  • 📜 Displays title, author, and lines.
  • 🐍 Built in Python 3 using requests.
  • 🌐 No local word lists required — poems are fetched live from the API.

Requirements

  • Python 3.7+
  • requests library

Install dependencies:

pip install requests

1.Clone the repository:

git clone https://github.com/<your-username>/<repo-name>.git
cd <repo-name>

2.Run the script:

python random_poem_generator.py

3.Enter a theme or keyword when prompted:

Enter a theme or keyword (e.g. love, rain, night): rain

Enjoy the poem!