Metadata-Version: 1.1
Name: timevortex.timeserieslogger
Version: 2.1.0
Summary: Python script that store timeseries in TSV files.
Home-page: https://github.com/liogen/timevortex.timeserieslogger
Author: Pierre Leray
Author-email: pierreleray64@gmail.com
License: MIT
Description: ===========================
        timevortex.timeserieslogger
        ===========================
        
        .. image:: http://img.shields.io/travis/timevortexproject/timevortex.timeserieslogger.png?branch=master
            :target: https://travis-ci.org/timevortexproject/timevortex.timeserieslogger
            :alt: Travis CI Build Status
        
        .. image:: http://img.shields.io/pypi/v/timevortex.timeserieslogger.png
            :target: https://pypi.python.org/pypi/timevortex.timeserieslogger
            :alt: Latest Version
        
        .. image:: http://img.shields.io/pypi/dm/timevortex.timeserieslogger.png
            :target: https://pypi.python.org/pypi/timevortex.timeserieslogger
            :alt: Downloads
        
        .. image:: http://img.shields.io/badge/license-MIT-red.png
            :target: https://github.com/timevortexproject/timevortex.timeserieslogger
            :alt: License
        
        ---------
        
        TimeVortex module to write timeseries into TSV files.
        
        This module is one of the main module of timevortex project. It collects every timeseries messages sent on the RabbitMQ network like devices consumptions informations, devices events or devices connections errors and store this timleseries in TSV files for further analysis. 
        
        For example, this module let us collecting timeseries from `timevortex currencost module <https://pypi.python.org/pypi/timevortex.currentcost>`_ and store them into TSV files.
        
        For more information, full documentation is available on `readthedocs.org <http://timevortextimeserieslogger.readthedocs.org/en/latest/>`_
        
        Installation
        ------------
        
        Requirements:
        
          * Platform: Unix (only tested on Ubuntu 12.04)
          * Python 2.7
          * Pip (last version)
          * RabbitMQ (last version)
        
        To install this software, you need to install python 2.7 and pip
        
        .. code-block:: bash
          
          sudo apt-get install python python-pip
          sudo pip install --upgrade pip
        
        Then, you have to install and configure RabbitMQ (change "admin" and "password" by your credential)
        
        .. code-block:: bash
          
          USERNAME="admin"
          PASSWORD="password" 
          echo "deb http://www.rabbitmq.com/debian/ testing main" > sudo /etc/apt/sources.list.d/rabbitmq.list
          wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
          sudo apt-key add rabbitmq-signing-key-public.asc
          sudo apt-get update
          sudo apt-get install rabbitmq-server -y
          sudo service rabbitmq-server start
          sudo rabbitmq-plugins enable rabbitmq_management
          # If you get a 'command not found' error for this line, use: 
          # sudo /usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
          # sudo /usr/lib/rabbitmq/bin/rabbitmq-activate-plugins enable rabbitmq_management
          sudo rabbitmqctl add_user $USERNAME $PASSWORD
          sudo rabbitmqctl set_permissions -p / $USERNAME ".*" ".*" ".*"
          sudo rabbitmqctl delete_user guest
          sudo service rabbitmq-server restart
        
        Finally, you can install timevortex.timeserieslogger
        
        .. code-block:: bash
          
          sudo pip install timevortex.timeserieslogger
        
        To verify version of timevortex.timeserieslogger installed package
        
        .. code-block:: bash
          
          pip show timevortex.timeserieslogger
        
        Usage
        -----
        
        .. code-block:: bash
            
            $ sudo timevortex-timeserieslogger -h
            usage: timevortex-timeserieslogger [-h] [-v] [-c CONFIG_FILE]
        
            optional arguments:
              -h, --help            show this help message and exit
              -v, --verbose         activate verbose mode
              -c CONFIG_FILE, --config-file CONFIG_FILE
                                    path to configuration file
        
        By default:
        
        * Configuration file is located in /opt/timevortex/config.ini. You can override configuration file using -c option with a path to your new config file.
        
        Configuration file
        ------------------
        
        To configure easily your file, you will need to read our `Comparison and relation between data collected by a sensor and data representing a physical timeseries <http://timevortex.readthedocs.org/en/latest/presentation.html#sites-and-variables>`_
        
        Basicaly, to configure your timevortex.timeserieslogger, we will have to enter RabbitMQ credential and location, daily-report option if you want a daily report e-mail with the number of data stored for the previous day and folder where to store data.
        
        .. code-block:: ini
        
          [timevortex_timeserieslogger]
          # Option to be set at True if you want a daily-report. False or empty if you do not want it.
          activate_daily_report = True
          # Receiver e-mail of daily-report
          daily_report_target = <ENTER_HERE_YOUR_EMAIL_ADDRESS>
          # Site_id to be watched by daily-report
          daily_report_site = system,<ENTER_HERE_YOUR_HOME_SITE_ID>
          # Log configuration file
          log_file = /opt/timevortex/timevortex-timeserieslogger.conf
        
          [timevortex_messager]
          # RabbitMQ credentials
          rabbitmq_username = <ENTER_RABBIT_MQ_USERNAME_HERE>
          rabbitmq_password = <ENTER_RABBIT_MQ_PASSWORD_HERE>
          rabbitmq_host = <ENTER_RABBIT_MQ_HOST_HERE>
          # Gmail account used to send mail for daily-report
          gmail_username = <ENTER_GMAIL_USERNAME_HERE>
          gmail_password = <ENTER_GMAIL_PASSWORD_HERE>
        
          [timevortex_filestorage]
          # Folder where to store data
          data_folder = /opt/timevortex/data
        
        Examples
        --------
        
        To listen on RabbitMQ port and see message in terminal with daily-report activated:
        
        In config file:
        
        .. code-block:: ini
        
          [timevortex_timeserieslogger]
          activate_daily_report = True
          daily_report_target = me@gmail.com
          daily_report_site = system,my_home
          log_file = /opt/timevortex/timevortex-timeserieslogger.conf
        
          [timevortex_messager]
          rabbitmq_username = admin
          rabbitmq_password = password
          rabbitmq_host = localhost
          gmail_username = timevortex
          gmail_password = timevortex
        
          [timevortex_filestorage]
          data_folder = /opt/timevortex/data
        
        In terminal:
        
        .. code-block:: bash
            
            $ sudo timevortex-timeserieslogger -v
            {"variableID": "electric_meter", "dstTimezone": "UTC", "siteID": "liogen_home", "date": "2014-04-25T12:00:17.754959", "value": "CurrentCost electric_meter in liogen_home: TTY connection problem: /dev/currentcost is unreachable. Retry connection in 5 seconds.", "nonDstTimezone": "UTC"} 
            {"variableID": "global", "dstTimezone": "UTC", "siteID": "liogen_home", "date": "2014-04-25T12:00:22.769256", "value": "12", "nonDstTimezone": "UTC"}
            {"variableID": "living_room_tmpr", "dstTimezone": "UTC", "siteID": "liogen_home", "date": "2014-04-25T12:00:22.769256", "value": "20.3", "nonDstTimezone": "UTC"}
        
        Message receive through RabbitMQ
        --------------------------------
        
        Two kinds of messages are actually waited by timevortex-timeserieslogger:
        
        * Error messages with "error" topic
        * Timeseries messages with "timeseries" topic
        
        This table summarize message receive and according action expected.
        
        +-------------+---------------------------------+---------------------------------------------------+ 
        | Topic       | Message                         | Actions                                           |
        +=============+=================================+===================================================+ 
        | timeseries  | all kinds of timeseries         | Store value and date of timeseries message in TSV |
        |             |                                 | file in <siteID> folder in <variableID>.tsv.<date>|
        |             |                                 | file.                                             |
        +-------------+---------------------------------+---------------------------------------------------+
        | error       | all kinds of errors messages    | Store this error in TSV file in <siteID folder>   |
        |             |                                 | in error.tsv.<date> file.                         |
        +-------------+---------------------------------+---------------------------------------------------+
        
        Message send through RabbitMQ
        -----------------------------
        
        None
        
        Contribute
        ----------
        
        I am more than happy to accept external contributions like feedback, bug reports and pull requests. 
        
        Do not hesitate to post an `issue <https://github.com/timevortexproject/timevortex.timeserieslogger/issues>`_ if you have any problem to install or to use this software.
        
        You can also use this way to ask for features request. I am also available to answer you on `Stack Overflow <http://stackoverflow.com/questions/tagged/timevortex.timeserieslogger>`_
        
        Here is the development process to test and validate your features.
        
        1. Prepare your development environment:
        
            .. code-block:: bash
        
                $ sudo apt-get install vim git-core
                # Install virtualenv and virtualenvwrapper if it's not done.
                $ sudo pip install virtualenvwrapper
                $ mkdir ~/.virtualenvs
                $ vim ~/.bashrc
                # Modify your ~/.bashrc and add this 2 lines:
                # export WORKON_HOME=~/.virtualenvs
                # source /usr/local/bin/virtualenvwrapper.sh
                $ bash
        
        2. Go on `github <https://github.com/liogen/timevortex.timeserieslogger>`_ and fork this project.
        
        3. Clone it on your conputer:
        
            .. code-block:: bash
        
                $ cd <your_workspace>
                $ git clone git@github.com:<username>/timevortex.timeserieslogger.git
                $ git checkout develop
        
        4. Prepare your virtualenv
        
            .. code-block:: bash
        
                $ mkvirtualenv timevortex
                (timevortex)$ pip install paver
                (timevortex)$ paver prepare
        
        5. Add functional or unit tests
        
        6. Code your features
        
        7. To validate your implementation, launch:
        
            .. code-block:: bash
        
                (timevortex)$ paver validate
        
        8. Modify Todo, Changelog and update documentation
        
        9. Commit and push on github:
        
            .. code-block:: bash
        
                (timevortex)$ git add .
                (timevortex)$ git commit -a -m "<your commit message>"
                (timevortex)$ git push origin develop  
        
        10. Propose a pull request on github
        
        License
        -------
        
        The MIT License (MIT)
        
        Copyright (c) 2014 Pierre Leray
        
        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.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Home Automation
Classifier: License :: OSI Approved :: MIT License
