Coder Social home page Coder Social logo

asciitree's People

Contributors

andrewwalker avatar dotsdl avatar emilstenstrom avatar kain88-de avatar mbr avatar woodjosh256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

asciitree's Issues

New release 0.3.2

Since there was a critical fix to make this package work for Python 3 (#4), could a new release be pushed to PyPI? Presumably this would be 0.3.2?

Checking if child has children in Style

Would be nice if there was a way to check if a child will have children or not through some mechanism in Style. Not entirely sure what that would be yet, but it would be really handy for handling cases like opening and closing tags.

To provide a concrete example, am trying to generate some HTML and CSS to make a visualization like this one (item 4) The HTML code being generated needs to look something like this. So would want to be able to add <li>/</li> tags based on whether children are present or not.

Some internal bug

When running the example I am getting this:

  File "/usr/local/lib/python3.5/dist-packages/asciitree/__init__.py", line 48, in __call__
    return '\n'.join(self.render(self.traverse.get_root(tree)))
  File "/usr/local/lib/python3.5/dist-packages/asciitree/traversal.py", line 29, in get_root
    return tree.items()[0]
TypeError: 'dict_items' object does not support indexing

I am on linux 64 with python 3.5.2

Allow labels with unicode on Python 2

When using unicode labels you currently get a crash on Python 2. Monkey-patching like this fixes the crash:

import asciitree
asciitree.drawing.Style.label_format = u"{}"

... but it would of course be nicer not to have to do that.

Can I ask for a "u" to be added the the formatting string in asciitree.drawing.Style.label_format?

Please package tests as well

Hi,

I would love to run the test suite while building packages for openSUSE distro. It would be the easiest if the tests/ directory was also packaged in the distribution tarball. Could you please add to MANIFEST.in file this one line

recursive-include tests *

, please?

Thank you.

Identical children

I was thinking of using asciitree to represent arithmetic expressions as trees, eg (2 * 2):

*
 +-- 2
 +-- 2

But this seems not to work, because one 2 overwrites the other, in the OrderedDict.

Here is my code:

from asciitree import LeftAligned
from collections import OrderedDict as OD
tree = {
    '*': OD([
        ('2', {}),
        ('2', {})
        ])
    }
tr = LeftAligned()
print(tr(tree))

and output:

*
 +-- 2

I guess the workaround would be to invent unique names for each 2?

Make space character configurable

In some contexts it might be desired to use a non-breaking space (U+00A0) or some other larger space character rather than the "ordinary" spaces the library currently uses.

The best place to add this would probably be as another character in the BoxStyle.gfx dict, although you may have a better idea.

Add first_child_head and first_child_tail

In the event that one needs to customize how the first child appears, it would be nice to have first_child_head and first_child_tail. Also would be nice if LeftAligned handled the case of the first child separately.

Publish wheels?

Thanks for this useful library! I'm just filing this issue to collect interest in having wheels for this library.

Thanks!

This is very useful and does exactly what I need!

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.