{ "info": { "author": "Paul Murphy", "author_email": "paul@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 :: 3" ], "description": ".. image:: https://travis-ci.org/Clarify/clarify_python.svg\n :target: https://travis-ci.org/Clarify/clarify_python\n\n===============================\nClarify Python (3.x and 2.7) Helper Library\n===============================\n\nPython 3.x and 2.7 helper library for the Clarify API\n\nNB: Version 2.x of this library is _not_ compatible with version 1.x.\n\n* Free software: MIT license\n\nInstalling\n----------\n\n.. code-block:: bash\n\n $ pip install clarify_python\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\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 module, and initialize a Client object with your API key:\n\n.. code-block:: python\n\n\tfrom clarify_python import clarify\n\n\tclient = clarify.Client('my_api_key')\n\nLoading Audio\n^^^^^^^^^^^^^\n\nOnce you've initialized a Client object, you load a file like this:\n\n.. code-block:: python\n\n\tclient.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\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\tclient.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 = client.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 = client.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\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 = client.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 = client.get_bundle(bundleref)\n\ttracksref = bundle['_links']['clarify:tracks']['href']\n\ttracks = client.get_track_list(tracksref)['tracks']\n\tmediaURL = tracks[0]['media_url']\n\n\nScripts\n----------\n\nYou can retrieve all your data from Clarify by running the clarify_export script. This will fetch all bundles, tracks, metadata, and insights and write all the JSON to files on your local disk.\n\n.. code-block:: bash\n\n $ CLARIFY_API_KEY=your-key clarify_export output_folder\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\n3.1.1 (2018-09-28)\n* Added captions to clarify_export script\n\n3.1.0 (2016-10-26)\n* Added Python 2.7 support\n\n3.0.2 (2016-04-27)\n* Added clarify_export script\n\n3.0.1 (2016-01-05)\n* Maintenance\n\n3.0.0 (2015-12-01)\n++++++++++++++++++\n\n* BREAKING CHANGE: client.bundle_list_map(func) The func is now called\nwith client as the first parameter.\n* Added insight access methods.\n* Support for requesting non-autorun insights (ex. transcripts and captions)\n* Support for embedding insights when requesting bundles.\n* Support for external_id when creating or updating bundles.\n* Added behave tests.\n* Added unittests.\n\n2.0.0 (2015-04-18)\n++++++++++++++++++\n\n* All deprecated code removed.\n\n1.1.1 (2015-04-18)\n++++++++++++++++++\n\n* Deprecated use of set_key() in favor of Client class.\n\n1.1.0 (2015-03-08)\n++++++++++++++++++\n\n* Switched from http.client to urllib3.\n* Eliminated support for setting HTTP debug level. Use Runscope.\n\n1.0.4 (2015-03-08)\n++++++++++++++++++\n\n* Added get_item_hrefs() utility function.\n* Utility function cleanup.\n\n1.0.3 (2015-03-07)\n++++++++++++++++++\n\n* Fixed some encoding bugs.\n\n1.0.2 (2015-03-07)\n++++++++++++++++++\n\n* Version increment to work around a PyPI bug. Identical to 1.0.1.\n\n1.0.1 (2015-03-07)\n++++++++++++++++++\n\n* Version increment to work around a PyPI bug. Identical to 1.0.0.\n\n1.0.0 (2015-03-07)\n++++++++++++++++++\n\n* Port of 1.0.1 python 2 code.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Clarify/clarify_python", "keywords": "clarify_python clarify", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "clarify_python", "package_url": "https://pypi.org/project/clarify_python/", "platform": "", "project_url": "https://pypi.org/project/clarify_python/", "project_urls": { "Homepage": "https://github.com/Clarify/clarify_python" }, "release_url": "https://pypi.org/project/clarify_python/3.1.1/", "requires_dist": null, "requires_python": "", "summary": "The Clarify Python Helper Library wraps the entire Clarify API in a Python 3.x / 2.7 Client class.", "version": "3.1.1" }, "last_serial": 4324574, "releases": { "1.0.1": [], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3adfb4f4847c466a4b3a697362abd946", "sha256": "4ccd97df79575a96784130d730acf683391f41b70add5b910f80445e931666a8" }, "downloads": -1, "filename": "clarify_python-1.0.2.tar.gz", "has_sig": false, "md5_digest": "3adfb4f4847c466a4b3a697362abd946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10393, "upload_time": "2015-03-07T22:17:13", "url": "https://files.pythonhosted.org/packages/13/e5/f45a1ae43058304c5bdf97a9ec836497dbf36d2790aab774cc70de048739/clarify_python-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "d2bc1a1d92722686f07e49277165a6da", "sha256": "9d5c694093fb187780e0c48c74909343139f9b9499c3ae4a14933e9012728b46" }, "downloads": -1, "filename": "clarify_python-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d2bc1a1d92722686f07e49277165a6da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10380, "upload_time": "2015-03-08T00:01:21", "url": "https://files.pythonhosted.org/packages/2f/0d/a2c72e6abaebd0053a752940fc5138026057b17953d97c8b9908b80b4d98/clarify_python-1.0.3.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3b66442db818e25475a0976e7e50ab26", "sha256": "ff03d3d2a1d95dd20f42b1b2217c58d2eef1b1b8be76a9b1b0fd0f0662f01ac5" }, "downloads": -1, "filename": "clarify_python-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3b66442db818e25475a0976e7e50ab26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11024, "upload_time": "2015-03-08T20:08:52", "url": "https://files.pythonhosted.org/packages/72/f5/4f21d3caa966dd3159754cf360fc264b586bab1c9740308f5274141a609b/clarify_python-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "adaeecd0db6c630711afbb3a5b47ea11", "sha256": "6e1ec1120cf3313ee2498d273ec35bfed36b675a62be9425494b52b973dd6e3b" }, "downloads": -1, "filename": "clarify_python-1.1.1.tar.gz", "has_sig": false, "md5_digest": "adaeecd0db6c630711afbb3a5b47ea11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13244, "upload_time": "2015-04-18T22:16:03", "url": "https://files.pythonhosted.org/packages/2a/7c/401fc9b8f6e652e04890018f7a5ae2d2a0346b2f577dd6b769ddd377ae03/clarify_python-1.1.1.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "cc9e0f0688f1b96abb683b576728dccf", "sha256": "b8f2a2f3acd6aa2e2023b6bfbddfb32ca963dec85c70a74f64fbc9399de93744" }, "downloads": -1, "filename": "clarify_python-2.0.0.tar.gz", "has_sig": false, "md5_digest": "cc9e0f0688f1b96abb683b576728dccf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11224, "upload_time": "2015-04-18T22:35:19", "url": "https://files.pythonhosted.org/packages/d1/97/0a3e9b1173a0f1ab247c1caf882e9e58d2401800d35ce5753e0c0915c04e/clarify_python-2.0.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "87f839dc39f3b4a21800463af1658652", "sha256": "d5cf1d77846d162fa929547d8128566931f9757fa564504f197f7c6713fc80f3" }, "downloads": -1, "filename": "clarify_python-3.0.1.tar.gz", "has_sig": false, "md5_digest": "87f839dc39f3b4a21800463af1658652", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15479, "upload_time": "2016-01-29T00:40:10", "url": "https://files.pythonhosted.org/packages/b8/55/7c12402d6e4f5cf5f2f24d1db976bb9b4f044bbca247c8405770167fbf26/clarify_python-3.0.1.tar.gz" } ], "3.0.2": [ { "comment_text": "", "digests": { "md5": "45dcb0600e21522e1b8ffec7adc43615", "sha256": "bd40df02b57cdb2001c9dd30d4d14a80fe187be24d65d264c524efe61fb0d072" }, "downloads": -1, "filename": "clarify_python-3.0.2.tar.gz", "has_sig": false, "md5_digest": "45dcb0600e21522e1b8ffec7adc43615", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16104, "upload_time": "2016-04-27T22:18:10", "url": "https://files.pythonhosted.org/packages/cc/0b/bc60d3af3a6e2fc3c52df7471321b6fc3a696cc93bd540ac38f4e9afb8fe/clarify_python-3.0.2.tar.gz" } ], "3.1.0": [ { "comment_text": "", "digests": { "md5": "e83f98bdb99bdc47f1ca88004d2e4ab0", "sha256": "fdb4e1eef248d8ed3157e29da734fd84c3abe4f3ace5f83520d00cdbb53010d7" }, "downloads": -1, "filename": "clarify_python-3.1.0.tar.gz", "has_sig": false, "md5_digest": "e83f98bdb99bdc47f1ca88004d2e4ab0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16273, "upload_time": "2016-10-26T17:42:59", "url": "https://files.pythonhosted.org/packages/99/5d/5d64b4afc3942a76c06b8987ddafceeb18389045a80ae6af6757474b7550/clarify_python-3.1.0.tar.gz" } ], "3.1.1": [ { "comment_text": "", "digests": { "md5": "7b7f121ac1dcce96da3df62d589882a0", "sha256": "da956cba901dddd340e369be825b1358066954f395b393ff14ef4dd8fd7536ff" }, "downloads": -1, "filename": "clarify_python-3.1.1.tar.gz", "has_sig": false, "md5_digest": "7b7f121ac1dcce96da3df62d589882a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16471, "upload_time": "2018-09-30T08:58:52", "url": "https://files.pythonhosted.org/packages/49/48/46afb39fcddc8aa278b87ede9de7d977d9f2f6727733d06dc686b9baa8e0/clarify_python-3.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7b7f121ac1dcce96da3df62d589882a0", "sha256": "da956cba901dddd340e369be825b1358066954f395b393ff14ef4dd8fd7536ff" }, "downloads": -1, "filename": "clarify_python-3.1.1.tar.gz", "has_sig": false, "md5_digest": "7b7f121ac1dcce96da3df62d589882a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16471, "upload_time": "2018-09-30T08:58:52", "url": "https://files.pythonhosted.org/packages/49/48/46afb39fcddc8aa278b87ede9de7d977d9f2f6727733d06dc686b9baa8e0/clarify_python-3.1.1.tar.gz" } ] }