Giter Club home page Giter Club logo

fido's Introduction

Fido

https://travis-ci.org/Yelp/fido.svg?branch=master PyPI version Supported Python versions

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.