Git Product home page Git Product logo

petapi's Introduction

petAPI

Steps to use petAPI

Install 'Requirements.txt'

pip install -r requirements.txt

Run Server

uvicorn main:app --reload

Open Local Server / Docs

http://127.0.0.1:8000/docs#/

Data Structure

Key Data Type
pet_age int
breed str
pet_gender bool
pet_name str
address str
owner_age int
contact str
email EmailStr
owner_name str

Call API

/pet/

Method : Get

Description: Get All Pets

Response:

[
  {
    "pet_age": 24,
    "owner_id": "i68jKCQTWKKVyoFoGpQP",
    "breed": "hushky",
    "pet_name": "Rambo",
    "pet_gender": true,
    "pets": [
      "E5slfHamcFg0oTyVk1Pb"
    ],
    "owner_age": 25,
    "email": "[email protected]",
    "owner_name": "owner1_name",
    "address": "address1",
    "contact": "9898656532"
  },
  {
    "breed": "pub",
    "pet_age": 21,
    "owner_id": "lo0xoZsBY80z203WCE8Q",
    "pet_gender": true,
    "pet_name": "rocky",
    "pets": [
      "VmAc5CE7CrtV1nxVNUp3"
    ],
    "owner_age": 13,
    "email": "[email protected]",
    "owner_name": "Kartik",
    "address": "fsdfihsdif",
    "contact": "9854545452"
  }
]

/pet/{pet_id}

Method: Get

Description: Get specific pet's detail

Response:

{
  "breed": "hushky",
  "owner_id": "i68jKCQTWKKVyoFoGpQP",
  "pet_name": "Rambo",
  "pet_age": 24,
  "pet_gender": true,
  "pets": [
    "E5slfHamcFg0oTyVk1Pb"
  ],
  "owner_age": 25,
  "email": "[email protected]",
  "owner_name": "owner1_name",
  "address": "address1",
  "contact": "9898656532"
}

/pet/{pet_id}

Method: Put

Description: Edit Pet Details

Request Body:

Note: Enter only values you what to edit. Don't change owner_id

{
  "pet_age": 0,
  "breed": "string",
  "pet_gender": true,
  "pet_name": "string"
}

Response:

null

/pet/{pet_id}

Method: Delete

Description: Delete Pet

Response:

null

/pet/{owner_id}

Method: Post

Description: Add Pet

Request Body:

Note: Don't change owner_id

{
  "pet_age": 0,
  "breed": "string",
  "pet_gender": true,
  "pet_name": "string"
}

Response:

null

/owner/

Method: Get

Description: Get All Owners' Details

Response:

[
  {
    "owner_age": 25,
    "email": "[email protected]",
    "contact": "9898656532",
    "owner_name": "owner1_name",
    "address": "address1",
    "owner_id": "i68jKCQTWKKVyoFoGpQP",
    "pets_data": [
      {
        "pet_age": 24,
        "pet_gender": true,
        "pet_name": "Rambo",
        "breed": "hushky",
        "pet_id": "E5slfHamcFg0oTyVk1Pb"
      }
    ]
  },
  {
    "owner_age": 13,
    "owner_name": "Kartik",
    "contact": "9854545452",
    "address": "fsdfihsdif",
    "email": "[email protected]",
    "owner_id": "lo0xoZsBY80z203WCE8Q",
    "pets_data": [
      {
        "breed": "pub",
        "pet_age": 21,
        "pet_gender": true,
        "pet_name": "rocky",
        "pet_id": "VmAc5CE7CrtV1nxVNUp3"
      }
    ]
  }
]

/owner/

Method: Post

Description: Add New Ownwer

Request Body:

{
  "address": "string",
  "owner_age": 0,
  "contact": "string",
  "email": "[email protected]",
  "owner_name": "string",
  "pets": []
}

Response:

null

/owner/{owner_id}

Method: Get

Description: Get Owner's Pets

Response:

[
 {
   "breed": "hushky",
   "owner_id": "i68jKCQTWKKVyoFoGpQP",
   "pet_name": "Rambo",
   "pet_gender": true,
   "pet_age": 24,
   "pet_id": "E5slfHamcFg0oTyVk1Pb"
 }
]

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.