How do I convert delimited strings into a hierarchical JSON in Python? (I saw a solution for a similar question in jQuery. I have been trying to find a Python solution for the same.)
The goal is to generate a hierarchical JSON of categories from a bunch of URLs which might look like:
sport/tennis/grandslams
sport/chess
sport/chess/players/men
sport/tennis
sport/cricket/stadiums
sport/tennis/players