<commit_before>=======
Options
=======

Slumber comes with only a couple options.

Authentication
==============

Out of the box Slumber should support any authentication method supported
by httplib2. These include Basic, Digest, WSSE, HMAC Digest and Google Account
Authentication. However only Basic and Digest get tested currently.

Specify Authentication
----------------------

Specifying authentication credentials is easy. When you create your slumber
api instance, instead of doing::

    api = slumber.API("http://path/to/my/api/")

You supply the username and password like::

    api = slumber.API("http://path/to/my/api/", authentication={"name": "myuser", "password": "<PASSWORD>"})

And slumber will attempt to use those credentials anytime it's told it is not authorized.

Serializer
==========

Slumber allows you to use either json or yaml as your serializer. It defaults to using
json. You can change this default by specifying a ``default_format`` argument to your
api class.::

    # Use Yaml instead of Json
    api = slumber.API("http://path/to/my/api/", default_format="yaml")

If you want to override the serializer for a particular request, you can do that as well::

    # Use Yaml instead of Json for just this request.
    api = slumber.API("http://path/to/my/api/") # Serializer defaults to Json
    api.resource_name(format="yaml").get() # Serializer will be Yaml
<commit_msg>change the options for the new style format<commit_after>=======
Options
=======

Slumber comes with only a couple options.

Authentication
==============

Out of the box Slumber should support any authentication method supported
by httplib2. These include Basic, Digest, WSSE, HMAC Digest and Google Account
Authentication. However only Basic and Digest get tested currently.

Specify Authentication
----------------------

Specifying authentication credentials is easy. When you create your slumber
api instance, instead of doing::

    api = slumber.API("http://path/to/my/api/")

You supply the username and password like::

    api = slumber.API("http://path/to/my/api/", authentication={"name": "myuser", "password": "<PASSWORD>"})

And slumber will attempt to use those credentials anytime it's told it is not authorized.

Serializer
==========

Slumber allows you to use either json or yaml as your serializer. It defaults to using
json. You can change this default by specifying a ``default_format`` argument to your
api class.::

    # Use Yaml instead of Json
    api = slumber.API("http://path/to/my/api/", format="yaml")

If you want to override the serializer for a particular request, you can do that as well::

    # Use Yaml instead of Json for just this request.
    api = slumber.API("http://path/to/my/api/") # Serializer defaults to Json
    api.resource_name(format="yaml").get() # Serializer will be Yaml

{'fraction_non_alphanumeric': 0.12491178546224418, 'fraction_numerical': 0.0007057163020465773, 'mean_word_length': 3.9562937062937062, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, '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': '6152477', 'n_tokens_mistral': 764, 'n_tokens_neox': 739, 'n_words': 339}