Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Eclipse VOLTTRON™ Python 3.10 Python 3.11 Run Pytests pypi version Passing?

SQLite Tagging Agent

SQLite tagging agent provide APIs to tag both topic names(device points) and topic name prefixes (campus, building, unit/equipment, sub unit) and then query for relevant topics based on saved tag names and values. The SQLite tagging agent stores the tags in a sqlite3 database and hence provides a way to test this feature in VOLTTRON without any additional database install. However, sqlite3 is not an ideal database for key/value data that has many to many mapping. A database such as MongoDB or Postgresql would be better suited.

Tags used by this agent have to be pre-defined in a resource file at volttron_data/tagging_resources. The agent validates against this predefined list of tags every time user add tags to topics. Tags can be added to one topic at a time or multiple topics by using a topic name pattern(regular expression). This agent uses tags from project haystack and adds a few custom tags for campus and VOLTTRON point name.

Each tag has an associated value and users can query for topic names based tags and its values using a simplified sql-like query string. Queries can specify tag names with values or tags without values for boolean tags(markers). Queries can combine multiple conditions with keyword AND and OR, and use the keyword NOT to negate a conditions.

Requirements

  • Python >= 3.10

Dependencies and Limitations

  1. When adding tags to topics this agent calls the platform.historian's (or a configured historian's) get_topic_list and hence requires a platform.historian or configured historian to be running, but it doesn't require the historian to use sqlite3 or any specific database. It requires historian to be running only for using this api (add_tags) and does not require historian to be running for any other api.
  2. Resource files that provides the list of valid tags is mandatory and is present under data_model/tags.csv
    within base tagging agent
  3. Tagging agent only provides APIs query for topic names based on tags. Once the list of topic names is retrieved, users should use the historian APIs to get the data corresponding to those topics.
  4. Current version of tagging agent does not support versioning of tag/values. When tags values set using tagging agent's APIs update/overwrite any existing tag entries in the database
  5. Since RDMS is not a natural fit for tagname=value kind of data, performance of queries will not be high if you have several thousands of topics and several hundreds tags for each topic and perform complex queries. For intermediate level data and query complexity, performance can be improved by increasing the page limit of sqlite.

Installation

  1. Create and activate a virtual environment.

     python -m venv env
     source env/bin/activate
    
  2. Installing volttron-sqlite-tagging requires a running volttron instance.

    pip install volttron
    
    # Start platform with output going to volttron.log
    volttron -vv -l volttron.log &
    
  3. Create an agent configuration file SQLite tagging supports three parameters

    • connection - This is a mandatory parameter with type indicating the type of database (i.e. sqlite) and params containing the path the database file.

    • table_prefix - Optional parameter to provide custom table names for topics, data, and metadata.

    • historian_vip_identity - Optional. Specify if you want tagging agent to query the historian with this vip identity. defaults to platform.historian. Historian is queried only by the add_topics api. other apis do not use historian.

    The configuration can be in a json or yaml formatted file.

    Yaml Format:

    connection:
      # type should be sqlite
      type: sqlite
      params:
        # Relative to the agents data directory
        database: "data/tagging.sqlite"
    
    # prefix for tagging data tables
    table_prefix: ""
    
    # optional parameter to point to historian other than platform.historian
    historian_vip_identity: my.test.historian
    
  4. Install and start the volttron-sqlite-tagging agent.

    vctl install volttron-sqlite-taggig --agent-config <path to configuration> --start
    
  5. View the status of the installed agent

    vctl status
    

Development

Please see the following for contributing guidelines contributing.

Please see the following helpful guide about developing modular VOLTTRON agents

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.

Metadata

Release files for volttron-sqlite-tagging 0.1.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for volttron-sqlite-tagging 0.1.1a1
File Size Uploaded Provenance Actions
volttron_sqlite_tagging-0.1.1a1.tar.gz 19.7 kB Without provenance Details for volttron_sqlite_tagging-0.1.1a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for volttron-sqlite-tagging 0.1.1a1
File Interpreter ABI Platform Actions
volttron_sqlite_tagging-0.1.1a1-py3-none-any.whl Python 3 none any Details for volttron_sqlite_tagging-0.1.1a1-py3-none-any.whl

Total release size: 37.4 kB

Release files / volttron_sqlite_tagging-0.1.1a1.tar.gz

Download URL volttron_sqlite_tagging-0.1.1a1.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8a5160e978073bfe57c1021d8160d9cd4a69e94b7dbb5080b498ebb3d49885c4
BLAKE2b-256 checksum
How to use checksums
54f60156971787ae7d3d6b97aa13c3b937de70c288bba08eef573999d7de4ac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.20 Linux/6.8.0-1062-azure

Release files / volttron_sqlite_tagging-0.1.1a1-py3-none-any.whl

Download URL volttron_sqlite_tagging-0.1.1a1-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c79d1c039388bb6f9a70c845ef1d77c7efe20bd81c0d9d27f433a7bf02f08bb1
BLAKE2b-256 checksum
How to use checksums
8ed94ca4cb92e2cbebf59882c266f96c76657d9274ca568e65b77e41710ce4ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.20 Linux/6.8.0-1062-azure

Security for volttron-sqlite-tagging 0.1.1a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page