Can you recommend some Python HTTP client library? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I want to use Python to capture info from some websites.
I want the HTTP client to meet this conditions:
Supports HTTPS
Will not use too much memory, should not generate a lot of processes or threads.
Has clear documentation and is actively supported
I know that requests, tornado, or the gevent -httpclient
can finish my task, but I do not know which is the best? Or is there some other choices?
Or if there is some other choices written in C/c++.

Use requests. It has the most same API of the various libraries.

Another option is httplib2.
simple (and therefore efficient)
supports everything one needs and Python 3
not on Github
few months may pass before next commit (partly because it just works)

here's another suggestions:
GRequests allows you to use Requests with Gevent to make asynchronous HTTP Requests easily.
httplib2
Requests
treq

I find urllib3 is a great option. It sets up request pooling for you and handles SSL easily.
Also I think requests now uses it under the hood.
http://urllib3.readthedocs.io/en/latest/

Related

Alternatives to Python's ftplib? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm looking for an alternative to python's ftplib, for speed purposes. When performing FTP uploads, python's ftplib.FTP.storbinary does sequential read to memory then send to server, in chunks of a specified block size, until the file is uploaded. Because of this, it's simply not very fast. Ideally a thread would constantly be reading at least one block size ahead, and another thread would always be sending the block already in memory. The speed of python itself could also be a factor, but in any case Ubuntu's native FTP client (command line) uploads ~60% faster.
I had considered using Ubuntu's native FTP client through a python subprocess, but I really want the callback feature supported by ftplib to update the upload progress of a single file every block size (calls a python function pointer after each block is sent). Additionally, it's a little tricky to call Ubuntu's native FTP client from python, since it's intended to be interactive.
So...does anyone have any suggestions for an FTP client in python that supports a callback feature and is faster than python's ftplib? I'm open to compiled C/C++ libraries that are already setup with a python wrapper.
Edit: I just came across pycurl, which may fit the bill. Somehow didn't see that one before. Still happy to hear other suggestions!
I think pycURL would be one of your best options. I have found another question on this site from a while back that agrees to this. The question is not exactly the same as yours, but maybe it will help you out.
Here is the link to that question: Python Libraries for FTP Upload/Download?

Testing REST API [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am developing a REST API on Django. What do other uses to craft json msgs to test? Is there a browser plugin, python lib, curl, something else?
If you want to write Python try using the Requests library to do some basic testing from the client side. There is a CLI tool based on this called httpie that you might also want to check out. You can also use curl for testing if you prefer the command line but it is probably easier to use Requests in the long run from Python code if you are dealing with a more complex API or want to do anything repeatedly.
The Python 2.6+ standard library includes the json module which should help you create some JSON objects to do testing.
Here is a link to the documentation: http://docs.python.org/library/json.html
JSON is simple because you have a choice of JSON libraries to use in Python. Before you choose, read this article http://deron.meranda.us/python/comparing_json_modules/ because I suspect that you will find it very useful to use a strict parser for your testing. The benchmarks may be outdated, but the strict validating parsers are unlikely to have been superceded.
Write some Python code that acts as a web client, using a library like httplib2 to access your app. If your like a lot of people and all of your JSON is a single Javascript object, then you could keep your test data in any old database such as SQLite, read it into a Python dict, and encode it into a JSON object with one function call. Then for the actual test, after you receive a JSON reply, decode it into a dict and you have a normal Python object to use for comparisons.

Is there a Python library available for (gasp) ACT? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
A client is asking that I write a script to periodically pull his contacts from Google into ACT on his local computer. Is there a library that would allow me to interact with something as old as ACT?
Looks like you might be able to simply use an ODBC connection as outlined in this article: How To Create An ODBC Connection For Use With The ACT! Reader Utility
Alternatively if you need to bare-metal it, you could try ctypes, or leverage IronPython.
Just came across this while looking for something else and thought I'd add a more conclusive and update answer.
With versions since v11 in 2013, it's now got the ability to sync contacts/activities with Google out of the box. http://kb.act.com/app/answers/detail/a_id/27988
Even more power over the past year - http://kb.act.com/app/answers/detail/a_id/38991
Exporting from Act! versions 7/8 or later can be done via a number of methods:
OLEDB, ODBC (or direct access to SQL with the later versions), SDK, WebAPI, or a number of third-party tools that already pull everything to Excel (or other formats).
I did a presentation of the various options some time ago, posted here:
https://blog.glcomputing.com.au/2009/07/connecting-to-act-by-sage-data.html

Twitter Streaming API Python library with proxy support? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am looking for a Twitter Streaming API Python library with proxy support. I love tweepy, but unfortunately I haven't seen a way to use an HTTP proxy. Any ideas?
Check this tweepy commit; it uses urllib2 for executing APIMethods through proxies.
Tweepy uses httplib internally which is too low level to have proxy settings. You have to change Stream._run() method to connect to proxy instead of target host and use full (with scheme and host) URL in request.

Bottle-friendly WSGI authentication library/middleware [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What I need is a lightweight authentication/ACL library or middleware which is preferably capable of openID (though this is not crucial), and would play nice with bottle framework (i.e, maybe not use exceptions as an internal flow-control mechanism). Any suggestions?
EDIT:
Any thoughts on barrel?
I suggest you look to repoze.who for authentication and repoze.what for authorization. Both of them are designed to be generic WSGI middleware and easily can work with any of WSGI frameworks.
Another option for authentication with bottle is to use the cork plugin. I've used it successfully, and it has several database (and even a non-database) backends.

Categories