New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create tree from list of indented strings #43
Comments
Good idea to have a Please add an optional callback for creating the single node class instance as the Tests with 100% coverage would be highly appreciated. |
pull request made (#48) |
Hi! I see the documentation for the feature, but the PyPI package v2.4.3 I installed doesn't seem to have it. |
I need to release the package. The documentation got accidentally updated. I'll fix that. |
I think the package, but could found a easy way to costruct a tree from a list like the following:
Maybe I missed something? |
Hi,
I am using
anytree
to generate a tree-view of pytest hooks based on a log file with indented hooks. pytest-dev/pytest#3261For that I needed to create a function to convert a list of indented strings to a tree. Apparently another users on stackoverflow have needed it:
https://codereview.stackexchange.com/questions/176391/parsing-indented-text-and-inserting-its-data-into-a-tree
https://stackoverflow.com/questions/17858404/creating-a-tree-deeply-nested-dict-from-an-indented-text-file-in-python
https://stackoverflow.com/questions/32101253/converting-a-string-to-a-tree-structure-in-python?rq=1
I have created the following script for doing this and it is quite simple:
https://github.com/Sup3rGeo/pytest/blob/master/doc/pytesthooks.py
I believe it makes sense to make this part of anytree as a "indented strings importer".
So if you agree I would gladly add a pull request for this. Thanks!
The text was updated successfully, but these errors were encountered: