-
Notifications
You must be signed in to change notification settings - Fork 15
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
merge with https://github.com/emscripten-forge/requests-wasm-polyfill #6
Comments
Thanks for reaching out! This sounds like a great idea. I believe I need to read a bit more about It seems For the I was thinking about multiple packages:
Curious to your vision on merging both packages! |
Hi @koenvo (and @DerThorsten), I've had a feature request to add requests API wrapper to pyodide (or just downstream to pyscript, as that's where I would like to use it). The idea would be to provide a familiar API for python devs. Although I would prefer it to be async or at least optionally async, but pyodide dev seemed to think it should not be async (follow requests API 1 to 1). See issue: pyodide/pyodide#3160 My idea was to build a wrapper around pyodide.pyfetch (or just fetch api) to correspond to the BASIC requests API. Step 1 would be just to have the familiar API from: https://github.com/psf/requests/blob/main/requests/api.py and the return types etc. can be fixed to follow The idea was inspired by me writing this how-to guide for pyscript: https://docs.pyscript.net/latest/howtos/http-requests.html I am wondering how close The usecase I have in mind is: from pyodide-http import requests
requests.get(...) Although the name should be changed :P to avoid confusion with importing actual pyodide-http imo. :P Finally, two questions:
|
@emirkmo i totally missed your comment here. Sorry about that. I’m still a bit busy but will respond asap. |
Hi @emirkmo, Thanks for your message. I agree on the need to change the name of this package. Let me create a issue for that to make sure I don't forget what needs to be done when renaming a package. Some larges projects, like Panel, are already using this package and don't want to break something there. You blog looks very interesting! In a browser context it makes a lot of sense to use async code for network requests instead of blocking the main thread. This does also require people to write all their code async as there is no way to make async calls synchronous. When people do network requests in their own code they should use async calls. A lot of packages do synchronous calls and therefore require a patch to make them work in pyodide environments. The main purpose if this package - right now - is to make those packages work without having the end-user to do anything expect call a I do think it makes a lot of sense to have a single package that can do the patching and provide a replacement for Maybe a wild idea, but an option could be to include a replacement for And finally: this package is already used in pyscript. See #20 (comment) |
Hi, I am the author of https://github.com/emscripten-forge/requests-wasm-polyfill where we do essentially the same but for
emscripten-forge
instead ofpyodide
.Maybe we can merge these two libraries into a single one.
Greetings Thorsten
The text was updated successfully, but these errors were encountered: