Skip to main content

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.

Metadata

Release files for pyfatsecret 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfatsecret 0.2.0
File Size Uploaded
pyfatsecret-0.2.0.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfatsecret 0.2.0
File Interpreter ABI Platform
pyfatsecret-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.7 kB

Release files / pyfatsecret-0.2.0.tar.gz

Download URL pyfatsecret-0.2.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0e034e5cce8610f8f285d1742696ff2b1dcbd16b7fddfa936fa527cbdcd88af4
BLAKE2b-256 checksum
How to use checksums
50d7f0f26425867cbc52b7a85085ff6792221a9a6b20a2dc04d50308243ca8a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / pyfatsecret-0.2.0-py3-none-any.whl

Download URL pyfatsecret-0.2.0-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bf80e587afa26fc47fb4872f5bed66486da2f26b3ac636df36c2e8716ac98e5
BLAKE2b-256 checksum
How to use checksums
0b018799c5898921da091bbd2cd56f38cd3457615456d58ae039fa38e02bf303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page