Comprehensive documentation for TrustCafé API wrapper - Forked with enhanced documentation
Find a file
2026-04-16 21:31:32 +01:00
src/trustcafeapiwrapper Wrappers accept item_key where possible 2026-04-16 21:31:32 +01:00
tests Wrappers accept item_key where possible 2026-04-16 21:31:32 +01:00
.gitignore Handle token method for saving token token to a file 2026-04-13 22:26:42 +01:00
.gitlab-ci.yml Allow python 3.11 2026-04-13 18:17:37 +01:00
.python-version Allow python 3.11 2026-04-13 18:23:22 +01:00
development.md Wrappers accept item_key where possible 2026-04-16 21:31:32 +01:00
documentation.md Documentation and version 2026-04-13 22:47:20 +01:00
pyproject.toml Return token data from handle_token 2026-04-16 21:08:54 +01:00
README.md List notifications 2026-04-13 17:43:52 +01:00
setup.py Trying with setup 2026-03-30 23:37:01 +01:00
testing.py Return token data from handle_token 2026-04-16 21:08:54 +01:00
unittests.py Post update 2026-04-07 23:37:55 +01:00
usethis.py Return token data from handle_token 2026-04-16 21:08:54 +01:00
uv.lock Allow python 3.11 2026-04-13 18:23:22 +01:00
venv.bat WIP 2026-03-30 19:44:12 +01:00

Trustcafe API Wrapper

Prerequisites

You will need:

  1. API Client and Secret
  2. Python 3.11 or something sensible or above
  3. A method for environment variables like python-dotenv

API client key and secret from the site

  1. https://www.trustcafe.io/en/myaccount/apiaccess for production and https://alpha.wts2.net/en/myaccount/apiaccess for alpha (this will change in the future)
  2. Click "Create new client credentials key pair"
  3. Choose all of the scopes or select which you would like to restrict the key to
  4. Scroll down and press Save
  5. Copy the client key and secret to your environment, the secret cannot be retrieved without making a new one

Installation

pip install trustcafeapiwrapper

OR

uv add trustcafeapiwrapper

Usage

import trustcafeapiwrapper, os


API = trustcafeapiwrapper.APIClient(
    client_id=os.getenv("client_id"),
    client_secret=os.getenv("client_secret"),
    env="alpha" # alpha | production.
    debug=False
)

profile = API.run_job('userprofile.get', "simon-little")


from trustcafeapiwrapper.wrappers.post.create_post import create_post

API.wrapped(create_post(
    "This is a test post created via the create_post wrapper function.",
))

More