<commit_before>arrow client
============

In the latest release of python-apollo, we're happy to introduce
``arrow``, a CLI Apollo tool, very similar to `Galaxy's Parsec
<http://github.com/galaxy-iuc/parsec>`__.<commit_msg>more arrow docs<commit_after>Arrow
=====

In the latest release of python-apollo, we're happy to introduce
``arrow``, a CLI Apollo tool, very similar to `Galaxy's Parsec
<http://github.com/galaxy-iuc/parsec>`__.

This section will attempt to showcase "real-life" type examples where possible.

Create a Group
--------------

First, we'll create a group for our "university" users:

.. code-block:: shell

    $ arrow groups create_group university

And this returns to us metadata about the group:

.. code-block:: json

    {
        "publicGroup": false,
        "class": "org.bbop.apollo.UserGroup",
        "name": "university",
        "users": null,
        "id": 558319
    }


Now, let's find all users from a certain domain and add them to this group of "university" users. Maybe they need special permissions by default:

.. code-block:: shell

    arrow users get_users | \
        jq '.[] | select(.username | contains("@tamu.edu")) | .username' | \
        xargs -n1 arrow users add_to_group university

This will:

1. fetch all of the users
2. select those whose username (their email) contains "@tamu.edu"
3. Return all of the username attributes for those matching users
4. For every user, run ``arrow users add_to_group university <user_id>``

{'fraction_non_alphanumeric': 0.1227242076871207, 'fraction_numerical': 0.007417397167902899, 'mean_word_length': 3.4035608308605343, 'pattern_counts': {'":': 5, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, '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': '4574934', 'n_tokens_mistral': 459, 'n_tokens_neox': 430, 'n_words': 174}