<commit_before>Redi: Redis Awesomeness
=======================

Redi is Redis that's ready for Python. It's powered by redis-py, and it's awesome.

Essentially, **redi** allows you to interact with your Redis datatypes as if they were native Python objects.


Features
--------

- Pythonic interface to Redis keys/values.
- Everything is automatically serialized to JSON. This is configurable.
- ^^ Including custom objects.
- Limited type-specific search.



Usage
-----

**Simple value interface.**

  - Resis Value as a List: ::

      import redi

      d = redi.value('haystack:metalist')

      d.append(dict(blah='blah'))
      d.append([1,2,3,4])

      # redis: "[{\"blah\": \"blah\"}, [1, 2, 3, 4]]"


  - Resis Value as a Dict: ::

      d = redi.value('haystack:metadict')

      d.data = {}

      d.data['timestamp'] = datetime.now().isoformat()
      d.data['values'] = [12, 82, 248.2]

      # redis: "{\"timestamp\": \"2011-04-09T03:39:03.204597\", \"values\": [  12, 82, 248.2]}"


**Simple list interface.** ::


    students = redi.list('haystack:students')

    print students[3].get('last_name')
    del students[3]
<commit_msg>read it<commit_after>Redi: Redis Awesomeness
=======================

Redi is Redis that's ready for Python. It's powered by redis-py, and it's awesome.

Essentially, **redi** allows you to interact with your Redis datatypes as if they were native Python objects.


Features
--------

- Pythonic interface to Redis keys/values.
- Everything is automatically serialized to JSON. This is configurable.
- ^^ Including custom objects.
- Limited type-specific search.



Usage
-----

**Simple value interface.**

- Resis Value as a List: ::

    import redi

    d = redi.value('haystack:metalist')

    d.append(dict(blah='blah'))
    d.append([1,2,3,4])

    # redis: "[{\"blah\": \"blah\"}, [1, 2, 3, 4]]"


- Resis Value as a Dict: ::

    d = redi.value('haystack:metadict')

    d.data = {}

    d.data['timestamp'] = datetime.now().isoformat()
    d.data['values'] = [12, 82, 248.2]

    # redis: "{\"timestamp\": \"2011-04-09T03:39:03.204597\", \"values\": [  12, 82, 248.2]}"


**Simple list interface.** ::


    students = redi.list('haystack:students')

    print students[3].get('last_name')
    del students[3]

{'fraction_non_alphanumeric': 0.18766519823788547, 'fraction_numerical': 0.04052863436123348, 'mean_word_length': 3.0698924731182795, 'pattern_counts': {'":': 6, '<': 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': '440267', 'n_tokens_mistral': 860, 'n_tokens_neox': 759, 'n_words': 215}