requests, the python package for HTTP/S
One of the most dumbfounding things I've encountered throughout my career is the python community's dogged persistence at avoiding using libcurl.
Ask HN: What open source project, in your opinion, has the highest code quality?
11–18 of 18 posts
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#12Earlier quoted context omitted.
One of the most dumbfounding things I've encountered throughout my career is the python community's dogged persistence at avoiding using libcurl.
What are the advantages of using libcurl over whatever requests does?
We're literally in the business of building on the work of others. Avoiding libcurl seems like an incredibly naive choice to me.
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#13requests, the python package for HTTP/S
One of the most dumbfounding things I've encountered throughout my career is the python community's dogged persistence at avoiding using libcurl.
import requests
body = requests.get('http://pycurl.io/')
Getting a resource with libcurl: import pycurl
from io import BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()
body = buffer.getvalue()Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#14Earlier quoted context omitted.
One of the most dumbfounding things I've encountered throughout my career is the python community's dogged persistence at avoiding using libcurl.
Getting a resource in requests: import requests body = requests.get('http://pycurl.io/') Getting a resource with libcurl: import pycurl from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) c.perform() c.close() body = buffer.getvalue()
I'd guess: because distributing packages with native dependencies is sort of a a pain, and was way worse in the past, especially cross-platform, and thus python-only packages are preferred. Leaves open why libcurl bindings weren't choosen for stdlib.
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#15Laravel is incredibly well crafted and documented, one of the highest quality OSS projects ever, IMHO.
Re: Ask HN: What open source project, in your opinion, has the highest code quality?
#16Earlier quoted context omitted.
One of the most dumbfounding things I've encountered throughout my career is the python community's dogged persistence at avoiding using libcurl.
Getting a resource in requests: import requests body = requests.get('http://pycurl.io/') Getting a resource with libcurl: import pycurl from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) c.perform() c.close() body = buffer.getvalue()
And while the requests library might be shorter/easier, it doesn't offer nearly the guarantees that it will exhibit the expected behavior nor the feature flexibility that libcurl does.