Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
09827a9
Generated code by SwaggerHub
pmerrill Jan 18, 2020
d2c0070
Generated code by SwaggerHub
pmerrill Jan 18, 2020
3935128
Generated code by SwaggerHub
pmerrill Jan 18, 2020
2f75640
Generated code by SwaggerHub
pmerrill Jan 18, 2020
c64e6b0
Generated code by SwaggerHub
pmerrill Jan 20, 2020
177c857
Generated code by SwaggerHub
pmerrill Jan 21, 2020
995b667
Generated code by SwaggerHub
pmerrill Jan 21, 2020
d5ff2fa
Generated code by SwaggerHub
pmerrill Jan 21, 2020
31d072b
Generated code by SwaggerHub
pmerrill Jan 22, 2020
a5a63e0
Generated code by SwaggerHub
pmerrill Jan 22, 2020
370d7e3
Generated code by SwaggerHub
pmerrill Jan 22, 2020
6952910
Generated code by SwaggerHub
pmerrill Jan 22, 2020
c7d710b
Generated code by SwaggerHub
pmerrill Jan 22, 2020
74ffc9f
Generated code by SwaggerHub
pmerrill Jan 22, 2020
a01a692
Generated code by SwaggerHub
pmerrill Jan 22, 2020
b3e48cd
Generated code by SwaggerHub
pmerrill Jan 23, 2020
e39d077
Removed files managed by codegen
Jan 23, 2020
e2c5c71
Generated code by SwaggerHub
pmerrill Jan 23, 2020
70c17b3
Generated code by SwaggerHub
pmerrill Jan 23, 2020
475f59a
Removed files managed by codegen
Jan 23, 2020
1f21dcf
Generated code by SwaggerHub
pmerrill Jan 23, 2020
d800ea8
Removed files managed by codegen
Jan 23, 2020
1f433d0
Generated code by SwaggerHub
pmerrill Jan 23, 2020
a86fe4d
Generated code by SwaggerHub
pmerrill Jan 23, 2020
c1157c4
Generated code by SwaggerHub
pmerrill Jan 24, 2020
2fa375d
Generated code by SwaggerHub
pmerrill Jan 24, 2020
dc23758
Generated code by SwaggerHub
pmerrill Jan 24, 2020
1990c46
Generated code by SwaggerHub
pmerrill Jan 25, 2020
1a6a1f0
Generated code by SwaggerHub
pmerrill Jan 27, 2020
df700c2
Generated code by SwaggerHub
pmerrill Jan 27, 2020
d4a3454
Generated code by SwaggerHub
pmerrill Jan 27, 2020
12d7c5d
Generated code by SwaggerHub
pmerrill Jan 28, 2020
5ab5fd0
Generated code by SwaggerHub
pmerrill Jan 28, 2020
c4d4a70
Generated code by SwaggerHub
pmerrill Jan 28, 2020
0396828
Generated code by SwaggerHub
pmerrill Jan 28, 2020
7b9ef0c
Generated code by SwaggerHub
pmerrill Jan 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
entry_points={
'console_scripts': ['swagger_server=swagger_server.__main__:main']},
long_description="""\
__Important:__ - An __[API key](https://chompthis.com/api/)__ is required for access to this API. - Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__. ----- __Getting Started:__ - __[Subscribe](https://chompthis.com/api/#pricing)__ to the API. - Scroll down and click the \"__Authorize__\" button. - Enter your API key into the \"__value__\" input, click the \"__Authorize__\" button, then click the \"__Close__\" button. - Scroll down to the section titled \"__default__\" and click on the API endpoint you wish to use. - Click the \"__Try it out__\" button. - Enter the information the endpoint requires. - Click the \"__Execute__\" button. __Example:__ - __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/response-object.json)__ API response object. ----- __How Do I Find My API Key?__ - Your API key was sent to the email address you used to create your subscription. - You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__. - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__ for more information._ ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | |
## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**. ### Getting Started * **[Subscribe](https://chompthis.com/api/#pricing)** to the API. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** * Error response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/error-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ### Helpful Links * **Help & Support** * [Knowledge Base »](https://desk.zoho.com/portal/chompthis/kb/chomp) * [Support »](https://chompthis.com/api/ticket-new.php) * [Client Center »](https://chompthis.com/api/manage.php) * **Pricing** * [Subscription Options »](https://chompthis.com/api/) * [Cost Calculator »](https://chompthis.com/api/cost-calculator.php) * **Guidelines** * [Terms & License »](https://chompthis.com/api/terms.php) * [Attribution »](https://chompthis.com/api/docs/attribution.php)
"""
)
73 changes: 28 additions & 45 deletions swagger_server/controllers/default_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,27 @@
def food_branded_barcode_php_get(code): # noqa: E501
"""Get a branded food item using a barcode

# Get data for a branded food using the food's UPC/EAN barcode. __Example:__ ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE``` # noqa: E501
## Get data for a branded food using the food's UPC/EAN barcode. **Example** > ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE``` **Tips** * Read our **[Knowledge Base article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do)** for helpful tips and tricks. # noqa: E501

:param code: UPC/EAN barcode __Example:__ 0842234000988 __Resources:__ [Database search](https://chompthis.com/api/lookup.php) _Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do) for tips and tricks._
:param code: #### UPC/EAN barcode **Example** > ```&code=0842234000988```
:type code: str

:rtype: BrandedFoodObject
"""
return 'do some magic!'


