-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add RESTClient #1141
Add RESTClient #1141
Conversation
✅ Deploy Preview for dlt-hub-docs canceled.
|
@rudolfix I've put it in |
@burnash what I think is missing for internal testing is a simplified from source.helpers import requests
requests.paginate(url, method, auth=str | AuthBase | AuthBase(), paginator = str | Paginator | Paginator(), ....) auth and paginators follow the same convention as destinations, progress, naming convention str - a short hand alias ie or type auth and paginators can be configured [source.chargebee.paginator]
cursor_field="..."
cursor_param="cursor"
[source.chargebee.auth]
api_key="...." where to put REST client: current location is good. let's write some code and maybe we'll change it |
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.
this is good! we are missing
- tests for requests.paginated shorthand
- some initial documentation (maybe page in docs but not linked to index yet)
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.
LGTM! let' work on it in followup PRs
There are tests for that in the |
3c104bb
to
b1ee49a
Compare
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.
pls see one comment
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.
LGTM!
Description
This pull request introduces a
RESTClient
class along with supporting components to interact with RESTful APIs. The RESTClient provides:HeaderLinkPaginator
,JSONResponsePaginator
.BearerTokenAuth
,HttpBasicAuth
, etc.)Users are able to customize request handling, response parsing, and data extraction according to the specifics of the target API.
RESTClient
also features automatic paginator detection with thePaginatorFactory
Example usage:
Related Issues
rest_api
source from Implement a basic generic API client verified-sources#313