diff --git a/README.md b/README.md index 81acd29..50ceed8 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file diff --git a/development.md b/development.md new file mode 100644 index 0000000..0e6dee4 --- /dev/null +++ b/development.md @@ -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 \ No newline at end of file diff --git a/uv.lock b/uv.lock index be365aa..5cfb325 100644 --- a/uv.lock +++ b/uv.lock @@ -214,7 +214,7 @@ wheels = [ [[package]] name = "trustcafeapiwrapper" version = "0.1.0.1" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "dotenv" }, { name = "pydantic" },