<commit_before>Balast client-side load-balancing
=================================

.. image:: https://img.shields.io/pypi/v/balast.svg
   :target: https://testpypi.python.org/pypi/balast

.. image:: https://img.shields.io/pypi/status/balast.svg
   :target: https://testpypi.python.org/pypi/balast

.. image:: https://travis-ci.org/RadishLLC/balast.svg?branch=master
   :target: https://travis-ci.org/RadishLLC/balast

.. image:: https://coveralls.io/repos/github/RadishLLC/balast/badge.svg?branch=master
   :target: https://coveralls.io/github/RadishLLC/balast?branch=master

.. image:: https://readthedocs.org/projects/balast/badge/?version=latest
   :target: http://balast.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

Framework for client-side load-balancing for inter-process
communication between cloud services.

It is inspired in large part by Netflix's
`Ribbon <https://github.com/Netflix/ribbon>`_ for java.

How to Use
---------------
In its most basic form, you can create a `balast.Service` with a static list of servers::

    >>> import balast
    >>> my_service = balast.Service(['127.0.0.1', '127.0.0.2'])

Now, just use it as you would use the `requests <http://docs.python-requests.org/en/master/user/quickstart/#make-a-request>`_
package::

    >>> response = my_service.get('/v1/path/to/resource')
    <Response[200]>

**NOTE:** at this point in time, only the basic api features from the
`requests <http://docs.python-requests.org/en/master/user/quickstart/#make-a-request>`_ package are supported.<commit_msg>README updated - syntax highlighting for code blocks<commit_after>Balast client-side load-balancing
=================================

.. image:: https://img.shields.io/pypi/v/balast.svg
   :target: https://testpypi.python.org/pypi/balast

.. image:: https://img.shields.io/pypi/status/balast.svg
   :target: https://testpypi.python.org/pypi/balast

.. image:: https://travis-ci.org/RadishLLC/balast.svg?branch=master
   :target: https://travis-ci.org/RadishLLC/balast

.. image:: https://coveralls.io/repos/github/RadishLLC/balast/badge.svg?branch=master
   :target: https://coveralls.io/github/RadishLLC/balast?branch=master

.. image:: https://readthedocs.org/projects/balast/badge/?version=latest
   :target: http://balast.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

Framework for client-side load-balancing for inter-process
communication between cloud services.

It is inspired in large part by Netflix's
`Ribbon <https://github.com/Netflix/ribbon>`_ for java.

How to Use
---------------
In its most basic form, you can create a `balast.Service` with a static list of servers:

.. code-block:: python

    >>> import balast
    >>> my_service = balast.Service(['127.0.0.1', '127.0.0.2'])

Now, just use it as you would use the `requests <http://docs.python-requests.org/en/master/user/quickstart/#make-a-request>`_
package:

.. code-block:: python

    >>> response = my_service.get('/v1/path/to/resource')
    <Response[200]>

**NOTE:** at this point in time, only the basic api features from the
`requests <http://docs.python-requests.org/en/master/user/quickstart/#make-a-request>`_ package are supported.
{'fraction_non_alphanumeric': 0.17985611510791366, 'fraction_numerical': 0.010009383797309979, 'mean_word_length': 4.020408163265306, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5640137', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1049, 'n_words': 219}