<commit_before>Ambry Client
=============

A client application for Ambry libraries. The client presents a simple interfaces that returns acessors objects,
providing a think attrubute interface on the dictionaries your normally get fro mdirectly converting the JSON
objects the library returns.

The `Client` object has these methods:

- `list()`: Return a list of  Dataset objects, one for each dataset in the library. The Dataset objects
    have a limited number of fields, fewer than those returned by `dataset()`
- :`dataset(ref)`: Return the file dataset, with all of the fields. Most significantly is the ``partitions`
    property, which holds records for all of the files in the dataset.

Example
-------

.. code-block:: python

    from ambry_client import Client
    import os

    base_url = 'http://localhost:8080'

    client = Client(base_url)

    for ds in client.list():

        print ds.vid, ds.title

        for p in ds.partitions:
            print '  ', p.vid, p.description

            fn = '{}.csv'.format(p.vid)

            if not os.path.exists(fn):
                p.write_csv(fn)<commit_msg>documentation<commit_after>Ambry Client
=============

A client application for Ambry libraries. The client presents a simple interfaces that returns acessors objects,
providing a think attrubute interface on the dictionaries your normally get fro mdirectly converting the JSON
objects the library returns.

The `Client` object has these methods:

- `list()` Return a list of  Dataset objects, one for each dataset in the library. The Dataset objects
    have a limited number of fields, fewer than those returned by `dataset()`
- `dataset(ref)` Return the file dataset, with all of the fields. Most significantly is the ``partitions`
    property, which holds records for all of the files in the dataset.

Example
-------

.. code-block:: python

    from ambry_client import Client
    import os

    base_url = 'http://localhost:8080'

    client = Client(base_url)

    for ds in client.list():

        print ds.vid, ds.title

        for p in ds.partitions:
            print '  ', p.vid, p.description

            fn = '{}.csv'.format(p.vid)

            if not os.path.exists(fn):
                p.write_csv(fn)
{'fraction_non_alphanumeric': 0.09131403118040089, 'fraction_numerical': 0.0035634743875278397, 'mean_word_length': 2.9472759226713534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1002146', 'n_tokens_mistral': 623, 'n_tokens_neox': 581, 'n_words': 265}