[FREE] ListNinja Extension from Still_Learning

Dear team, this is my another extension which works with lists though i found listutil extension and this will help you in many ways. Documentation is attached the with along with examples. So kindly go through with all the functions example and how it is working.

No libraries are added 
No permission will request
No internet required

Summary

I like the DeepSearch function the most - It will search the specific item in all sort of list with any kind of index. Give Heart to this function. It takes me a lot of time to work on this

1. Basic Operations

Function 1D List Input 2D List Input Result (1D) Result (2D)
RemoveDuplicates [1, 2, 2, 3] [[1,2], [3,4], [1,2]] [1, 2, 3] [[1,2], [3,4]]
SortAscending ["Banana", "Apple"] [[3, "C"], [1, "A"]] ["Apple", "Banana"] [[1, "A"], [3, "C"]]
SortDescending [5, 1, 3] [["Bob", 25], ["Alice", 30]] [5, 3, 1] [["Bob", 25], ["Alice", 30]]
CountOccurrences ["A", "B", "A"] [[1,2], [1,2], [3,4]] (count [1,2]) 2 (for “A”) 2 (for [1,2])

2. List Manipulation

Function 1D List Input 2D List Input Result (1D) Result (2D)
Flatten [1, [2, 3]] [[1,2], [3,[4,5]]] [1, 2, 3] [1, 2, 3, 4, 5]
ReverseList [1, 2, 3] [["A", "B"], ["C", "D"]] [3, 2, 1] [["C", "D"], ["A", "B"]]
SwapElements ["A", "B", "C"] (pos1=1, pos2=3) [[1,2], [3,4]] (swap rows) ["C", "B", "A"] [[3,4], [1,2]]
ChunkList [1, 2, 3, 4] (size=2) [[1,2], [3,4], [5,6]] (size=1) [[1,2], [3,4]] [ [[1,2]], [[3,4]], [[5,6]] ]

3. Search & Filter

Function 1D List Input 2D List Input Result (1D) Result (2D)
FindAllOccurrences ["A", "B", "A"] (target=“A”) [[1,2], [1,2], [3,4]] (target=[1,2]) [1, 3] (positions) [1, 2] (positions)
DeepSearch [1, [2, 3], 2] (target=2) [[1,2], [3,[4,2]]] (target=2) [ [2,3], 2 ] [ [1,2], [4,2] ]
FilterListOfListsByIndex N/A [["Apple", "Red"], ["Banana", "Yellow"]] (index=2, match=“Red”) N/A [ ["Apple", "Red"] ]

4. List Analysis

Function 1D List Input 2D List Input Result (1D) Result (2D)
FindMinMax [5, 1, 3] [[10, 20], [5, 30]] (numeric cols) [1, 5] (min, max) [5, 30] (min, max across all)
FrequencyTable ["A", "B", "A"] [[1,2], [1,2], [3,4]] [ ["A",2], ["B",1] ] [ [[1,2], 2], [[3,4], 1] ]
AreListsEqual [1, 2] vs [1, 2] [[1,2]] vs [[1,2]] true true

5. JSON/CSV Conversion

Function 1D List Input 2D List Input Result (1D) Result (2D)
ListToJson ["A", 1, true] [[1, "A"], [2, "B"]] ["A", 1, true] (JSON) [[1,"A"], [2,"B"]] (JSON)
ListToCsv ["A", "B"] [[1, "A"], [2, "B"]] "A","B" (CSV) "1","A"\n"2","B" (CSV)

6. List statistics( Calculate statistics (sum/avg/min/max) for numeric lists)

Example (1D):
Input: [10, 20, 30] → Output: [60, 20, 10, 30, 3]
Example (2D):
Input: [[5, "X"], [10, 15]] → Output: [30, 10, 5, 15, 3] (ignores non-numbers)

7. Transpose
Transpose (Only from 2D list, Not tested with 3D list and above)
Example (2D):
Input: [[A, B], [C, D], [E, F]] → Output: [[A, C, E], [B, D, F]]

8. Rotate list (positive value for right side, negative value for left side)
Example (1D):
Input: [1, 2, 3, 4] , positions=1 → Output: [4, 1, 2, 3]
Example (2D):
Input: [[A,B], [C,D], [E,F]] , positions=-1 → Output: [[C,D], [E,F], [A,B]]

