Intelligent asynchronous HTTP client
Project description
Introduction
Fido is a simple, asynchronous HTTP client built on top of Crochet and Twisted with an implementation inspired by the book “Twisted Network Programming Essentials”. It is intended to be used in environments where there is no event loop, and where you cannot afford to spin up lots of threads (otherwise you could just use a ThreadPoolExecutor).
Here is an example of using Fido:
future = fido.fetch('http://www.foo.bar') # Work happens in a background thread... response = future.result(timeout=2) print response.body
Frequently Asked Questions
Do you support SSL?
Yes, although this has not been vetted by security professionals. One should use this functionality at their own risk. In more detail: Fido uses the Twisted defaults, which delegate to pyOpenSSL and service_identity for the actual SSL work.
Is the API stable?
Probably not. However, it is currently very simple, so it shouldn’t be hard to upgrade code if there’s a non backwards-compatible change.
Do I need to initialize Crochet?
No, crochet.setup is automatically invoked by fido.fetch.
How do I use an http_proxy?
Just set the http_proxy (all lowercase) environment variable to the URL of the http proxy before starting your python process.
Example:
$ export http_proxy="http://localhost:8000" $ python -c "import fido; print fido.fetch("http://www.yelp.com").result().body
Installation
Fido can be installed using pip install, like so:
$ pip install --upgrade fido
License
Copyright (c) 2015, Yelp, Inc. All rights reserved. Apache v2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fido-3.2.0.tar.gz
.
File metadata
- Download URL: fido-3.2.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f17be67032bf1fbb0d0f3effc7a625130b177f912b85ba2e83d65c94b0b4d2c |
|
MD5 | ca98a69bf40a9e0c922a0ae3764065c3 |
|
BLAKE2b-256 | 77f5186f0de18b0c608e421152e732c09823069544fa1cc73627494abd7fb5e2 |