Updating readme

This commit is contained in:
simonwt 2026-04-02 17:31:39 +01:00
parent c6c7e7bb28
commit f4a66b3e55
3 changed files with 45 additions and 18 deletions

View file

@ -1,6 +1,31 @@
# Trustcafe API Wrapper
Intended use (not working yet but testing.py does)
## Prerequisites
You will need:
1. API Client and Secret
2. Python 3.12 or above
3. A method for environment variables like [python-dotenv](https://pypi.org/project/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
```python
import trustcafeapiwrapper, os
@ -14,19 +39,3 @@ API = trustcafeapiwrapper.APIClient(
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

18
development.md Normal file
View file

@ -0,0 +1,18 @@
# Things to think about do
## 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

2
uv.lock generated
View file

@ -214,7 +214,7 @@ wheels = [
[[package]]
name = "trustcafeapiwrapper"
version = "0.1.0.1"
source = { virtual = "." }
source = { editable = "." }
dependencies = [
{ name = "dotenv" },
{ name = "pydantic" },