def food_branded_id_php_get(id, source=None): # noqa: E501
"""Get a branded food item using an ID number

# Get data for a branded food using Chomp's internal ID number. _Alternatively, set the \"source\" parameter to \"USDA\" and use the food's FDC ID._ __Example:__ ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` # noqa: E501

:param id: Chomp branded food ID. _Set \"source=USDA\" if you wish to pass in the food's FoodData Central ID (fdc_id)._ __Example #1:__ 15 __Resources:__ [Find branded food IDs](https://chompthis.com/api/lookup.php)
:type id: int
:param source: Specify the data source (optional). You must pass in \"USDA\" if you want to look up a food item using a USDA FDC ID. __Example:__ USDA _(defaults to \"Chomp\")_
:type source: str

:rtype: BrandedFoodObject
"""
return 'do some magic!'


def food_branded_name_php_get(name, limit=None): # noqa: E501
def food_branded_name_php_get(name, limit=None, page=None): # noqa: E501
"""Get a branded food item by name

# Search for branded food items by name. __Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` # noqa: E501
## Search for branded food items by name. **Example** > ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` **Tips** * Get started by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501

:param name: Branded food name __Example:__ Starburst __Resources:__ [Find branded food names](https://chompthis.com/api/lookup.php)
:param name: #### Search for branded food items using a general food name keyword. This does not have to exactly match the \"official\" name for the food. **Example** > ```&name=Starburst```
:type name: str
:param limit: Set maximum number of records you want the API to return. ___Note:__ The maximum value is 10._ __Example:__ 3 _(defaults to 10)_
:param limit: #### Set maximum number of records you want the API to return. The default value is \"**10**.\" **Example** > ```&limit=10```
:type limit: int
:param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. The default value is \"**1**.\" **Example** > ```&page=1```
:type page: int

:rtype: BrandedFoodObject
"""
Expand All @@ -52,54 +39,50 @@ def food_branded_name_php_get(name, limit=None): # noqa: E501
def food_branded_search_php_get(allergen=None, brand=None, category=None, country=None, diet=None, ingredient=None, keyword=None, mineral=None, nutrient=None, palm_oil=None, trace=None, vitamin=None, limit=None, page=None): # noqa: E501
"""Get data for branded food items using various search parameters

# Search for branded food items using various parameters. __Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` ___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._ # noqa: E501
## Search for branded food items using various parameters. **Example** > ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` **Tips** * Get started by using the **[Query Builder](https://chompthis.com/api/build.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501

:param allergen: Specify a required allergen ingredient (optional) __Example__: Peanuts __Resources__: [List of allergens](https://chompthis.com/api/data/allergen.php)
:param allergen: #### Filter the search to only include branded foods that contain a specific allergen. **Example** > ```&allergen=Peanuts``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter.
:type allergen: str
:param brand: Specify a required brand (optional) __Example__: Starbucks __Resources__: [List of brands](https://chompthis.com/api/data/brand.php)
:param brand: #### Filter the search to only include branded foods that are owned by a specific brand. **Example** > ```&brand=Starbucks```
:type brand: str
:param category: Specify a required category (optional) __Example__: Pasta Dishes __Resources__: [List of categories](https://chompthis.com/api/data/category.php)
:param category: #### Filter the search to only include branded foods from a specific category. **Example** > ```&category=Plant Based Foods```
:type category: str
:param country: Specify a required country (optional) __Example__: United States __Resources__: [List of countries](https://chompthis.com/api/data/country.php)
:param country: #### Filter the search to only include branded foods that are sold in a specific country. **Example** > ```&country=United States``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter.
:type country: str
:param diet: Specify a required diet (optional) _Filters the search to only include food items that are considered compatible with the following diets: Vegan, Vegetarian, Gluten Free_ __Example__: Gluten Free __Resources__: [List of diets](https://chompthis.com/api/data/lifestyle.php)
:param diet: #### Filter the search to only include branded foods that are considered compatible with a specific diet. **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter.
:type diet: str
:param ingredient: Specify a required ingredient (optional) __Example__: Salt __Resources__: [List of ingredients](https://chompthis.com/api/data/ingredient.php)
:param ingredient: #### Filter the search to only include branded foods that contain a specific ingredient. **Example** > ```&ingredient=Salt```
:type ingredient: str
:param keyword: Specify a required keyword (optional) __Example__: Starbucks __Resources__: [List of brands](https://chompthis.com/api/data/brand.php)
:param keyword: #### Filter the search to only include branded foods that are associated with a specific keyword. **Example** > ```&keyword=Organic``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter.
:type keyword: str
:param mineral: Specify a required mineral (optional) __Example__: Potassium __Resources__: [List of minerals](https://chompthis.com/api/data/mineral.php)
:param mineral: #### Filter the search to only include branded foods that contain a specific mineral. **Example** > ```&mineral=Potassium```
:type mineral: str
:param nutrient: Specify a required nutrition label item (optional) __Example__: Caffeine __Resources__: [List of nutrition label items](https://chompthis.com/api/data/nutrition.php)
:param nutrient: #### Filter the search to only include branded foods that contain a specific nutrient. **Example** > ```&nutrient=Caffeine``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter.
:type nutrient: str
:param palm_oil: Specify a required palm oil ingredient (optional) __Example__: E160a Beta Carotene __Resources__: [List of palm oil ingredients](https://chompthis.com/api/data/palm-oil.php)
:param palm_oil: #### Filter the search to only include branded foods that contain a specific ingredient made using palm oil. **Example** > ```&palm_oil=E160a Beta Carotene```
:type palm_oil: str
:param trace: Specify a required trace ingredient (optional) __Example__: Tree Nuts __Resources__: [List of trace ingredients](https://chompthis.com/api/data/trace.php)
:param trace: ### Filter the search to only include branded foods that contain a specific trace ingredient. **Example** > ```&trace=Tree Nuts``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter.
:type trace: str
:param vitamin: Specify a required vitamin (optional) __Example__: Biotin __Resources__: [List of vitamins](https://chompthis.com/api/data/vitamin.php)
:param vitamin: #### Filter the search to only include branded foods that contain a specific vitamin. **Example** > ```&vitamin=Biotin```
:type vitamin: str
:param limit: Set maximum number of records you want the API to return. ___Note:__ The maximum value is 10._ __Example:__ 3 _(defaults to 10)_
:param limit: #### Set maximum number of records you want the API to return. The default value is \"**10**.\" **Example** > ```&limit=10```
:type limit: int
:param page: Specify the search response page number. _Each page will contain up to 10 items._ __Example__: 1 _(default)_
:param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. The default value is \"**1**.\" **Example** > ```&page=1```
:type page: int

:rtype: BrandedFoodObject
"""
return 'do some magic!'


