{ "info": { "author": "Wikimedia Foundation", "author_email": "e3-team@lists.wikimedia.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "umapi_client\n============\n\nClient wrapper for Wikipedia User Metrics API.\n\nSee https://github.com/wikimedia/user_metrics for UMAPI implementation.\n\nUsage\n-----\n\nSet the ``UMAPI_USER`` and ``UMAPI_PASS`` in ``umapi_client/config.py``\n(copied from ``umapi_client/config.py.settings``). Ensure that\n``call_client`` is executable and requests are invoked by simply\ncalling this script followed by the URL path and parameters of a request. Only\ncached responses will return a response with JSON, otherwise the request will\nbe queued by the service.\n\n\n RFaulkner-WMF:umapi_client rfaulkner$ cd umapi_client/\n RFaulkner-WMF:umapi_client rfaulkner$ ./scripts/call_client \"cohorts/\\\n ryan_test_2/bytes_added\"\n {\n \"cohort\": \"ryan_test_2\",\n \"group\": \"default\",\n \"cohort_last_generated\": \"2013-03-19 07:43:26\",\n \"aggregator\": \"None\",\n \"metric\": \"bytes_added\",\n \"namespace\": [\n 0\n ],\n \"project\": \"enwiki\",\n \"time_of_response\": \"2013-03-19 07:43:32\",\n \"datetime_start\": \"2010-10-25 08:00:00\",\n \"datetime_end\": \"2011-01-01 00:00:00\",\n \"header\": [\n \"user_id\",\n \"bytes_added_net\",\n \"bytes_added_absolute\",\n \"bytes_added_pos\",\n \"bytes_added_neg\",\n \"edit_count\"\n ],\n \"type\": \"raw\",\n \"data\": {\n \"15972203\": [\n 683,\n 1133,\n 908,\n -225,\n 5\n ],\n \"13234584\": [\n 0,\n 0,\n 0,\n 0,\n 0\n ],\n \"15972135\": [\n 0,\n 0,\n 0,\n 0,\n 0\n ]\n },\n \"interval_hours\": 24,\n \"t\": 24\n }\n\nTo save the contents to a file [-s] and timestamp the file [-t]:\n\n RFaulkner-WMF:umapi_client rfaulkner$ ./scripts/call_client \"cohorts/\\\n ryan_test_2/bytes_added\" -s -t\n Mar-29 12:47:33 DEBUG __main__ :: Attempting to create cookie jar,\n logging in ..\n Mar-29 12:47:34 DEBUG __main__ :: Login successful. Making request:\n http://metrics.wikimedia.org/cohorts/ryan_test_2/bytes_added\n Mar-29 12:47:35 DEBUG __main__ :: Writing response to file:\n umapi_client_ryan_test_2_bytes_added_20130329.json\n RFaulkner-WMF:umapi_client rfaulkner$ cat umapi_client_ryan_test_2_bytes_\\\n added_20130329.json\n {\n \"cohort\": \"ryan_test_2\",\n \"group\": \"default\",\n \"cohort_last_generated\": \"2013-03-29 19:40:19\",\n \"aggregator\": \"None\",\n \"metric\": \"bytes_added\",\n \"namespace\": [\n 0\n ],\n \"project\": \"enwiki\",\n \"time_of_response\": \"2013-03-29 19:40:26\",\n \"datetime_start\": \"2010-10-25 08:00:00\",\n \"datetime_end\": \"2011-01-01 00:00:00\",\n \"header\": [\n \"user_id\",\n \"bytes_added_net\",\n \"bytes_added_absolute\",\n \"bytes_added_pos\",\n \"bytes_added_neg\",\n \"edit_count\"\n ],\n \"type\": \"raw\",\n \"data\": {\n \"15972203\": [\n 683,\n 1133,\n 908,\n -225,\n 5\n ],\n \"13234584\": [\n 0,\n 0,\n 0,\n 0,\n 0\n ],\n \"15972135\": [\n 0,\n 0,\n 0,\n 0,\n 0\n ]\n },\n \"interval_hours\": 24,\n \"t\": 24\n }\n\nTo convert the output to csv:\n\n RFaulkner-WMF:scripts rfaulkner$ ./json2csv umapi_client_ryan_test_2_bytes_added_20130331.json\n Mar-31 23:57:20 DEBUG __main__ :: Attempting to read file...\n Mar-31 23:57:20 DEBUG __main__ :: Writing to file...\n RFaulkner-WMF:scripts rfaulkner$ cat ../../csv/umapi_client_ryan_test_2_bytes_added_20130331.json.csv\n user_id,bytes_added_net,bytes_added_absolute,bytes_added_pos,bytes_added_neg,edit_count\n 13234584,0,0,0,0,0\n 15972203,683,1133,908,-225,5\n 15972135,0,0,0,0,0", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.github.com/rfaulkner/umapi_client", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "wmf_umapi_client", "package_url": "https://pypi.org/project/wmf_umapi_client/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wmf_umapi_client/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.github.com/rfaulkner/umapi_client" }, "release_url": "https://pypi.org/project/wmf_umapi_client/0.1.1-dev/", "requires_dist": null, "requires_python": null, "summary": "Client wrapper for Wikimedia UMAPI.", "version": "0.1.1-dev" }, "last_serial": 801699, "releases": { "0.1.1-dev": [ { "comment_text": "built for Darwin-11.4.2", "digests": { "md5": "168da9c8ac2806502c56c2e4179ba643", "sha256": "823cf17f9719a0948915a0c819c0e46664ae86af5cd7908a045bb5dc3e61ea47" }, "downloads": -1, "filename": "wmf_umapi_client-0.1.1-dev.macosx-10.7-intel.tar.gz", "has_sig": false, "md5_digest": "168da9c8ac2806502c56c2e4179ba643", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 4873, "upload_time": "2013-04-02T17:52:33", "url": "https://files.pythonhosted.org/packages/01/a2/0e3929c31abf9ffe2e6aad363f5013704ce1d2983bb66e77747e4e32dfc7/wmf_umapi_client-0.1.1-dev.macosx-10.7-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "e84006cdff74d62a0cf9cff61908031c", "sha256": "50dba42ce88396f2718d05376fe5c7a47f42101dc0ec4fc497c38ede6b50c0a7" }, "downloads": -1, "filename": "wmf_umapi_client-0.1.1-dev.tar.gz", "has_sig": false, "md5_digest": "e84006cdff74d62a0cf9cff61908031c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3445, "upload_time": "2013-04-02T17:52:36", "url": "https://files.pythonhosted.org/packages/59/78/558429e0a4ad41923f98a29e3fd68852069c20e013c0896b8df34e307127/wmf_umapi_client-0.1.1-dev.tar.gz" } ] }, "urls": [ { "comment_text": "built for Darwin-11.4.2", "digests": { "md5": "168da9c8ac2806502c56c2e4179ba643", "sha256": "823cf17f9719a0948915a0c819c0e46664ae86af5cd7908a045bb5dc3e61ea47" }, "downloads": -1, "filename": "wmf_umapi_client-0.1.1-dev.macosx-10.7-intel.tar.gz", "has_sig": false, "md5_digest": "168da9c8ac2806502c56c2e4179ba643", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 4873, "upload_time": "2013-04-02T17:52:33", "url": "https://files.pythonhosted.org/packages/01/a2/0e3929c31abf9ffe2e6aad363f5013704ce1d2983bb66e77747e4e32dfc7/wmf_umapi_client-0.1.1-dev.macosx-10.7-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "e84006cdff74d62a0cf9cff61908031c", "sha256": "50dba42ce88396f2718d05376fe5c7a47f42101dc0ec4fc497c38ede6b50c0a7" }, "downloads": -1, "filename": "wmf_umapi_client-0.1.1-dev.tar.gz", "has_sig": false, "md5_digest": "e84006cdff74d62a0cf9cff61908031c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3445, "upload_time": "2013-04-02T17:52:36", "url": "https://files.pythonhosted.org/packages/59/78/558429e0a4ad41923f98a29e3fd68852069c20e013c0896b8df34e307127/wmf_umapi_client-0.1.1-dev.tar.gz" } ] }