Metadata-Version: 1.0
Name: gnippy
Version: 0.3.0
Summary: Python library for GNIP.
Home-page: http://pypi.python.org/pypi/gnippy/
Author: Abhinav Ajgaonkar
Author-email: abhinav316@gmail.com
License: Copyright 2012-2013 Abhinav Ajgaonkar

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Description: gnippy: Python library for GNIP
        ===============================
        
        gnippy provides an easy way to access the `Power Track <http://gnip.com/twitter/power-track/>`_ stream provided by GNIP.
        You can also use gnippy to programatically add rules to your Power Track stream.
        
        Installation:
        
        .. code-block:: python
        
            pip install gnippy
        
        Quickstart:
        
        Create a .gnippy file and place it in your home directory. It should contain the following:
        
        .. code-block:: text
        
            [Credentials]
            username = user@company.com
            password = mypassword
        
            [PowerTrack]
            url = https://my.gnip.powertrack/url.json
        
        Fire up the client:
        
        .. code-block:: python
        
            #!/usr/bin/env python
            import time
            from gnippy import PowerTrackClient
        
            # Define a callback
            def callback(activity):
                print activity
        
            # Create the client
            client = PowerTrackClient(callback)
            client.connect()
            
            # Wait for 2 minutes and then disconnect
            time.sleep(120)
            client.disconnect()
        
        If you don't want to create a config file or you want it put it in another location:
        
        .. code-block:: python
        
            client = PowerTrackClient(callback, url = "http://my.gnip.powertrack/url.json", auth = ('MyUserName', 'MyPassword'))
            # OR
            client = PowerTrackClient(callback, config_file_path="/etc/gnippy")
        
        
        If you want to add `rules <http://support.gnip.com/customer/portal/articles/477713-rules-methods-documentation>`_ to your PowerTrack:
        
        .. code-block:: python
        
            from gnippy import rules
            from gnippy.errors import RuleAddFailedException
        
            # Add a
            try:
                rules.add_rule('(Hello OR World OR "this is a test") AND lang:en', tag="MyRule") # The tag is optional
            except RuleAddFailedException:
                pass # uh oh
        
            # OR ... add multiple rules at once
            rule_list = []
            rule_list.append(rules.build_rule("Hello World", tag="asdf"))
            rule_list.append(rules.build_rule("Rule Without a Tag"))
            try:
                rules.add_rules(rule_list)
            except RuleAddFailedException:
                pass # uh oh
        
        Source available on GitHub: http://github.com/abh1nav/gnippy/
        
Platform: UNKNOWN