def ingredient_search_php_get(find, list, raw=None, limit=None): # noqa: E501
def food_ingredient_search_php_get(find, limit=None): # noqa: E501
"""Get raw/generic food ingredient item(s)

# Get data for a specific ingredient or a specific set of ingredients. __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` # noqa: E501
## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,chicken drumstick``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501

:param find: Specify the ingredient name(s). __Example #1:__ broccoli __Example #2:__ broccoli,cauliflower,spinach ___Important Note:__ Set the \"is_list\" parameter to true before passing in a comma-separated list of ingredients._
:type find: int
:param list: Specify if you are searching for multiple ingredients. _Setting this to true will configure this endpoint so that it accepts a comma-separated list of ingredients._ _By default, this endpoint expects a single ingredient._ __Example:__ true _(defaults to false)_
:type list: bool
:param raw: Specify if you only want data for raw ingredients. __Example:__ true _(defaults to true)_
:type raw: bool
:param limit: Set maximum number of records you want the API to return. ___Important Note:__ Setting this to \"1\" will return 1 record per search term._ __Example:__ 1 _(defaults to 1, max is 3)_
:param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=raw broccoli``` **Example #2: Set of Ingredients** > ```&find=raw broccoli,buttermilk waffle,mashed potatoes``` **Important Notes** * Comma-separated lists cannot contain more than **10 ingredients**. You must perform additional API calls if you are looking up more than 10 ingredients.
:type find: str
:param limit: #### Set maximum number of records you want the API to return, per search term. The default value is \"**1**.\" **Example** > ```&limit=3```
:type limit: int

:rtype: IngredientObject
Expand Down
Loading