Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trtg/pyfatsecret
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: walexnelson/pyfatsecret
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Oct 3, 2014

  1. rewrote & implemented all API calls

    Restructured to be more of a wrapper and less of a client. Should allow
    for more “pluggability” into other apps like web apps. Removed all
    caching functionality so that developers can decide what to do with the
    tokens.
    walexnelson committed Oct 3, 2014
    Copy the full SHA
    c60207a View commit details
  2. Copy the full SHA
    9f2e0b1 View commit details
  3. creating Shinx docs

    walexnelson committed Oct 3, 2014
    Copy the full SHA
    befcf21 View commit details
  4. sphinx doc edits

    walexnelson committed Oct 3, 2014
    Copy the full SHA
    e282d2f View commit details
  5. sphinx doc edits

    walexnelson committed Oct 3, 2014
    Copy the full SHA
    0e4d422 View commit details

Commits on Oct 5, 2014

  1. Cleaned up sphinx docs

    walexnelson committed Oct 5, 2014
    Copy the full SHA
    cc49b63 View commit details
  2. Copy the full SHA
    b0d2357 View commit details
  3. Copy the full SHA
    ddc9230 View commit details
  4. wrong theme for rtd

    walexnelson committed Oct 5, 2014
    Copy the full SHA
    ea50621 View commit details
  5. Copy the full SHA
    92fead2 View commit details
  6. Copy the full SHA
    6513b4c View commit details
  7. playing with some badges

    walexnelson committed Oct 5, 2014
    Copy the full SHA
    78a70b1 View commit details

Commits on Sep 14, 2016

  1. Fix non-ASCII characters in documentation

    Python 2.7 on Windows chokes on the non-ASCII hyphens in two of the comments.
    sodle authored Sep 14, 2016
    Copy the full SHA
    b5e0a06 View commit details
  2. Merge pull request #1 from sodle/patch-1

    Fix non-ASCII characters in documentation
    walexnelson authored Sep 14, 2016
    Copy the full SHA
    e17b872 View commit details

Commits on Mar 11, 2017

  1. fix packaging

    sodle committed Mar 11, 2017
    Copy the full SHA
    34e6f38 View commit details
  2. Copy the full SHA
    9487887 View commit details
  3. Fix type hints in docstrings

    sodle committed Mar 11, 2017
    Copy the full SHA
    b325a60 View commit details
  4. Copy the full SHA
    369f75d View commit details
  5. ignore dist directory

    sodle committed Mar 11, 2017
    Copy the full SHA
    7fb90ec View commit details
  6. Copy the full SHA
    de6461a View commit details
  7. Merge pull request #1 from sodle/FixArrays

    Make food_entries_get always return a list
    sodle authored Mar 11, 2017
    Copy the full SHA
    1a69b88 View commit details

Commits on Mar 14, 2017

  1. Merge pull request #2 from sodle/master

    Use packaging instead of a module
    walexnelson authored Mar 14, 2017
    Copy the full SHA
    bd9d009 View commit details
  2. v0.2.3

    walexnelson committed Mar 14, 2017
    Copy the full SHA
    d46fdaa View commit details
  3. Copy the full SHA
    58e2a0e View commit details
  4. Merge pull request #3 from walexnelson/new-release

    New release
    walexnelson authored Mar 14, 2017
    Copy the full SHA
    8a24e22 View commit details
  5. rm deprecated pypi stats

    walexnelson committed Mar 14, 2017
    Copy the full SHA
    acd2422 View commit details

Commits on Dec 9, 2017

  1. Copy the full SHA
    70843c9 View commit details

Commits on Sep 14, 2021

  1. Copy the full SHA
    62b42ef View commit details
  2. formatting with Black

    ChocoTonic committed Sep 14, 2021
    Copy the full SHA
    62f7dcb View commit details
  3. Copy the full SHA
    70f4481 View commit details
  4. Copy the full SHA
    bf3f4b8 View commit details
  5. undo Black formatting

    ChocoTonic committed Sep 14, 2021
    Copy the full SHA
    5363506 View commit details

Commits on Sep 24, 2021

  1. Merge pull request #7 from ChocoTonic/change-authentication-from-HTTP…

    …-to-HTTPS
    
    API calls using HTTPS instead of HTTP
    walexnelson authored Sep 24, 2021
    Copy the full SHA
    d6e5690 View commit details
  2. update README

    walexnelson committed Sep 24, 2021
    Copy the full SHA
    e22da7c View commit details
  3. bump version

    walexnelson committed Sep 24, 2021
    Copy the full SHA
    708eff7 View commit details
  4. release 0.3.0

    walexnelson authored Sep 24, 2021
    Copy the full SHA
    6ca8312 View commit details
  5. format with Black

    ChocoTonic committed Sep 24, 2021
    Copy the full SHA
    78ccb51 View commit details

Commits on Oct 18, 2021

  1. Added food.get.v2 support

    takeontom committed Oct 18, 2021
    Copy the full SHA
    d670687 View commit details

Commits on Oct 20, 2021

  1. Copy the full SHA
    9e5fe1e View commit details

Commits on Oct 23, 2021

  1. Copy the full SHA
    6e9ebcd View commit details
  2. Added foods.autocomplete

    takeontom committed Oct 23, 2021
    Copy the full SHA
    5c75db0 View commit details

