Always use MIDI note numbers in your file names, don't use note names. C3 is that middle C? or is C4 middle C? Doesn't matter, use 60 because that's always middle C. Also when you're scripting it's much easier to deal with numbers than strings for mathematical calculations.
With Kontakt you're limited to the number of segments your filename can have, I think it's 7 if I remember correctly. So include all the important info in the file name and for further categorization you can use the folder structure. If you're using a different sampler such as HISE then this limitation isn't a problem and you can add more info in the filename.
The info you'll include will also vary depending on the instrument. For example a guitar sample filename might include the string, the picking direction, the pick position, etc.
So I'll give some examples of what I do.
Guitar:
"instrumentName_articulation_pickDirection_stringName_noteNumber_dynamic_roundRobin_mic"
Violin (bow direction isn't necessary unless you recorded more than one):
"instrumentName_articulation_bowDirection_noteNumber_dynamic_roundRobin_mic"
Frame Drums:
"instrumentName_drumName_stickName_hitPosition_direction_noteNumber_dynamic_roundRobin_mic"
Orange Tree Samples posted an article years ago about their system. They rely on folder structure for organizing their samples. I prefer to have all the data within the filename so that if I ever take it out of its folder structure I know what it is. But for a Kontakt based library I think a detailed folder structure is often necessary -
https://www.orangetreesamples.com/blog/easy-sample-library-mapping-method