Comprehensive documentation for TrustCafé API wrapper - Forked with enhanced documentation
Find a file
simonwt fb1953e953 Test the utils
Comment create wrapper
Test comment wrapper
2026-04-01 23:00:42 +01:00
jobs wrapped function to condense code 2026-04-01 21:31:15 +01:00
tests Test the utils 2026-04-01 23:00:42 +01:00
utils Test the utils 2026-04-01 23:00:42 +01:00
wrappers Test the utils 2026-04-01 23:00:42 +01:00
.gitignore Save test response to json file 2026-04-01 00:00:04 +01:00
.gitlab-ci.yml Update .gitlab-ci.yml file 2026-04-01 20:51:21 +00:00
.python-version WIP 2026-03-30 19:44:12 +01:00
__init__.py import the client and hopefully be importable 2026-03-30 23:12:57 +01:00
apiclient.py Test the utils 2026-04-01 23:00:42 +01:00
pyproject.toml Bumpt version 2026-03-30 23:16:53 +01:00
README.md wrapped function to condense code 2026-04-01 21:31:15 +01:00
setup.py Trying with setup 2026-03-30 23:37:01 +01:00
testing.py Unit testing weyhay 2026-04-01 21:42:11 +01:00
unittests.py Test the utils 2026-04-01 23:00:42 +01:00
uv.lock Get post by slug 2026-03-31 10:19:32 +01:00
venv.bat WIP 2026-03-30 19:44:12 +01:00

Trustcafe API Wrapper

Intended use (not working yet but testing.py does)

import trustcafeapiwrapper, os


API = trustcafeapiwrapper.APIClient(
    client_id=os.getenv("client_id"),
    client_secret=os.getenv("client_secret")
)

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

Debates

  1. Not sure about the name jobs and run_job. Requests is an existing package dependency though. tasks seems to broard. I'm sure there's probably an already existing name that I can't articulate how to find.
  2. Should these job be called with dot notation? Or with slashes? Or something else? Is it okay to have these as strings?
  3. Should we do validation in the jobs or let the server do that all?
  4. wrapped is an awkward name. What's more proper? But also obvious?

ToDo:

  1. Make more jobs
  2. Make wrappers to make it less cumbersome when posting etc
  3. Publish to PyPi or whatever