Skip to content

Web API to find keyword specified book details from library collection using the programming language Python and framework Flask along with unit test for the same.

Notifications You must be signed in to change notification settings

AiswaryaLakshmy/Flask-Web-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Flask Web API

Web application with one endpoint that takes a keyword in its URL string, uses it as an input into the NYPL Digital Collections API, and returns the title and link of the books found using the specified keyword in the API using the programming language Python and framework Flask along with the unit test for the same.

Running the Web API

To run the Web API, run the following command

  python app.py

Running Tests

To run tests, run the following command

  python test.py

Sample outputs

1. When url given as http://127.0.0.1:5000/?keyword=cats
{
    "data": [
        {
            "itemLink": "http://digitalcollections.nypl.org/items/b992a521-9c85-2498-e040-e00a18063ad7",
            "title": "Three cats watching fish in an aquarium"
        },
        {
            "itemLink": "http://digitalcollections.nypl.org/items/88b2c083-bb4c-1645-e040-e00a180605dc",
            "title": "[Maeghde Wapen [Maiden's Arms]"
        },
        {
            "itemLink": "http://digitalcollections.nypl.org/items/510d47d9-49f8-a3d9-e040-e00a18064a99",
            "title": "The boy who drew cats"
        }
    ]
}
2. When url gievn as http://127.0.0.1:5000/?keyword=jhjkns
{
    "message": "Data not found using the given keyword: jhjkns"
}
3. When url gievn as http://127.0.0.1:5000/
{
    "message": "Please provide a keyword or enter in url using the format: /?keyword=valid_keyword"
}
4. When url gievn as http://127.0.0.1:5000/cats
{
    "message": "Please provide a keyword or enter in url using the format: /?keyword=valid_keyword"
}

About

Web API to find keyword specified book details from library collection using the programming language Python and framework Flask along with unit test for the same.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages