Tracardi / tracardi

TRACARDI is a new HOME for your customer data. TRACARDI is an Composable API-first solution for any company that need inexpensive CDP to intergrate with.
https://www.tracardi.com
Other
519 stars 95 forks source link

Plugin that sorts (ascending, descending) a referenced dictionary #733

Closed atompie closed 2 years ago

atompie commented 2 years ago

Is your feature request related to a problem? Please describe. Plugin that sorts (ascending, descending) a referenced dictionary in plugin config. This plugin is very simple in terms of python. The challenge is to add it as plugin. This is also very simple if you read this http://docs.tracardi.com/plugins/tutorial/part1/ and http://docs.tracardi.com/plugins/tutorial/part2

Describe the solution you'd like User defines in plugin configuration what object needs to be sorted and if it is ascending, descending sorting. Sorting should return a list of tuples with key and value.

Example of configuration

{
   "data": "event@properties.list_of_something",
   "direction": "asc"
}

Input: Workflow payload

Output: Sorted object in form of list of tuples with key and value.

Additional context You will need to setup the dev environment. Here is the tutorial how to do it. Also to understand how the plugins work please read http://docs.tracardi.com/plugins/tutorial/part1/ and http://docs.tracardi.com/plugins/tutorial/part2/ . The next part is o its way so you can extend your knowledge about Tracardi plugins.

sameersecond commented 2 years ago

Hi, Can I try this out?

atompie commented 2 years ago

@sameersecond sure

atompie commented 2 years ago

@sameersecond The PR was merged. Would you like also to fill the documentation for this plugin. I Created a task for it: https://github.com/Tracardi/tracardi/issues/743