Skip to main content

A simple python wrapper for the Fatsecret API.

Project description

pyfatsecret

pyfatsecret is a simple Python wrapper for the Fatsecret API, facilitating interactions with the platform using OAuth 2.0. This package allows developers to integrate Fatsecret's nutritional database and features into their applications effortlessly.

Refer to the documentation on Read The Docs: https://py-fatsecret.readthedocs.io/en/latest/

Installation

Before you install pyfatsecret, ensure you have Python installed on your system. This package requires the requests library, which can be installed using pip if not already available.

To install pyfatsecret, use the following pip command:

pip install pyfatsecret

For developers looking to contribute or extend pyfatsecret, please install the development requirements:

pip install -r requirements-dev.txt

Usage

To use pyfatsecret, you first need to register for a developer account at Fatsecret to obtain your client ID and client secret key.

Important Note on IP Restrictions:

FatSecret requires whitelisting IP addresses for API access. You must specify allowed IPs in FatSecret platform settings. More details can be found here.

Quick Start Guide:

Here's a simple example to get you started with pyfatsecret:

from pyfatsecret import Fatsecret

# Initialize the Fatsecret client
fatsecret = Fatsecret(client_id='your_client_id', client_secret='your_client_secret')

# Example: Searching for food items
result = fatsecret.foods.foods_search("Apple")
print(result)

Auto-generation

The only modules that were implemented are fatsecret_base.py which takes care of the authentification and api calls and autogen.py which auto-generates all of the other modules using the latest information on the website. To regenerate all of the modules, run autogen.py.

Contributing

All contributions are welcome! You can help by reporting bugs, suggesting enhancements, or adding new features to the project.

Note: All changes should go into the modules fatsecret_base.py and/or autogen.py. The other modules are automatically generated.

License

This project is open-sourced under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfatsecret-0.2.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfatsecret-0.2.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file pyfatsecret-0.2.0.tar.gz.

File metadata

  • Download URL: pyfatsecret-0.2.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for pyfatsecret-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0e034e5cce8610f8f285d1742696ff2b1dcbd16b7fddfa936fa527cbdcd88af4
MD5 ff409daedd7f895fc6fe5089d669b03b
BLAKE2b-256 50d7f0f26425867cbc52b7a85085ff6792221a9a6b20a2dc04d50308243ca8a2

See more details on using hashes here.

File details

Details for the file pyfatsecret-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyfatsecret-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for pyfatsecret-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bf80e587afa26fc47fb4872f5bed66486da2f26b3ac636df36c2e8716ac98e5
MD5 6da3575ae130c42cad2e8678d08876fe
BLAKE2b-256 0b018799c5898921da091bbd2cd56f38cd3457615456d58ae039fa38e02bf303

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page