Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from openfoodfacts import API
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to add a section about how to add an image, you should add it to a markdown file (here usage.md would be appropriate).


api = API(user_id="tejaswibks", password="your_password")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
api = API(user_id="tejaswibks", password="your_password")
api = API(user_id="your_username", password="your_password")


result = api.add_image(
barcode="1234567890123",
imagefield="front",
imgpath="path/to/your/image.jpg"
)

print(result.status)
4 changes: 4 additions & 0 deletions openfoodfacts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
from typing import Any, Dict, List, Optional, Tuple, Union, cast

import requests
"""
NOTE: The Open Food Facts API limits queries to 10,000 results by default.
This limitation may affect large data requests and should be considered when querying large datasets.
"""

from .types import APIConfig, APIVersion, Country, Environment, Facet, Flavor, JSONType
from .utils import URLBuilder, http_session
Expand Down