Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in User Agent Specification in Documentation #206

Open
floodoo opened this issue Jan 10, 2024 · 2 comments
Open

Inconsistency in User Agent Specification in Documentation #206

floodoo opened this issue Jan 10, 2024 · 2 comments

Comments

@floodoo
Copy link

floodoo commented Jan 10, 2024

Issue: User Agent Parameter Missing in OpenFoodFacts SDK Despite Documentation

What

A discrepancy has been identified in the OpenFoodFacts SDK documentation regarding the ability to set a user agent. The documentation suggests setting a user agent during API initialization, but the SDK's API class constructor does not support this functionality.

Steps to Observe the Discrepancy

  1. The documentation indicates the use of a user_agent parameter in the API initialization as follows:
    api = API(
        user_agent="<application name>",
        ...
    )
  2. However, the actual API class constructor in the SDK lacks the user_agent parameter:
    class API:
        def __init__(
            self,
            username: Optional[str] = None,
            ...
        ) -> None:
            ...

Expected Behavior

The SDK's documentation should accurately reflect its current functionality. If the SDK is intended to support the user_agent parameter, this should be correctly implemented. If not, the documentation should be updated to avoid such mentions.

Suggested Action

Based on this inconsistency, I recommend either:

  • Updating the SDK to include a user_agent parameter in the API class constructor as per the documentation.
  • Amending the documentation to remove any references to setting a user agent if this feature is not supported.

Platform

  • OpenFoodFacts SDK and its official documentation.

Context of Discovery

  • This issue was discovered during my first use of the OpenFoodFacts SDK, leading to initial confusion.

I look forward to a resolution that aligns the SDK with its documentation, ensuring clarity for all future users.

@namedtoaster
Copy link

I think this only happens if you install the package with pip. I had the same issue. But when I cloned the repo and installed via setup.py, that worked for me. I'm guessing the pypi package just isn't up to date?

@elebumm
Copy link

elebumm commented Feb 27, 2024

Confirming that the pypi package isn't up to date. Running:

pip install git+https://github.com/openfoodfacts/openfoodfacts-python#egg=openfoodfacts

was what fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants