<commit_before>umapi_client
============

Client wrapper for Wikipedia User Metrics API.

See https://github.com/rfaulkner/E3_analysis
<commit_msg>mod. update README.<commit_after>umapi_client
============

Client wrapper for Wikipedia User Metrics API.

See https://github.com/wikimedia/user_metrics for UMAPI implementation.

Usage
-----

Set the ``UMAPI_USER`` and ``UMAPI_PASS`` in ``umapi_clinet/config.py``
(copied from ``umapi_clinet/config.py.settings``).  Ensure that
``call_client`` is executable and requests are invoked by simply
calling this script followed by the URL path and parameters of a request. Only
cached responses will return a response with JSON, otherwise the request will
be queued by the service. ::


    RFaulkner-WMF:umapi_client rfaulkner$ cd umapi_client/
    RFaulkner-WMF:umapi_client rfaulkner$ ./call_client cohorts/ryan_test_2/\
    bytes_added
    {
      "cohort": "ryan_test_2",
      "group": "default",
      "cohort_last_generated": "2013-03-19 07:43:26",
      "aggregator": "None",
      "metric": "bytes_added",
      "namespace": [
        0
      ],
      "project": "enwiki",
      "time_of_response": "2013-03-19 07:43:32",
      "datetime_start": "2010-10-25 08:00:00",
      "datetime_end": "2011-01-01 00:00:00",
      "header": [
        "user_id",
        "bytes_added_net",
        "bytes_added_absolute",
        "bytes_added_pos",
        "bytes_added_neg",
        "edit_count"
      ],
      "type": "raw",
      "data": {
        "15972203": [
          683,
          1133,
          908,
          -225,
          5
        ],
        "13234584": [
          0,
          0,
          0,
          0,
          0
        ],
        "15972135": [
          0,
          0,
          0,
          0,
          0
        ]
      },
      "interval_hours": 24,
      "t": 24
    }

{'fraction_non_alphanumeric': 0.13416621401412276, 'fraction_numerical': 0.060836501901140684, 'mean_word_length': 2.080267558528428, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4564662', 'n_tokens_mistral': 677, 'n_tokens_neox': 599, 'n_words': 143}