Giter Site home page Giter Site logo

pet-food-advice-api's Introduction

Dog Food Recommendation Azure Function

This project contains an Azure Function that provides dog food recommendations based on a dog's breed, weight, age, and health conditions. The function is accessible via an HTTP POST request which expects a json and returns a list of recommended dog food options.

Features

  • POST Endpoint: recommendation/dogs to get dog food recommendations.

  • Input Parameters: Breed, Animal Weight, Age, Health Conditions.

    // Input Example
    {
      "breed": "German Shepherd",
      "animalWeight": 30,
      "age": 5,
      "conditions": ["Joint Care", "Food Allergy"]
    }
  • Output: A list of recommended dog foods based on the input criteria.

// Output Example
[
  {
    "name": "Royal Canin® Breed Health Nutrition® German Shepherd Adult Dry Dog Food",
    "brand": "Royal Canin",
    "price": 122.99,
    "calories": 327
  },
  {
    "name": "Blue Buffalo® Basics™ Small Breed Adult Dry Dog Food - Natural, Turkey",
    "brand": "Blue Buffalo",
    "price": 30.99,
    "calories": 453
  },
  {
    "name": "Royal Canin® Size Health Nutrition Large Adult 5+ Dry Dog Food",
    "brand": "Royal Canin",
    "price": 122.99,
    "calories": 414
  }
]

Getting Started

Running Locally

  1. Clone the repository to your local machine.
  2. Navigate to the project directory.
  3. Create a new virtual environment:
python -m venv .venv
  1. Activate the virtual environment:
# Windows
.venv\Scripts\activate

# Linux / MacOS
source .venv/bin/activate
  1. Install the dependencies:
pip install -r requirements.txt
  1. Start the function locally by running:
func start
  1. The function will be available at http://localhost:7071/api/recommendation/dogs.

Testing the Function

You can test the function using this CURL command:

curl -X POST http://localhost:7071/api/recommendation/dogs \
-H "Content-Type: application/json" \
-d '{"breed": "German Shepherd", "animalWeight": 30, "age": 5, "conditions": ["Joint Care", "Food Allergy"]}'

pet-food-advice-api's People

Contributors

clarabatt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.