-
Notifications
You must be signed in to change notification settings - Fork 19
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 ZYTE_API_ENABLED #40
Conversation
Codecov Report
@@ Coverage Diff @@
## main #40 +/- ##
==========================================
+ Coverage 99.31% 99.34% +0.03%
==========================================
Files 3 3
Lines 145 152 +7
==========================================
+ Hits 144 151 +7
Misses 1 1
|
README.rst
Outdated
} | ||
} | ||
The ``ZYTE_API_ENABLED`` setting can be used to control whether all, none, or | ||
some requests go through Zyte Data API. It supports the following values: |
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.
I think it might be better to have a separate option for enabling all requests to go through Zyte API, because of the following reasons:
- Usually ..._ENABLED options just turn on/off the middleware.
- It may also be tricky to set this setting to None from the command line, if I recall correctly.
- We shoud consider future Zyte API features, with data extraction use cases: if user only wants the extraction features, they'd need to set ZYTE_API_ENABLED to None, which is a bit strange.
- Instead of relying on the user to specify correct request parameters to use Zyte API as a downloader, it'd be nice to set them on our side. This may involve not only passing static default parameters, but also taking request method, body and headers in account.
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.
3 is not fully clear to me, but I don’t think it matters at this point.
Shall we deal with 4 on a follow-up pull request, or here? I would love to work on it, but I also would like to discuss the API a bit before working on an implementation.
Feel free to suggest alternatives to |
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 @Gallaecio !
Closing in favor of #41 |
Resolves #12