Skip to main content

Unoffical python client for TooGoodToGo API

Project description

Actions Status codecov PyPI version

tgtg-python

Python client that help you to talk with TooGoodToGo API.

Python version: 3.6, 3.7, 3.8

Handle:

  • login (/api/auth/v1/loginByEmail)
  • list stores (/api/item/)
  • get a store (/api/item/:id)
  • get all stores (/api/map/v1/listAllBusinessMap)
  • set favorite (/api/item/:id/setFavorite)

Used by:

Install

pip install tgtg

Use it

from tgtg import TgtgClient

# login with email and password
client = TgtgClient(email=your_email, password=your_password)

# or you can login with user_id and access_token
# (you can retrieve them from client after logged with email and password)
client = TgtgClient(access_token=your_access_token, user_id=your_user_id)

# You can then get some items, default will get **only** your favorites
client.get_items()

# To get items (not only your favorites) you need to provide location informations
client.get_items(
    favorites_only=False,
    latitude=48.126,
    longitude=-1.723,
    radius=10,
)

# Or get an item
client.get_item(1234)

Developers

This project uses poetry so you will need to install poetry locally to use following commands.

pip install poetry --user
poetry install

This project uses black to format all the code, isort to sort all imports and lint is done by flake8.

Just run this command to format automatically all the code you wrote:

make style

Run this command to run all tests:

make test

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

tgtg-0.3.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

tgtg-0.3.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file tgtg-0.3.0.tar.gz.

File metadata

  • Download URL: tgtg-0.3.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.8.0-7630-generic

File hashes

Hashes for tgtg-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7fa6aef767c21c064f2684b94824e826d0f00af98777c7805f36c92890d03921
MD5 c6d408453f490a6ece008cd5622dcf31
BLAKE2b-256 65fb4dbe586fd6674b6349bf51b58529580e134bf34b19d858cfb385d4dc18b0

See more details on using hashes here.

File details

Details for the file tgtg-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tgtg-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.8.0-7630-generic

File hashes

Hashes for tgtg-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1849affdd2bac6c8e8287e034c8b2fbab2e2ade097e1d158d80acbd2612cecd
MD5 2f98a0f83a123e83a9bac4f874696588
BLAKE2b-256 845db91b3819e7ccc41134e2cf605afbf769141bb3b4210e18a4ce6870af8932

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