{ "info": { "author": "Andrew Droffner", "author_email": "adroffner@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Python Software Foundation License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "=====================\nEcho StreamServer API\n=====================\n\nThis is a Python version of the **Echo StreamServer API**. See the Echo Developers_ Documentation.\n\nFunction Interface\n==================\n\nThe *function* interface provides each **API** as a simple *module* or *package*. The **API** uses the **Default Account** to contact **Echo**. For example, the **Items API** is **echo.items** and has the **REST API** methods.\n\n>>> # Items API: Count EQL Query\n>>> from echo import items, StreamServerError\n>>> try:\n>>> n = items.count(\"scope:http//example.com/\\*\")\n>>> print \"EQL Count: %d\" % n\n>>> except StreamServerError, e:\n>>> print \"Error: %s\" % str(e)\n\nDefault Account\n---------------\n\nThe **Default Account** is part of the **echo.settings** module. Set the **Echo** *appkey* and *secret* API_Keys there.\n\n::\n /usr/lib/python2.x/site-packages/echo/settings.py\n\nClient Interface\n================\n\nThe **Client** interface provides each **API** as a class *instance*. The **Client** uses an **Account** object to contact **Echo**, or the default. For example, the **Key-Value Store API** is **echo.kvs.Client** and has the **KVS API** methods.\n\n>>> # KVS Client API: Get a value for the key 'sample'.\n>>> from echo import kvs, StreamServerError\n>>> # Create a KVS client using the default account.\n>>> client = kvs.Client()\n>>> try:\n>>> v = client.get('sample')\n>>> print \"KVS: %r\" % v\n>>> except StreamServerError, e:\n>>> print \"Error: %s\" % str(e)\n\nAccount Objects\n===============\n\nEach **Client** *instance* can use an **Account** object to contact **Echo**. This is required to support *multiple* **Echo** accounts.\n\n>>> from echo import feeds, Account\n>>> # Non-default account: Login Account.BasicAuth with no secret\n>>> other_account = Account('test.echoenabled.com', '', Account.BasicAuth)\n>>> client = feeds.Client(account=other_account)\n\nMUX Requests\n============\n\nThe **Items API** supports **MUX**, or *multiplexed* requests. Several **count** and **search** requests can be combined into one **REST** call. The **items.mux** method sends a list of **MuxRequest** objects to **Echo**. See the **Echo** mux_ method documentation for the output format.\n\n>>> from echo import items\n>>> from echo.items.mux_api import MuxRequest\n>>> # EQL Query String\n>>> query_eql = \"scope:http://www.example.com/\\*\"\n>>> # Search Query (default)\n>>> search = MuxRequest(query_eql)\n>>> # Count Query\n>>> count = MuxRequest(query_eql, api_method='count')\n>>> # Form list of them for Mux API.\n>>> requests = [ search, count ]\n>>> # Send Mux API requests.\n>>> r = items.mux(requests)\n\nEcho Query Language Builder\n===========================\n\nThere is an *object-oriented* **Echo Query Language API** to build query strings. An **echo.eql.Query** object may be passed to the **Items API** methods **eql.items.count** and **eql.items.search** rather than query text. Add **echo.eql.filters** to build on the query terms and produce a complete EQL_ query string.\n\nEQL Syntax Limitations\n----------------------\n\nThis **EQL Builder** *does not guarantee* that the *whole* EQL text is valid. Each *term* is valid alone but **Echo StreamServer** still may reject the EQL string. **EQL syntax** rules limit how a **Query** and its **filters** can be constructed. Print the **echo.eql.Query** object to inspect its query string and *reorder* filter terms as necessary.\n\nQuery Method API\n----------------\n\nBuild an **echo.eql.Query** object using method calls. Add **echo.eql.filters.QueryFilter** objects to limit the results. Most **QueryFilter** objects can be *negated* to exclude the term.\n\n>>> from echo import eql\n>>> q = eql.Query(\"http://site.example.com/index.html\", uri_filter='url')\n>>> q.add_filter(eql.filters.ChildrenDepth(3))\n>>> q.add_filter(eql.filters.TypeFilter('article'), negate=True)\n>>> print \"EQL> \", q\nEQL> \"url:\"http://site.example.com/index.html\" children:3 -type:article\"\n\nQuery Operator API\n------------------\n\nAdd *filters* to an **echo.eql.Query** object using boolean operators. Read the **echo.eql.filters** documentation for more details.\n\n>>> from echo import eql\n>>> q = eql.Query(\"http://www.example.com/movies//\")\n>>> # Exclude articles and notes with (-).\n>>> q = q - eql.filters.TypeFilter(['article', 'note'])\n>>> # Allow children up to depth 2.\n>>> q + (eql.filters.ChildrenDepth(2))\n\n======== ======= ===========\necho.eql.Query Operators\n------------------------------\noperator example description\n======== ======= ===========\nplus + q + r **Add** filter r to query q.\nminus - q - r **Negate** filter r on query q.\nand & q1 & q2 Combine queries q1 **and** q2.\npipe | q1 | q2 Select query q1 **or** q2.\n======== ======= ===========\n\n======== ======= ===========\necho.eql.filters Operators\n------------------------------\noperator example description\n======== ======= ===========\nminus - -r **Negate** filter r.\nand & r1 & r2 Combine filters r1 **and** r2.\npipe | r1 | r2 Apply filter r1 **or** r2.\n======== ======= ===========\n\n.. _Developers: http://echoplatform.com/streamserver/docs/rest-api/\n.. _mux: http://echoplatform.com/streamserver/docs/rest-api/other-api/mux/\n.. _EQL: http://echoplatform.com/streamserver/docs/features/echo-query-language/", "description_content_type": null, "docs_url": null, "download_url": "https://code.google.com/p/python-echo-streamserver/downloads/list", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://code.google.com/p/python-echo-streamserver/", "keywords": null, "license": "PSF Licensed", "maintainer": null, "maintainer_email": null, "name": "python-echo-streamserver", "package_url": "https://pypi.org/project/python-echo-streamserver/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-echo-streamserver/", "project_urls": { "Download": "https://code.google.com/p/python-echo-streamserver/downloads/list", "Homepage": "http://code.google.com/p/python-echo-streamserver/" }, "release_url": "https://pypi.org/project/python-echo-streamserver/0.84/", "requires_dist": null, "requires_python": null, "summary": "Echo StreamServer API Client", "version": "0.84" }, "last_serial": 1394393, "releases": { "0.83": [ { "comment_text": "", "digests": { "md5": "d5603efef0d0898097e7eb101fec7dd0", "sha256": "55b4977d73ec10c2f7be68d31456ec9e25ec6a965411df0a1378c90bfaff418f" }, "downloads": -1, "filename": "python-echo-streamserver-0.83.tar.gz", "has_sig": false, "md5_digest": "d5603efef0d0898097e7eb101fec7dd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26051, "upload_time": "2013-10-18T18:11:43", "url": "https://files.pythonhosted.org/packages/55/8d/265269673fcad483f407f42b2433f7f3eb3c9a243ebe497b2974116e3bc0/python-echo-streamserver-0.83.tar.gz" } ], "0.84": [ { "comment_text": "", "digests": { "md5": "13c954d5d0fdab5acdc7ed75dbfc0eb6", "sha256": "74a1b79de9a9bc2418c9ca677d59be46c5b9855d00dcae1324e50a1a4ce365d8" }, "downloads": -1, "filename": "python-echo-streamserver-0.84.tar.gz", "has_sig": false, "md5_digest": "13c954d5d0fdab5acdc7ed75dbfc0eb6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26994, "upload_time": "2015-01-24T05:25:16", "url": "https://files.pythonhosted.org/packages/1f/27/c9082652b9e47aa25593d70bc557c516398e76ab665fb4b2f0124299cd4f/python-echo-streamserver-0.84.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "13c954d5d0fdab5acdc7ed75dbfc0eb6", "sha256": "74a1b79de9a9bc2418c9ca677d59be46c5b9855d00dcae1324e50a1a4ce365d8" }, "downloads": -1, "filename": "python-echo-streamserver-0.84.tar.gz", "has_sig": false, "md5_digest": "13c954d5d0fdab5acdc7ed75dbfc0eb6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26994, "upload_time": "2015-01-24T05:25:16", "url": "https://files.pythonhosted.org/packages/1f/27/c9082652b9e47aa25593d70bc557c516398e76ab665fb4b2f0124299cd4f/python-echo-streamserver-0.84.tar.gz" } ] }