Difference between revisions of "API/Python"

From Open Food Facts wiki
Jump to navigation Jump to search
 
(14 intermediate revisions by one other user not shown)
Line 2: Line 2:
  
  
== Offline API==
+
[[File:Python.png|thumb]]
 +
 
 +
 
 +
== Online API==
 +
https://github.com/openfoodfacts/openfoodfacts-python
 +
This has recently been enriched using code from Robotoff.
 +
== Offline API (proxy)==
 
=== Source code ===
 
=== Source code ===
 
https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython
 
https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython
=== How to install ===
 
* Install python 3
 
* Install mongodb
 
* Install pip
 
* Install requirements : $ pip install -r requirements.txt
 
* Download the database from : http://world.openfoodfacts.org/data/openfoodfacts-mongodbdump.tar.gz
 
* Import to local mongodb : $ mongorestore -d off -c products /foldertobsonfile/products.bson
 
* Launch api : $ python3 runApiRESTServer.py
 
* That's all !
 
 
=== How to use ===
 
=== How to use ===
 +
 +
== Open Food Facts projects in Python you can contribute to ==
 +
 +
* [[:Category:Robotoff|Robotoff]] - [https://github.com/openfoodfacts/robotoff Github] ([https://github.com/openfoodfacts/robotoff/issues/374 What can I work on?])
 +
* [[Folksonomy Engine]] (FastAPI) - [https://github.com/openfoodfacts/folksonomy_api Github] ([https://github.com/openfoodfacts/folksonomy api/issues/70/ What can I work on ?])
 +
* [[Prices|Open Prices]] (Django) - [https://github.com/openfoodfacts/open-prices Github] ([https://github.com/openfoodfacts/open-prices/issues/39 What can I work on ?])
 +
* [[Taxonomy editor|Taxonomy editor]] (FastAPI) - [https://github.com/openfoodfacts/taxonomy-editor Github]
 +
* [[Search-a-licious]] (FastAPI) - [https://github.com/openfoodfacts/search-a-licious Github]
 +
* Facet Knowledge Panels - [https://github.com/openfoodfacts/facets-knowledge-panels Github]
 +
 +
Full list of repositories using Python: https://github.com/orgs/openfoodfacts/repositories?q=python
 +
 +
== Apps reusing the Python SDK ==
 +
 +
== Get in touch==
 +
{{Box
 +
| 1    =  Slack channel
 +
| 2    =  [https://openfoodfacts.slack.com/messages/C13993JDD/ #python]
 +
}}
 +
[[Category:API]]
 +
[[Category:Python]]
 +
[[Category:SDKs]]

Latest revision as of 12:43, 9 November 2024

Documentation of the Python bindings


Python.png


Online API

https://github.com/openfoodfacts/openfoodfacts-python This has recently been enriched using code from Robotoff.

Offline API (proxy)

Source code

https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython

How to use

Open Food Facts projects in Python you can contribute to

Full list of repositories using Python: https://github.com/orgs/openfoodfacts/repositories?q=python

Apps reusing the Python SDK

Get in touch

Slack channel