Official Python SDK of Open Food Facts
Project description
Open Food Facts Python SDK
Status
Contributing
Any help is welcome, as long as you don't break the continuous integration. Fork the repository and open a Pull Request directly on the "develop" branch. A maintainer will review and integrate your changes.
Maintainers:
Contributors:
- Agamit Sudo
- Daniel Stolpe
- Enioluwa Segun
- Nicolas Leger
- Pablo Hinojosa
- Andrea Stagi
- Benoît Prieur
- Aadarsh A
Copyright and License
Copyright 2016-2022 Open Food Facts
The Open Food Facts Python SDK is licensed under the MIT License.
Installation
The easiest way to install the SDK is through pip:
pip install openfoodfacts
or manually from source:
git clone https://github.com/openfoodfacts/openfoodfacts-python
cd openfoodfacts-python
python setup.py install
Examples
Get information about a product
api = openfoodfacts.API(version="v2")
code = "3017620422003"
api.product.get(code)
Perform text search
api = openfoodfacts.API(version="v2")
results = api.product.text_search("mineral water")
Create a new product or update an existing one
api = openfoodfacts.API(version="v2")
results = api.product.update(CODE, body)
with CODE
the product barcode and body
the update body.
To see all possible capabilities, check out the usage guide.
Third party applications
If you use this SDK, feel free to open a PR to add your application in this list.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for openfoodfacts-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df5fad3f108fce232ea444afe5c668a141de3fd62c15fc131fc36d738138cf8a |
|
MD5 | b04f71da08a16849471ada2d3b512784 |
|
BLAKE2b-256 | 14bd2807344116594b78d428b513282a7b653dfd3a6e5b7d1d07573b1ac4def4 |