Commits on Oct 24, 2021

  1. Merge pull request #9 from takeontom/master

    Added `food.get.v2` support
    walexnelson authored Oct 24, 2021
    Copy the full SHA
    92ec166 View commit details
  2. rename examples

    walexnelson committed Oct 24, 2021
    Copy the full SHA
    d38c887 View commit details
  3. add release script

    walexnelson committed Oct 24, 2021
    Copy the full SHA
    988c5b4 View commit details
  4. package 0.4.0

    walexnelson committed Oct 24, 2021
    Copy the full SHA
    a678c71 View commit details
  5. Copy the full SHA
    e33f62b View commit details

Commits on Nov 4, 2021

  1. formatting with Black

    ChocoTonic committed Nov 4, 2021
    Copy the full SHA
    15c8a48 View commit details
Showing with 2,279 additions and 346 deletions.
  1. +8 −0 .gitignore
  2. +21 −0 LICENSE
  3. +50 −83 README.md
  4. +177 −0 docs/Makefile
  5. +7 −0 docs/api_docs.rst
  6. +278 −0 docs/conf.py
  7. +17 −0 docs/contents.rst.inc
  8. +48 −0 docs/index.rst
  9. +242 −0 docs/make.bat
  10. +108 −0 docs/usage.rst
  11. +0 −38 example.py
  12. 0 examples/__init__.py
  13. +44 −0 examples/cli_example.py
  14. +61 −0 examples/web_example.py
  15. +0 −225 fatsecret.py
  16. +6 −0 pyproject.toml
  17. +15 −0 release.sh
  18. +2 −0 requirements.txt
  19. +31 −0 setup.cfg
  20. +8 −0 src/fatsecret/__init__.py
  21. +1,156 −0 src/fatsecret/fatsecret.py
  22. 0 tests/.gitkeep
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pyc
.idea
.idea/*
docs/_build/*
*.tar.gz
fatsecret.egg*
dist/
.vscode/settings.json
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 Alex Nelson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
133 changes: 50 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,51 @@
pyfatsecret
===========

This library provides a lightweight python wrapper for the fatsecret API with the goal of making it easier to visualize the data retrieved from the API. To that end, this library will usually return lists of identical elements for ease of plotting, discarding extra header fields that the fatsecret API otherwise includes. For example, exercise_entries_get_month() returns a list of dates and calories burned without the 'month','day', 'from_date_int', 'to_date_int' keys that the API normally returns


The methods provided by the API are grouped according to category:

Foods
---
###food_add_favorite()
###food_delete_favorite()
###food_get()
implemented
###foods_get_favorites()
implemented
###foods_get_most_eaten()
implemented
###foods_get_recently_eaten()
implemented
###foods_search()
implemented

Recipes
---
###recipe_add_favorite()
###recipe_delete_favorite()
###recipe_get()
###recipes_get_favorites()
###recipes_search()

Recipe Types
---
###recipe_types_get()

Saved Meals
---
###saved_meal_create()
###saved_meal_delete()
###saved_meal_edit()
###saved_meals_get()
implemented
###saved_meal_item_add()
###saved_meal_item_delete()
###saved_meal_item_edit()
###saved_meal_items_get()

Exercises
---
###exercises_get

Profile - Management
---
###profile_create
###profile_get
###profile_get_auth
###profile_request_script_session_key

Profile - Food Diary
---
###food_entries_copy
###food_entries_copy_saved_meal
###food_entries_get
###food_entries_get_month
implemented
###food_entry_create
###food_entry_delete
###food_entry_edit

Profile - Exercise Diary
---
###exercise_entries_commit_day
###exercise_entries_get
###exercise_entries_get_month
implemented
###exercise_entries_save_template
###exercise_entry_edit

Profile - Weight Diary
---
###weight_update
###weights_get_month
implemented
> # Looking for new maintainer
>
> Life and career have taken me in a different direction and I no longer have time to keep this updated. I've attempted to get this merged back into the original with no success. If you're interested in continuing this then let me know.
# pyfatsecret

![status](https://badge.fury.io/py/fatsecret.svg)

This library provides a lightweight python wrapper for the Fatsecret API with the goal of making it easier to visualize the data retrieved from the API. To that end, this library will usually return lists of identical elements for ease of plotting, discarding extra header fields that the Fatsecret API otherwise includes. All API calls return either a single or list of JSON dictionaries.

## Installation

Install the module via pip

```sh
$ pip install fatsecret
```

or easy_install::

```sh
$ easy_install fatsecret
```

## Config

Register for a developer account at [Fatsecret](https://platform.fatsecret.com/api/). You will need your Consumer Key and Consumer Secret key for your application.

## Usage

Fatsecret supports both delegated and public calls. Only through delegated calls can you access Fatsecret user profile data.

If you're only interested in the public data you only require a session to make HTTP requests:

```py
from fatsecret import Fatsecret

fs = Fatsecret(consumer_key, consumer_secret)
```

Once you have created a session then you can start reading from Fatsecret's public food and recipe database

```py
foods = fs.foods_search("Tacos")
```

Refer to the [documentation](https://pyfatsecret.readthedocs.org/en/latest/) for further examples and detail

## Contributing

All contributions are welcome! I'm not actively maintaining this library, so there's a good chance that any API changes have not been implemented in this wrapper.
177 changes: 177 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pyfatsecret.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pyfatsecret.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pyfatsecret"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pyfatsecret"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
7 changes: 7 additions & 0 deletions docs/api_docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _api_docs:

API Documentation
=================

.. autoclass:: fatsecret.Fatsecret
:members:
Loading