Asciigraf

Latest version: v1.1.0

Safety actively analyzes 613777 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.0

To provide useful error handling, `asciigraf` generates error messages that hightlight bad edges using colour (see the `highlight_bad_edge_characters` function).

For libraries that use `asciigraf`, there may at times be value in being able to generate similar highlighting to provide more specific feedback related to the use-case (e.g. if a library has specific rules about how to name nodes and what the names imply, it would be useful to highlight invalid ones in an error message).

Including the ascii string as a graph attribute makes this functionality easier to build, since the calling code can reproduce the input text just by having the graph object produced by `asciigraf`. Libraries can do things like defining a function to produce highlighting:

python
def highlight_node(asciigraf_obj: networkx.Graph, node: str) -> str:
...

def highlight_edge(asciigraf_obj: networkx.Graph, edge: Tuple[str, str]) -> str:
...


These functions can find the positions of `node` or `edge` using node / edge attributes on the input graph, and can reconstruct a highlighted textual version of the source asciigram. Without the change here, we would need to pass the ascii string separately.

1.0.1

we switched to `pyproject.toml`, however there are some small details of how `setuptools` loads the package VERSION from a file, and if you do it wrong the package is built in a way that `pip` / `setuptools` can't handle. For details, see [bug](https://github.com/pypa/setuptools/issues/3781)

1.0.0

Key Changes
* distributed using pyproject.toml
* tested against py 3.8-3.11 and networkx 2.4-3.0
* __version__ attribute
* moving to 1.0.0 because, well, this is stable code so

0.9.1

In version 2.6, `networkx` deprecated `OrderedGraph` since python dictionaries are ordered as of python 3.7, and thus `Graph` already guarantees order in its implementation. In order to provide compatibility with networkx 3.0, when `OrderedGraph` will not be available, we stop using `OrderedGraph` for python versions newer than 3.7.

In addition, we switch from travis CI (RIP :skull: ) to Github Actions

0.9.0

This release adds support for a much larger range of node characters; you can now use any character that isn't already recognized by `asciigraf` as an edge character (`\`, `/`, `-`), including single white-space characters.


Bob is my *favourite* friend--------------------------Betty isn't my friend at all
\
\
what is your name, 'frank' or something?

0.8.0

Each edge now gets an extra edge attribute 'points' which contains the position of edge characters in it
* edge characters are always ordered from `n1`->`n2`, where `n1` is in lower lexical position then `n2` if you read the asciigram left-right, top-bottom
* the positions of any label characters that intersect the line are included
** for a horizontal label, all the characters will appear in the line
** for a vertical label, only the one that intersects with the edge will be included

One other change is that the data attached in 'positions' attribute for nodes and 'points' attribute for edges is no longer a special `asciigraf` points object; it is just an (x, y) tuple. This is safer because it means that users of asciigraf won't accidentally depend on the functionality of this tuple, which is specifically designed to make parsing asciigrams easier.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.