[Python] Library to automatically organize taxonomy

Discussão em 'Python' iniciado por Stack, Agosto 8, 2025.

  1. Stack

    Stack Membro Participativo

    I've got the following taxonomy for a list of items:

    Example:

    Item 1['taxonomy'] = 'toys/starwars/yoda/Baby Yoda toy'
    Item 2['taxonomy'] = 'toys/starwars/yoda/Baby Yoda toy 10inches'
    Item 3['taxonomy'] = 'toys/starwars/luke/Luke Skywalker toy'
    Item 4['taxonomy'] = 'cloths/starwars/luke/Luke Skywalker toy'


    And I want to automatically create one taxonomy "object" with a representation like

    |_ toys (3)
    | |_
    | starwars (3)
    | |_ yoda
    | |_ luke
    | ...
    |_ cloths (1)
    ...


    Do I have to do it manually or is there any library/object that does it? Thanks

    I don't necessarily want a tree! I want to organize my taxonomy and understand the taxonomy behavior (understand how well it is structured for all the articles)

    How can I also print the tree without the last branch?

    Continue reading...

Compartilhe esta Página