Metadata-Version: 1.1
Name: techies
Version: 0.1.0
Summary: Opinionated Python toolbox
Home-page: https://github.com/woozyking/techies
Author: Runzhou Li (Leo)
Author-email: runzhou.li@gmail.com
License: Copyright (c) 2014 Runzhou Li

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Description: techies
        =======
        
        Opinionated Python toolbox
        
        List of Tools
        -------------
        
        1. Redis backed ``techies.landmines.Queue``, (almost) Python standard
           ``Queue`` compatible, the main difference is that it's semi-persisted
           in Redis.
        2. Redis backed ``techies.landmines.UniQueue``, a ``Queue``
           implementation that keeps only distinct items.
        
        Prerequisites
        -------------
        
        -  Redis server
        
        Installation
        ------------
        
        ::
        
            $ pip install techies
            $ pip install techies --upgrade  # to update
        
        Usage
        -----
        
        ``Queue``
        
        .. code:: python
        
            from techies.landmines import Queue
        
            q = Queue(key='demo_q', host='localhost', port=6379, db=0)
        
            # put, or enqueue
            print(q.put('lol'))  # 1L
            print(q.put('dota'))  # 2L
            print(q.put('skyrim'))  # 3L
            print(q.put('dota'))  # 4L
            # Queue.put returns the queue size at that moment
        
            # Check size of the queue, two ways
            print(q.qsize())  # 4
            print(len(q))  # 4
        
            # get, or dequeue
            print(q.get())  # 'lol'
            print(q.get())  # 'dota'
            print(q.get())  # 'skyrim'
            print(q.get())  # 'dota'
            print(q.get())  # NoneType
        
            # clear the queue
            q.clear()
        
        ``UniQueue``
        
        .. code:: python
        
            from techies.landmines import UniQueue
        
            q = UniQueue(key='demo_q', host='localhost', port=6379, db=0)
        
            # put, or enqueue
            print(q.put('lol'))  # 1
            print(q.put('dota'))  # 1
            print(q.put('skyrim'))  # 1
            print(q.put('dota'))  # 0
            # UniQueue.put returns 1 on success, 0 otherwise; such as duplicated item
        
            # Check size of the unique queue, two ways
            print(q.qsize())  # 3
            print(len(q))  # 3
        
            # get, or dequeue
            print(q.get())  # 'lol'
            print(q.get())  # 'dota'
            print(q.get())  # 'skyrim'
            print(q.get())  # NoneType
            print(q.get())  # NoneType
        
            # clear the queue
            q.clear()
        
        Test (Unit Tests)
        -----------------
        
        To run unit tests locally, make sure that you have Redis server
        installed and running
        
        ::
        
            $ pip install -r requirements.txt
            $ pip install -r test_requirements.txt
            $ nosetests --with-coverage --cover-package=techies
        
        License
        -------
        
        The MIT License (MIT). See the full
        `LICENSE <https://github.com/woozyking/techies/blob/master/LICENSE>`__.
        
        Changelog
        ---------
        
        0.1.0 (2014-01-16)
        ~~~~~~~~~~~~~~~~~~
        
        -  Initial release with Redis backed ``Queue`` and ``UniQueue``
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
