Skip to content

Auto-gen Python SDK for Robotoff, built from its OpenAPI spec. Provides easy access to its ML-powered product Q&A engine and related APIs.

Notifications You must be signed in to change notification settings

Savvythelegend/robotoff-sdk-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robotoff Python SDK

OpenAPI Docs

This repository provides an auto-generated Python SDK for Robotoff, based on its OpenAPI specification.

The SDK enables developers to interact with Robotoff's machine learning-powered product question/answer engine and related APIs with minimal setup.


Installation

To install the SDK locally:

pip install .

Example Usage

1. Get Popular Questions

from robotoff_sdk.api.questions import get_popular_questions
from robotoff_sdk import Configuration, ApiClient

configuration = Configuration()
with ApiClient(configuration) as api_client:
    response = get_popular_questions()
    print(response.body)

2. Fetch Annotations for a Product

from robotoff_sdk.api.annotations import get_annotations
from robotoff_sdk import Configuration, ApiClient

configuration = Configuration()
with ApiClient(configuration) as api_client:
    response = get_annotations(barcode="1234567890123")
    for annotation in response.body.get('annotations', []):
        print("Annotation:", annotation)

3. Get Insights for a Product

from robotoff_sdk.api.insight import get_insights
from robotoff_sdk import Configuration, ApiClient

configuration = Configuration()
with ApiClient(configuration) as api_client:
    response = get_insights(barcode="1234567890123")
    for insight in response.body.get('insights', []):
        print("Insight:", insight)

For more usage patterns, refer to the examples/ directory.


Available APIs

This SDK exposes all public Robotoff APIs via:

  • robotoff_sdk.api.questions
  • robotoff_sdk.api.annotations
  • robotoff_sdk.api.insight
  • robotoff_sdk.api.predictions

Each endpoint is mapped to a simple Python function, ready to use.


Project Structure

robotoff-sdk-python/
├── examples/
├── robotoff_sdk/
├── openapi.json
├── openapitools.json
├── pyproject.toml
├── README.md
└── LICENSE

Development & Contribution

This is an initial prototype generated using OpenAPI Generator. Future improvements may include tests, CI/CD, type stubs, and integration into the main Open Food Facts SDK ecosystem.

If you'd like to contribute:

  • Fork the repository
  • Use openapi-generator to regenerate as needed
  • Submit a PR with clear changes

License

This SDK is distributed under the terms of the GNU Affero General Public License v3.0, in alignment with the Robotoff project.

If using or distributing this code, please ensure compliance with AGPL-3.0 terms, especially when used over a network.


Acknowledgements

This SDK is based on the public OpenAPI specification provided by Robotoff, part of the Open Food Facts project.

Generated using OpenAPI Generator.

About

Auto-gen Python SDK for Robotoff, built from its OpenAPI spec. Provides easy access to its ML-powered product Q&A engine and related APIs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published