PyPoetryDB is a Python library for interacting with the PoetryDB API. It allows you to fetch information about authors, titles, and poems from the PoetryDB database.
- List all authors available in the PoetryDB.
- List all poem titles available in the PoetryDB.
- Fetch poems by a specific author.
- Fetch a specific poem by its title.
To install PyPoetryDB from github, you can use pip:
!pip install -e git+https://github.com/roicort/PyPoetryDB.git#egg=PyPoetryDBor clone the repository and install it locally:
pip install -e .# Import the PoetryDB class from the poetrydb module
from PyPoetryDB import PoetryDB
# Create an instance of the PoetryDB class
poetrydb = PoetryDB.API()
# List all authors available in the PoetryDB
authors = poetrydb.list_authors()
print(authors)
# List all poem titles available in the PoetryDB
titles = poetrydb.list_titles()
print(titles)
# Fetch poems by a specific author
poems_by_author = poetrydb.list_author_titles('Edgar Allan Poe')
print(poems_by_author)
# Fetch a specific poem by its title
poem = poetrydb.get_poem('The Raven')
print(poem)This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.