Spaces:
Runtime error
Runtime error
Commit ·
73f5fe7
1
Parent(s): efaf63e
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
|
| 3 |
+
app = FastAPI(docs_url="/")
|
| 4 |
+
|
| 5 |
+
@app.get("/dog-range")
|
| 6 |
+
def dog_info_endpoint(breed: str):
|
| 7 |
+
breed_info = {
|
| 8 |
+
"Australian Shepherd": {"weight": "40-65 lbs", "height": "18-23 inches"},
|
| 9 |
+
"Basset Hound": {"weight": "40-65 lbs", "height": "14-15 inches"},
|
| 10 |
+
"Bernedoodles": {"weight": "70-90 lbs", "height": "23-29 inches"},
|
| 11 |
+
"Bichon Frise": {"weight": "10-18 lbs", "height": "9.5-11.5 inches"},
|
| 12 |
+
"Boston Terrier": {"weight": "12-25 lbs", "height": "12-17 inches"},
|
| 13 |
+
"Boxer": {"weight": "50-70 lbs", "height": "21-25 inches"},
|
| 14 |
+
"Boykin Spaniel": {"weight": "25-40 lbs", "height": "14-18 inches"},
|
| 15 |
+
"Cairn Terrier": {"weight": "13-18 lbs", "height": "9-13 inches"},
|
| 16 |
+
"Cane Corso": {"weight": "90-110 lbs", "height": "23.5-27.5 inches"},
|
| 17 |
+
"Catahoula Leopards": {"weight": "50-95 lbs", "height": "20-26 inches"},
|
| 18 |
+
"Chihuahua": {"weight": "2-6 lbs", "height": "5-8 inches"},
|
| 19 |
+
"Corgi": {"weight": "25-30 lbs", "height": "10-12 inches"},
|
| 20 |
+
"Dachshund": {"weight": "11-32 lbs", "height": "8-9 inches"},
|
| 21 |
+
"Doberman Pinscher": {"weight": "60-100 lbs", "height": "24-28 inches"},
|
| 22 |
+
"French Bulldog": {"weight": "16-28 lbs", "height": "11-12 inches"},
|
| 23 |
+
"German Shepherd": {"weight": "50-90 lbs", "height": "22-26 inches"},
|
| 24 |
+
"Golden Retriever": {"weight": "55-75 lbs", "height": "21.5-24 inches"},
|
| 25 |
+
"Goldendoodle": {"weight": "50-90 lbs", "height": "20-24 inches"},
|
| 26 |
+
"Havanese": {"weight": "7-13 lbs", "height": "8.5-11.5 inches"},
|
| 27 |
+
"Jack Russels": {"weight": "14-18 lbs", "height": "10-12 inches"},
|
| 28 |
+
"Labradoodle": {"weight": "50-65 lbs", "height": "21-24 inches"},
|
| 29 |
+
"Labrador Retrievers": {"weight": "55-80 lbs", "height": "21.5-24.5 inches"},
|
| 30 |
+
"Maltese": {"weight": "4-7 lbs", "height": "7-9 inches"},
|
| 31 |
+
"Miniature Schnauzer": {"weight": "11-20 lbs", "height": "12-14 inches"},
|
| 32 |
+
"Pitbull": {"weight": "30-85 lbs", "height": "17-21 inches"},
|
| 33 |
+
"Pomeranian": {"weight": "3-7 lbs", "height": "7-12 inches"},
|
| 34 |
+
"Rottweiler": {"weight": "80-135 lbs", "height": "22-27 inches"},
|
| 35 |
+
"Shiba Inu": {"weight": "17-23 lbs", "height": "13.5-16.5 inches"},
|
| 36 |
+
"Siberian Husky": {"weight": "35-60 lbs", "height": "20-23.5 inches"},
|
| 37 |
+
"Weimaraners": {"weight": "55-90 lbs", "height": "23-27 inches"},
|
| 38 |
+
"Vizsla": {"weight": "40-65 lbs", "height": "21-24 inches"},
|
| 39 |
+
"Yorkie": {"weight": "4-7 lbs", "height": "7-8 inches"}
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if breed in breed_info:
|
| 43 |
+
return breed_info[breed]
|
| 44 |
+
else:
|
| 45 |
+
return {"error": "Breed information not available."}
|