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
- Host: GitHub
- URL: https://github.com/killerboss2019/tp-dataparser
- Owner: KillerBOSS2019
- License: mit
- Created: 2022-04-14T05:34:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T17:47:36.000Z (over 2 years ago)
- Last Synced: 2025-01-25T22:22:24.097Z (8 months ago)
- Language: Python
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Touch-Portal-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)
# DescriptionTP-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 NameDescriptionFormatDatachoices/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]
- Type: text
<empty>- Type: text
<empty>- 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
- Type: choice
<empty>- Type: choice
Default: GET Possible choices: ['GET', 'POST', 'PUT', 'DELETE']- Type: text
Default: /- Type: text
<empty>- Type: text
Default: 5- 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
- Type: choice
Default: Delete Possible choices: ['Pause', 'Resume', 'Delete']- 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
- Type: choice
Default: Json Possible choices: ['Json', 'Html']- Type: text
<empty>- Type: text
<empty>- 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
- Type: text
<empty>- Type: text
<empty>- Type: text
<empty>- 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]`
```
{
"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]`
```
[
{
"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.