-
Notifications
You must be signed in to change notification settings - Fork 65
feat: Add QuickBooks verified source #609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…rename pipeline, add tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @ah12068 ,
thanks for this contribution. This looks really solid.
Also, it surfaced a bug in our verified-sources repo that will get fixed soon (#613).
The only thing you could have done better is make sure to talk to us, before implementing something (good piece of advice for any oss contribution).
Then we would have told you whether we would want this source or not, which atm is not likely, as it increases the amount of code that we have to maintain. [1]
UPDATED:
In order for this to become a real verified source, we'd need a bit more work such that the pipeline can run just with the credential file without any manual work (getting tokens from their website).
Intuit seems to be doing a standard Oauth 2.0 authentication, which is something that dlt does support.
So let's try to get this to a state where the user sets the unchanging values in the secret (client-id, client-secret, project-id, redirect-uri etc...) and the code connects to the oauth-endpoints to get the authorization token which it uses in turn to get the access- and refresh-token and then instanitates the client with it.
here are the docs for dlt
-oauth: https://dlthub.com/docs/general-usage/credentials/complex_types#oauth2credentials
it's an abstract class that is being implemented for GoogleCloud-Credentials, so you could copy how that is done.
If you're into it, you can also try to 'vibe-code' it and have an LLM help you with writing it. Intuit has a lot of docs, and some example client implementations, so that should be a very good starting point.
We put together some advice on how to achieve good results with it here: https://dlthub.com/docs/dlt-ecosystem/llm-tooling/cursor-restapi
- [1] there was an issue for it, but it wasnt opened by someone from dltHub, maybe you missed that
|
||
expected_tables = ["customer", "invoice"] | ||
# only those tables in the schema | ||
assert set(t["name"] for t in pipeline.default_schema.data_tables()) == set( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: once this is merged: https://github.com/dlt-hub/dlt/pull/2566/files, you can use load_tables_to_dicts
instead
@ah12068 just tagging you here again, because I updated my earlier reply |
I finally had some time to look into this and thanks for the docs - turns out Intuit had a repo creating a sample app which implements the oAuth 2.0 flow. So i've de-django-fied the code (and credited) so that the auth process can obtain the relevant credentials automatically or easily used for end-users to obtain credentials to re-use that going forward. The reason for this approach is that i didn't quite understand the DLT implementation and encountered errors when trying to use it (kept raising that Let me know what you think |
This is my first open source contribution 🥳
This PR aims to add the QuickBooks online as a source, raised in issue #586
I am using python-quickbooks package (pypi / github) to create the DLT resource and pipeline
I've only done this for the
customer
object from quickbooks, and i'm aware that there are a lot more objects available. Hopefully it's a good start for others to contribute as well.Any feedback is appreciated.
Additional Context
To get set up and test
com.intuit.quickbooks.accounting
) and then click on 'Get authorization code'secrets.toml
also, REALM ID = COMPANY IDNotes
MetaData: {'CreateTime': 'YYYY-MM-DD'T'hh:mmTZD', 'LastUpdateTime': 'YYYY-MM-DD'T'hh:mmTZD'}
(ISO8601 format) and described in the underlying package docs