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 (Note: this package is not available yet):

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.1.1.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

pyfatsecret-0.1.1-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfatsecret-0.1.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyfatsecret-0.1.1.tar.gz
Algorithm Hash digest
SHA256 df586947f232ec9b06db0b2fd5d6d1fb272b22b162bc0daf9e24d97b3e5e3e12
MD5 92c569526c67fc92719d505958a4f194
BLAKE2b-256 2b9311c04b78effea4b5d2da4c6ebe587091408b807b43224317441f01eeb1fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfatsecret-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyfatsecret-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 113650e12e29c8b410bf42d5245a8ac8abbb37bee8f978cd459906cdbdf58fd6
MD5 d17cbe94f41476fc86821ffce94e3431
BLAKE2b-256 c755c3a5231c3cbccd34f379f694ccee049d79d41d2916eccb5a7c5202051096

See more details on using hashes here.

Supported by

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