{ "info": { "author": "Paul Murphy", "author_email": "murphy@clarify.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "===============================\nClarify Python 2 Helper Library\n===============================\n\nPython 2.x helper library for the Clarify API\n\n* Free software: MIT license\n\nInstalling\n----------\n\n.. code-block:: bash\n\n $ pip install clarify_python_2\n\nYou may need to use sudo if you don't have permission to install.\n\nUpgrading\n---------\n\nIf you are running an older version of the python helper library, please upgrade.\n\n.. code-block:: bash\n\n $ pip install --upgrade clarify_python_2\n\nYou may need to use sudo if you don't have permission to upgrade.\n\nQuickstart Guide\n----------------\n\nGetting Started\n^^^^^^^^^^^^^^^\n\nThis quickstart demonstrates a simple way to get started using the Clarify API. Following these steps, it should take you no more than 5-10 minutes to have a fully functional search for your audio.\n\nConfiguring Your Environment\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nWhile you can use any programming language you choose, we provide helping libraries in a few to get you started. In Python, you simply include the Clarify file from the python_2 module, and initialize the environment with your API key:\n\n.. code-block:: python\n\n\tfrom clarify_python_2 import clarify\n\n\tclarify.set_key('my api key')\n\nLoading Audio\n^^^^^^^^^^^^^\n\nOnce you've initialied the environment with your API key, you load a file like this:\n\n.. code-block:: python\n\n\tclarify.create_bundle(name='test bundle', media_url='http://example.com/sample-audio-file.wav')\n\nNaming the bundle is optional. \n\nHere are some audio files you can use for testing:\n\n::\n\n\thttp://media.clarify.io/audio/samples/harvard-sentences-1.wav\n\thttp://media.clarify.io/audio/samples/harvard-sentences-2.wav\n\thttp://media.clarify.io/audio/books/dorothyandthewizardinoz_01_baum_64kb.mp3\n\nHint: You don't have to download these files. Instead you can pass us these urls via the create_bundle() method shown above.\n\t\nSearching Audio\n^^^^^^^^^^^^^^^\n\nTo search, we'll use the search() function. If you uploaded the *Wizard of Oz* audio clip, you can search for \"dorothy\":\n\n.. code-block:: python\n\n\tclarify.search(query='dorothy')\n\nThen you can process and interact the results however you wish. The code below simply shows the resulting bundle id, bundle name, and the start/end offsets for each occurrence of the search terms. This assumes that the audio clip has been indexed by the time you search. If it hasn't, wait and try again in a few minutes.\n\n.. code-block:: python\n\n\tresult = clarify.search(query='dorothy')\n\tresults = result['item_results']\n\titems = result['_links']['items']\n\n\tindex = 0\n\tfor item in items:\n\t bundle = clarify.get_bundle(item['href'])\n\n\t print bundle['name']\n\n \t search_hits = results[index]['term_results'][0]['matches'][0]['hits']\n \t for search_hit in search_hits:\n \tprint str(search_hit['start']) + ' -- ' + str(search_hit['end'])\n\n \t ++index\n\t\nAnd here are the results using the *Wizard of Oz* clip we loaded.\n\n::\n\n\tdorothy and her friends\n\t2.35 -- 2.59\n\t172.49 -- 172.83\n\t224.82 -- 225.08\n\t271.49 -- 271.8\n\t329.1 -- 329.31\n\t480.45 -- 480.92\n\nPutting it all Together\n^^^^^^^^^^^^^^^^^^^^^^^\n\nFrom here, we can visualize our search results with the included audio player. The player should work with no additional configuration, but the bulk of the logic is here:\n\n.. code-block:: python\n\n\timport json\n\n\tresult = clarify.search(query='dorothy')\n\tsearch_terms = json.dumps(result['search_terms'])\n\titem_results = json.dumps(result['item_results'])\n\n\tbundleref = result['_links']['items'][0]['href']\n\tbundle = clarify.get_bundle(bundleref)\n\ttracksref = bundle['_links']['clarify:tracks']['href']\n\ttracks = clarify.get_track_list(tracksref)['tracks']\n\tmediaURL = tracks[0]['media_url']\n\n\nHistory (Change Log)\n--------------------\n\nSee `HISTORY.rst `_\n\nTODO\n----\n\nSee `TODO.rst `_\n\n\n\n\n\nHistory\n-------\n\n1.0.0 (2014-08-26)\n++++++++++++++++++\n\n* Updated to the 1.0 API.\n* NB: The semantics of delete_track() have changed. delete_track() now takes an href to a track. To delte a track by index you now need to call delete_track_at_index().\n\n0.9.0 (2014-06-16)\n++++++++++++++++++\n\n* Removed 'source' attribute from bundle.\n\n0.8.0 (2014-05-04)\n++++++++++++++++++\n\n* Simplified initialization (and removed threading restriction).\n* Separated REST cover and object libraries.\n* Moved configuration variables into module's __init__.py file.\n\n0.7.0 (2014-04-30)\n++++++++++++++++++\n\n* New repo name.\n\n0.3.0 (2014-04-26)\n++++++++++++++++++\n\n* Code cleanup.\n* get_bundle_href() changed to get_self_href().\n* Switched to new style classes.\n\n0.1.0 (2014-04-20)\n++++++++++++++++++\n\n* First release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Clarify/clarify_python_2", "keywords": "clarify_python_2 clarify", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "clarify_python_2", "package_url": "https://pypi.org/project/clarify_python_2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/clarify_python_2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Clarify/clarify_python_2" }, "release_url": "https://pypi.org/project/clarify_python_2/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "The Clarify Python 2 Helper Library wraps the entire Clarify API in Python 2.x function calls.", "version": "1.0.1" }, "last_serial": 1308844, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c28f375641b81e6bb3d39756453fbf53", "sha256": "02cfdbe09e9ff0f802fc66ad4892806017c4bdbb539a432df26875aa00d6a1dd" }, "downloads": -1, "filename": "clarify_python_2-1.0.0.macosx-10.10-intel.exe", "has_sig": false, "md5_digest": "c28f375641b81e6bb3d39756453fbf53", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 76404, "upload_time": "2014-11-15T22:36:39", "url": "https://files.pythonhosted.org/packages/f7/82/b307c15b75721e4c5235d5ed219db152ac5b6c5b2a50d70d2cbf2587b253/clarify_python_2-1.0.0.macosx-10.10-intel.exe" }, { "comment_text": "", "digests": { "md5": "797ab20c10af38088f4f2ec7beb73225", "sha256": "436078f60dcfa902c3cb8d581b3d2b032cb64155b4c7d94198964e7f466a0d40" }, "downloads": -1, "filename": "clarify_python_2-1.0.0.tar.gz", "has_sig": false, "md5_digest": "797ab20c10af38088f4f2ec7beb73225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10060, "upload_time": "2014-11-15T22:20:37", "url": "https://files.pythonhosted.org/packages/c0/b9/8a4b693c592dcd9e452d01980a8b8e6e78486c3eabc4d5130e3d842ef5d4/clarify_python_2-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0f059c098658ae2ec39a35f8f21fd980", "sha256": "ea256ec751a4567e8d6aec9716740b6cf09b7c43da0befd762e609f5ac43f078" }, "downloads": -1, "filename": "clarify_python_2-1.0.1.macosx-10.10-intel.exe", "has_sig": false, "md5_digest": "0f059c098658ae2ec39a35f8f21fd980", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 76551, "upload_time": "2014-11-16T13:01:08", "url": "https://files.pythonhosted.org/packages/b0/9e/e4ba6e29355b31199aae4d0c3d4ea139af4d387474f4f5c886dd56e37f63/clarify_python_2-1.0.1.macosx-10.10-intel.exe" }, { "comment_text": "", "digests": { "md5": "48f1f0cd507d044f8c2f2854e5ba22da", "sha256": "f5faca800a37824a1c4363b1a4934c71c5ca29923e9f555ad132b14ea4953f11" }, "downloads": -1, "filename": "clarify_python_2-1.0.1.tar.gz", "has_sig": false, "md5_digest": "48f1f0cd507d044f8c2f2854e5ba22da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10202, "upload_time": "2014-11-16T01:49:07", "url": "https://files.pythonhosted.org/packages/05/fe/3bb75fc9e0b4e8461409b16e93470519e991915c68873516d0505863a0ee/clarify_python_2-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0f059c098658ae2ec39a35f8f21fd980", "sha256": "ea256ec751a4567e8d6aec9716740b6cf09b7c43da0befd762e609f5ac43f078" }, "downloads": -1, "filename": "clarify_python_2-1.0.1.macosx-10.10-intel.exe", "has_sig": false, "md5_digest": "0f059c098658ae2ec39a35f8f21fd980", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 76551, "upload_time": "2014-11-16T13:01:08", "url": "https://files.pythonhosted.org/packages/b0/9e/e4ba6e29355b31199aae4d0c3d4ea139af4d387474f4f5c886dd56e37f63/clarify_python_2-1.0.1.macosx-10.10-intel.exe" }, { "comment_text": "", "digests": { "md5": "48f1f0cd507d044f8c2f2854e5ba22da", "sha256": "f5faca800a37824a1c4363b1a4934c71c5ca29923e9f555ad132b14ea4953f11" }, "downloads": -1, "filename": "clarify_python_2-1.0.1.tar.gz", "has_sig": false, "md5_digest": "48f1f0cd507d044f8c2f2854e5ba22da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10202, "upload_time": "2014-11-16T01:49:07", "url": "https://files.pythonhosted.org/packages/05/fe/3bb75fc9e0b4e8461409b16e93470519e991915c68873516d0505863a0ee/clarify_python_2-1.0.1.tar.gz" } ] }