caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
800 stars 185 forks source link

Add from dict #216

Closed gaoyukid closed 10 months ago

gaoyukid commented 11 months ago

In work, i usually need to deal with raw data in child:parent as a dict format - i need to rewrite from_dict function a lot to form a tree so i thought it could be a plugin

gaoyukid commented 10 months ago

Ready for review

caesar0301 commented 10 months ago

Ready for review

The plugin extension is deprecated and will be removed in near future. We recommend to enrich to_xxx and from from_xxx routines. In this case, a static method of from_dict would be appropriate.

gaoyukid commented 10 months ago

Ready for review

The plugin extension is deprecated and will be removed in near future. We recommend to enrich to_xxx and from from_xxx routines. In this case, a static method of from_dict would be appropriate.

done - however, i'd like to point out that the from_dict schema is different than the to_dict schema, which can cause confusion

caesar0301 commented 10 months ago

@gaoyukid Please help us to fix the flake8 linting.

caesar0301 commented 10 months ago

Merged manually