Spaces:
Sleeping
Sleeping
metadata
title: Quotes
emoji: 🐨
colorFrom: pink
colorTo: green
sdk: docker
pinned: false
short_description: Quotes API Space
Quotes API Space
This Hugging Face Space provides an API to fetch 50 random quotes from the jstet/quotes-500k dataset.
Usage
Send a GET request to /api/quotes to retrieve 50 random quotes. Example response:
{
"quotes": [
{"quote": "Life is what happens when you're busy making other plans.", "author": "John Lennon", "category": "Life"},
...
]
}
Setup
This Space uses the Docker Space SDK with Python, FastAPI, and the Hugging Face datasets library. The configuration is defined in the following files:
Dockerfile: Defines the Docker image.requirements.txt: Lists Python dependencies.app.py: Contains the FastAPI application code.
Deployment
To deploy this Space on Hugging Face:
- Create a new Space on Hugging Face, selecting the Docker template.
- Upload the
Dockerfile,requirements.txt,app.py, andREADME.mdfiles to the Space repository. - Configure the Space to use the Docker Space SDK.
- Build and deploy the Space.
The Space will be available at https://<your-username>-<space-name>.hf.space/api/quotes.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference