Metadata-Version: 2.3
Name: volttron-sqlite-historian
Version: 2.0.0rc2
Summary: VOLTTRON historian that store data in sqlite3 database
License: Apache-2.0
Author: VOLTTRON Team
Author-email: volttron@pnnl.gov
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: volttron-lib-sql-historian (>=2.0.0rc2)
Project-URL: Homepage, https://github.com/VOLTTRON/volttron-sqlite-historian
Project-URL: Repository, https://github.com/VOLTTRON/volttron-sqlite-historian
Description-Content-Type: text/markdown

[![Eclipse VOLTTRON™](https://img.shields.io/badge/Eclips%20VOLTTRON--red.svg)](https://volttron.readthedocs.io/en/latest/)
![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)
![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)
[![Run Pytests](https://github.com/eclipse-volttron/volttron-sqlite-historian/actions/workflows/run-test.yml/badge.svg)](https://github.com/eclipse-volttron/volttron-sqlite-historian/actions/workflows/run-test.yml)
[![pypi version](https://img.shields.io/pypi/v/volttron-sqlite-historian.svg)](https://pypi.org/project/volttron-sqlite-historian/)
![Passing?](https://github.com/VOLTTRON/volttron-sqlite-historian/actions/workflows/run-tests.yml/badge.svg)

VOLTTRON historian agent that stores data into a SQLite database

## Pre-requisite

Before installing this agent, VOLTTRON (>=11.0.0rc0) should be installed and running.  Its virtual environment should be active.
Information on how to install of the VOLTTRON platform can be found
[here](https://github.com/eclipse-volttron/volttron-core/tree/v10)

## Installation

1. Create a agent configuration file 
   SQLite historian supports two parameters
    
    - connection -  This is a mandatory parameter with type indicating the type of sql historian (i.e. sqlite) and params 
                    containing the path the database file.
    
    - tables_def - Optional parameter to provide custom table names for topics, data, and metadata.
    - You can also override any parameter defined by base historian. See configuration of [base historian class](https://eclipse-volttron.readthedocs.io/en/latest/external-docs/volttron-lib-base-historian/index.html#configuration)
    
    The configuration can be in a json or yaml formatted file.

    Example Yaml Format:

    ```yaml
    connection:
      # type should be sqlite
      type: sqlite
      params:
        # Relative to the agents data directory
        database: "data/historian.sqlite"
    
      tables_def:
        # prefix for data, topics, and (in version < 4.0.0 metadata tables)
        # default is ""
        table_prefix: ""
        # table name for time series data. default "data"
        data_table: data
        # table name for list of topics. default "topics"
        topics_table: topics
    ```

   Example JSON format:
   ```json
   {
     "connection":{
     "type": "sqlite",
     "params":{
      "database": "/home/chandrika/sqlite-historian4.sqlite"
     }
     },
       "tables_def":
       {
        "table_prefix": "p1",
        "data_table": "new_data",
        "topics_table": "new_topics"
       },
     "custom_topics": {
            "capture_record_data": ["heartbeat"]
      }
   }
   ```
    
1. Install and start the volttron-sqlite-historian.
   
   - You can either pass the configuration file directly using --agent-config 

    ```shell
    vctl install volttron-sqlite-historian --agent-config <path to configuration> --start
    ```

    - OR  not pass the config at install time, and  use the configuration store for historian's configuration using the command

    ```shell
    vctl config store <vip-identity> config <path to json config file>
    ```

1. View the status of the installed agent

    ```shell
    vctl status
    ```

## Development

Please see the following for contributing guidelines [contributing](https://github.com/eclipse-volttron/volttron-core/blob/develop/CONTRIBUTING.md).

Please see the following helpful guide about [developing modular VOLTTRON agents](https://github.com/eclipse-volttron/volttron-core/blob/develop/DEVELOPING_ON_MODULAR.md)

# Disclaimer Notice

This material was prepared as an account of work sponsored by an agency of the
United States Government.  Neither the United States Government nor the United
States Department of Energy, nor Battelle, nor any of their employees, nor any
jurisdiction or organization that has cooperated in the development of these
materials, makes any warranty, express or implied, or assumes any legal
liability or responsibility for the accuracy, completeness, or usefulness or any
information, apparatus, product, software, or process disclosed, or represents
that its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service by
trade name, trademark, manufacturer, or otherwise does not necessarily
constitute or imply its endorsement, recommendation, or favoring by the United
States Government or any agency thereof, or Battelle Memorial Institute. The
views and opinions of authors expressed herein do not necessarily state or
reflect those of the United States Government or any agency thereof.

