[ANN] PrettyTables v0.5.0 - Added helpers to improve experience!

Hi guys!

I have just tagged a new version of PrettyTables.jl (v0.5.0).

Helpers

It turns out that the number of options we have now is huge and the commands to print the formatted tables as we want is sometimes very, very large. This was bothering me, because for most of my analysis I want a fix set of configurations while I am looking at the data. Hence, I came up with a mechanism that I think will help! It more or less like a global configuration.

First, we have the @pt macro that will pretty print the tables after it. Like:

By default, it will use the default configurations as described in the documentation of the function pretty_table. However, we can modify any of the configurations in the keywords of that function by using the other macro @ptconf:

NOTE: The tf parameter is not a keyword of pretty_table, but can be used to change the table format.

All calls to @pt will now use the configurations assigned by @ptconf. If the user wants to go back to default, just call @ptconfclean.

Finally, if the user wants to add a header, then they must add an assignment to the “virtual” variable :header just like in:

I think we can improve this, so, please, give me feedback about it (ah, I have just implemented it and did not have much time to test, so expect bugs…).

Other features

I also implemented two additional features:

  1. The highlighters keyword can now receive just one highlighter without needing to add it to a Tuple.
  2. There is now a keyword nosubheader to suppress the sub-header printing. This is useful if the user wants to print a DataFrame without the type (thanks @xgdgsc) :

25 Likes

Beautiful! Thanks.

1 Like

Fantastic! The nosubheader option is something I’ve been pining for, but the rest looks great too!

1 Like

Excellent! Good to know :slight_smile: this was an idea of @xgdgsc.