{ "info": { "author": "Jaime Gil de Sagredo Luna", "author_email": "jaimegildesagredo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Finch: RESTful API consumer\n===========================\n\n.. image:: https://secure.travis-ci.org/jaimegildesagredo/finch.png?branch=master\n :target: http://travis-ci.org/jaimegildesagredo/finch\n\nFinch is an asynchronous `RESTful API` consumer for Python. Finch is focused on remove all of the boilerplate related to consuming http based APIs and provide a high level abstraction to develop API clients. Finch is released under the `Apache 2 license `_, so you can `fork `_, `contribute `_ and also `report errors and suggestions `_ to improve it.\n\nUsage\n=====\n\nTo start consuming a REST API you first should define the resources you are going to consume. For resources modeling we use the `booby `_ data modeling library. So, for example, to get your repos from `github.com` you should define the `Repo` model and the `Repos` collection.\n\n.. code-block:: python\n\n from booby import Model, fields\n from finch import Collection\n\n class Repo(Model):\n id = fields.Integer()\n name = fields.String()\n owner = fields.String()\n is_private = fields.Boolean()\n\n def parse(self, body, headers):\n return parse_repo(json.loads(body))\n\n def __repr__(self):\n return 'Repo({}/{})'.format(self.owner, self.name)\n\n class Repos(Collection):\n model = Repo\n\n def __init__(self, username, *args, **kwargs):\n self.username = username\n\n super(Repos, self).__init__(*args, **kwargs)\n\n @property\n def url(self):\n return 'https://api.github.com/users/{}/repos'.format(self.username)\n\n def parse(self, body, headers):\n return [parse_repo(r) for r in json.loads(body)]\n\n\n def parse_repo(raw):\n return {\n 'id': raw['id'],\n 'name': raw['name'],\n 'owner': raw['owner']['login'],\n 'is_private': raw['private']\n }\n\nNow you can fetch your public repos (and also your private repos if you're authenticated).\n\n.. code-block:: python\n\n from tornado import httpclient, ioloop\n\n def on_repos(repos, error):\n ioloop.IOLoop.instance().stop()\n\n if error:\n raise error\n\n for repo in repos:\n print repo\n\n repos = Repos('jaimegildesagredo', httpclient.AsyncHTTPClient())\n repos.all(on_repos)\n\n ioloop.IOLoop.instance().start()\n\nInstallation\n============\n\nYou can install the last stable release of Finch from PyPI using pip or easy_install.\n\n.. code-block:: bash\n\n $ pip install finch\n\nAlso you can install the latest sources from Github.\n\n.. code-block:: bash\n\n $ pip install -e git+git://github.com/jaimegildesagredo/finch.git#egg=finch\n\nTests\n=====\n\nTo run the Finch tests suite you should install the development requirements and run nosetests.\n\n.. code-block:: bash\n\n $ pip install -r requirements-devel.txt\n $ nosetests tests/unit\n\nStatus\n======\n\nFinch is under active development and there is not a complete documentation yet. By the moment you can read the examples in this repository and read the tests, that are the most up to date documentation. Also I'm working on create a complete API client using Finch and create a good documentation.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "finch", "package_url": "https://pypi.org/project/finch/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/finch/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/finch/0.3.3/", "requires_dist": null, "requires_python": null, "summary": "Asynchronous RESTful API consumer for Python", "version": "0.3.3" }, "last_serial": 875437, "releases": { "0.3.1": [], "0.3.2": [ { "comment_text": "", "digests": { "md5": "63cb19a1ab8a96bf991dfa349261cc66", "sha256": "3423aa55eee515c1a985e552ac9c2dee11f9b5f36066b428d51102526130e819" }, "downloads": -1, "filename": "finch-0.3.2.tar.gz", "has_sig": false, "md5_digest": "63cb19a1ab8a96bf991dfa349261cc66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3511, "upload_time": "2013-03-01T18:16:44", "url": "https://files.pythonhosted.org/packages/8a/b1/e5ad44e30ced5c35cb9a686440425e5f3243fc70ba16ed935723e5d86a71/finch-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "fdf6f1bbb97316481a04707476ccc414", "sha256": "97515a2302ba7c307297ac33a45f6a4a9a341ef7f3ed82db0fa5af53a2caee58" }, "downloads": -1, "filename": "finch-0.3.3.tar.gz", "has_sig": false, "md5_digest": "fdf6f1bbb97316481a04707476ccc414", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4983, "upload_time": "2013-09-27T16:00:57", "url": "https://files.pythonhosted.org/packages/c0/e9/eb127214211f48aafc7945c7655c79a20c8bd7c986353b33e51821113bc4/finch-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fdf6f1bbb97316481a04707476ccc414", "sha256": "97515a2302ba7c307297ac33a45f6a4a9a341ef7f3ed82db0fa5af53a2caee58" }, "downloads": -1, "filename": "finch-0.3.3.tar.gz", "has_sig": false, "md5_digest": "fdf6f1bbb97316481a04707476ccc414", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4983, "upload_time": "2013-09-27T16:00:57", "url": "https://files.pythonhosted.org/packages/c0/e9/eb127214211f48aafc7945c7655c79a20c8bd7c986353b33e51821113bc4/finch-0.3.3.tar.gz" } ] }