An open API service indexing awesome lists of open source software.

https://github.com/killerboss2019/tp-dataparser

TP-JsonParser allows user to create http request and if data type is json It can parse them
https://github.com/killerboss2019/tp-dataparser

Last synced: 7 months ago
JSON representation

TP-JsonParser allows user to create http request and if data type is json It can parse them

Awesome Lists containing this project

README

          

# Touch-Portal-DataParser
![Downloads](https://img.shields.io/github/downloads/KillerBOSS2019/TP-DataParser/total)
![Forks](https://img.shields.io/github/forks/KillerBOSS2019/TP-DataParser)
![Stars](https://img.shields.io/github/stars/KillerBOSS2019/TP-DataParser)
![License](https://img.shields.io/github/license/KillerBOSS2019/TP-DataParser)

- [Touch Portal DataParser](#Touch-Portal-DataParser)
- [Description](#description)
- [Features](#Features)
- [Actions](#actions)
- [Data Parser](#KillerBOSS.TPPlugin.DataParser.mainactions)
- [States](#states)
- [Data Parser](#KillerBOSS.TPPlugin.DataParser.mainstates)
- [Installation Guide](#installation)
- [Examples](#examples)
- [Bugs and Support](#bugs-and-suggestion)
- [License](#license)

# Description

TP-DataParser allows you to parse and edit Json or HTML formatted data. If you have other type of data that aren't on the list feel free send a request to me. and I'll try my best!.

This documentation generated for Touch Portal DataParser V100 with [Python TouchPortal SDK](https://github.com/KillerBOSS2019/TouchPortal-API).
# Features

## Actions
Category: Data Parser (Click to expand)
Action NameDescriptionFormatData

choices/default (in bold)
On
Hold
Create HTTP ListenercreateHTTPListener is a action that allows to setup a base connection and use it to make actual request.Create listener name[listenerName] host url[host] and Header[header]

  1. Type: text  
    <empty>

  2. Type: text  
    <empty>

  3. Type: text  
    <empty>


No
Setup endpoint calls using listenerThis will use listener that you've created using `Create HTTP Listener` action as a base. And then use this to actually send request to a endpoint with a intervel aka it will automatically update x seconds and save the result.Use[listeners][requestMethod] to endpoint[endpoint]and optional body[body]and request every[intervel]seconds and save result to[result]Click to expand

  1. Type: choice  
    <empty>

  2. Type: choice  
    Default: GET Possible choices: ['GET', 'POST', 'PUT', 'DELETE']

  3. Type: text  
    Default: /

  4. Type: text  
    <empty>

  5. Type: text  
    Default: 5

  6. Type: text  
    <empty>


No
Resume, Pause or Delete a listenerThis will Pause, Resume, and Delete a listener. once deleted it will remove all the states that's created from this listener[listenerControl] [listeners] update

  1. Type: choice  
    Default: Delete Possible choices: ['Pause', 'Resume', 'Delete']

  2. Type: choice  
    <empty>


No
Parsing dataParseData action allows you to get specific data field from Json or HTML. for example {'website host': 'blah blah'} you can get value of `website host` which is `blah blah`.Parse[dataType]data[data]to get[dataPath]and save result to[result]Click to expand

  1. Type: choice  
    Default: Json Possible choices: ['Json', 'Html']

  2. Type: text  
    <empty>

  3. Type: text  
    <empty>

  4. Type: text  
    <empty>


No
Editing json data fieldEditJson allows you to change specific json field to a new data. for example if I have `{'name': 'someone'} I can change from `someone` to `something` as a example.Change [data] at path[jsonPath] to [newData] and save to[result]Click to expand

  1. Type: text  
    <empty>

  2. Type: text  
    <empty>

  3. Type: text  
    <empty>

  4. Type: text  
    <empty>


No


## States
Category: Data Parser (Click to expand)

| Id | Description | DefaultValue | parentGroup |
| --- | --- | --- | --- |
| .state.totalListenerCreated | DataParser total listener created | 0 | |


# Examples

If you want to retrieve the 'state' of the light from the json below then you would use `[state]`, if you wanted to get the last_updated_again value then you would use `[context][last_updated_again]`
![image](https://user-images.githubusercontent.com/76603653/219106189-a60c1b2b-7bd0-4dc7-94cf-356702226208.png)

```
{
"entity_id": "light.key_light",
"state": "on",
"attributes": {},
"last_changed": "2023-02-15T02:42:52.525643+00:00",
"last_updated": "2023-02-15T02:42:52.525643+00:00",
"context": {
"last_updated_again": "2023-02-15T02:42:52.525643+00:00"
}
}
```
--------------
Another example when you want to access an array, you would simply do the same thing as above but add which array you are entering first
`[0][context][last_updated_again]`
![image](https://user-images.githubusercontent.com/76603653/219106035-6be88bdc-4dd5-4dc8-bc63-c425f62b4843.png)

```
[
{
"entity_id": "light.key_light",
"state": "on",
"attributes": {},
"last_changed": "2023-02-15T02:42:52.525643+00:00",
"last_updated": "2023-02-15T02:42:52.525643+00:00",
"context": {
"last_updated_again": "2023-02-15T02:42:52.525643+00:00"
}
}
]
```

# Installation
1. Goto [Releases](https://github.com/KillerBOSS2019/TP-DataParser/releases) and Download latest version for your system.
2. After downloading the .tpp file goto open TouchPortal GUI and click on the gear icon and click `Import Plug-in`
3. After imported the plugin you may or may not need to restart TouchPortal but it should pop up something says do u want to allow this plugin to run. Click `Trust Always`
# Bugs and Suggestion
Open an [issue](https://github.com/KillerBOSS2019/TP-DataParser/issues) or join offical [TouchPortal Discord](https://discord.gg/MgxQb8r) for support.

# License
This plugin is licensed under the [GPL 3.0 License] - see the [LICENSE](LICENSE) file for more information.