9. SortListOfListsByIndex

Function 2D List Input (Before Sorting) Parameters Result (Sorted 2D List)
Sort by Index [ ["Alice", 30], ["Bob", 25], ["Eve", 28] ] index=2, ascending=true [ ["Bob", 25], ["Eve", 28], ["Alice", 30] ]
Sort Descending [ [3, "C"], [1, "A"], [2, "B"] ] index=1, ascending=false [ [3, "C"], [2, "B"], [1, "A"] ]

Key Notes for Documentation:

  1. 1D Lists: Simple flat lists (e.g., [1, 2, 3]).
  2. 2D Lists: Lists of lists (e.g., [[1,2], [3,4]]).
  3. YAIL Handling: All examples assume inputs are YailList objects.
  4. Error Cases: Functions like FindMinMax ignore non-numeric values.

I hope i have made clear cut examples to each function also the output to the best of my knowledge. Make use of this extension and convey your valuable feedback if it finds any error or compilation error.

Thanks a lot

Regards,
Still Learning

Blocks




Version 2

Added one conversion (Dic to json array), Proguard added

Extension

Version 2:
ListNinja (1).aix (21.7 KB)

6 Likes
  1. n-gram generation
    2.Example*:
    Input: [1, 2, 3, 4], windowSize=2 Output: [[1, 2], [2, 3], [3, 4]]
  2. Track changes in dynamically updated lists (e.g., sensor data).
    4.Example*:
    Input: oldList=[1, 2, 3], newList=[1, 4, 3]
    Output: {added: [4], removed: [2], unchanged: [1, 3]}
  3. GroupBy(listOfDicts, key)
    6.Example*:
    Input: [{“name”:“Alice”,“dept”:“HR”}, {“name”:“Bob”,“dept”:“IT”}], key=“dept”
    Output: {“HR”: [{“name”:“Alice”}], “IT”: [{“name”:“Bob”}]}
  4. GetPermutations(list, size)
    Useful for password cracking simulations or game mechanics.
    8.Example*:
    Input: [1, 2, 3], size=2
    Output: [[1,2], [1,3], [2,1], [2,3], [3,1], [3,2]]
  5. RunningStats(list)
    Real-time analytics (e.g., live sensor readings).
    10.Example*:
    Input: [10, 20, 30]
    Output: [
    {index:1, sum:10, avg:10, min:10, max:10},
    {index:2, sum:30, avg:15, min:10, max:20},
    {index:3, sum:60, avg:20, min:10, max:30}
    ]
  6. GenerateMarkovChain(list, order)
    AI text/code generation for educational apps.
    12.Example*:
    Input: [“A”, “B”, “A”, “C”], order=1
    Output: {“A”: [“B”, “C”], “B”: [“A”], “C”:

Shall i add these features in the upcoming version?

1 Like

This extension is great. A lot of the blocks are super useful, thanks very much. I personally love the remove duplicates and find all occurrences blocks

1 Like

Thanks For Adding Dictionary List to Json … It works for me :cowboy_hat_face::cowboy_hat_face::cowboy_hat_face::cowboy_hat_face::cowboy_hat_face:

1 Like

D8 Error after using your extension in kodular but working in Mit
@Still-learning Can You Please Resolve it

What about using the -d8fix option as suggested in the error message?

Taifun

you mean i have to use 1 extension , custom list picker or list ninja ?

ListNinja (1).aix (21.7 KB)

Thank you @Mr_YouTuber_Official for pointing this error. In Version 2 i was tried to add AndroidX Support which causes that error. Now i resolved it.

1 Like

Nope, Taifun suggested you to follow the error message. Because error message itself suggested you what to do,

is it resolved now ? Should i test it ?

i tried your new version , now app build but crash after opening it…

Are you sure because of this extension?

yes , because after removing it again app works

Sorry for the inconvenience. Let me once again go through it, but actually do not know the reason, as i am not using any external libraries, support, complex code, etc etc, but throwing this error. Let me catch the logcat and try to resolve it.

ok ok thanks for your good work

Meanwhile if possible share us your logcat if you catch

i do not catch that , you can try using your both extension . then error will be infront of you…

What happens if you use version 1 and follow the suggestion?


Taifun

App version or in extension ???

Obviously version 1 of the extension
Taifun