added support for db_num when using the redis token store

This commit is contained in:
2022-04-23 18:02:40 +02:00
parent d8b5b01bcc
commit 0dc6e84727
3 changed files with 8 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
# AVT Fresh!
This is a wrapper of [the roly-poly, not 100% ergonomic Freshbooks web API](https://www.freshbooks.com/api/start). It is far from comprehensive: It was created for the specific client- and invoice-related needs of [Averbach Transcription](https://avtranscription.com).
This is a wrapper of [the Freshbooks web API](https://www.freshbooks.com/api/start). It is far from comprehensive: It was created for the specific client- and invoice-related needs of [Averbach Transcription](https://avtranscription.com).
There are "band-aids" here to work around some of the API's shortcomings. For example, you don't have to deal with pagination at all. 🎉
@@ -14,12 +14,13 @@ pip install avt-fresh
Instantiate the avt_fresh `Client` like so, and you're off to the races:
```python
client = Client(client_secret="...", client_id="...", redirect_uri="https://...", account_id="...")
from avt_fresh import ApiClient
client = ApiClient(client_secret="...", client_id="...", redirect_uri="https://...", account_id="...")
monster_invoices = client.get_all_invoices_for_org_name("Monsters Inc")
```
You can get and set the required arguments to `Client` [here](https://my.freshbooks.com/#/developer). Well, all of them except `FRESHBOOKS_ACCOUNT_ID`, which you can see (there's got to be another way??) by clicking on one of your invoices and grabbing the substring here: `https://my.freshbooks.com/#/invoice/<THIS THING>-1234567`.
You can get and set the required arguments to `ApiClient` [here](https://my.freshbooks.com/#/developer). Well, all of them except `FRESHBOOKS_ACCOUNT_ID`, which you can see (there's got to be another way??) by clicking on one of your invoices and grabbing the substring here: `https://my.freshbooks.com/#/invoice/<THIS THING>-1234567`.
Don't tell anyone but `redirect_uri` can be pretty much anything! See `Initializing` below 👇.
@@ -145,7 +146,7 @@ client = Client(
redirect_uri="https://...",
account_id="...",
token_store=avt_fresh.token.TokenStoreOnRedis,
connection_string="redis://..." ,
connection_string="rediss://..." ,
)
```