Skip to content

lifters-international/pythonFoodApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

If you have not done so, please create an api account at the following: https://business.lifters.app/food-api

Install the Node js Lifters FoodApi wrapper

  pip install @lifters-international/python-foodapi

Once imported you can start using the wrapper like so

  from FoodApi import FoodApi
  
  foodApi = new FoodApi("{FOOD_API_TOKEN}");

Functions & Uses:

    foodApi.verifyApiKey( throwError: boolean = false ) # Checks if the api_key provided is valid. And throws error if it is not.
  
    foodApi.getAllFood( limit?: number ) # Returns all food from Lifters Food Database, if a limit is given that limit on Food is returned.
  
   foodApi.searchFoodByName( name: string, limit?: number ) # Returns list of food in database with similar name.
  
   foodApi.getFoodByCategory( categories: FoodCategories, limit?: number ) # Returns list of food in database that meets one or all category.
  
   foodApi.getFoodById( id : string ) #Returns food with the given id.

Important Types:

FoodCategories:

class FoodCategories(NS):
    calories: Optional[int]
    
    totalFat: Optional[int]
    
    saturatedFat: Optional[int]
    
    transFat: Optional[int]
    
    cholesterol: Optional[int]
    
    sodium: Optional[int]
    
    totalCarbohydrate: Optional[int]
    
    dietaryFiber: Optional[int]
    
    totalSugars: Optional[int]
    
    addedSugars: Optional[int]
    
    protein: Optional[int]
    
    vitaminD: Optional[int]
    
    calcium: Optional[int]
    
    iron: Optional[int]
    
    potassium: Optional[int]

Food:

class Food(NS):
    id: str
    
    name: str
    
    calories: int
    
    servingSize: NutritionFactsJson
    
    nutritionFacts: NutritionFacts
    
    adminCreated: bool

About

Python FoodApi Wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages