# \[ANN\] PrettyTables.jl v0.12

**URL:** <https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130>\
**Category:** Package Announcements\
**Created:** [April 12, 2021, 8:41pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130 "2021-04-12T20:41:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 12, 2021, 8:41pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/1 "2021-04-12T20:41:10Z")

</div>

Hi!

I just released [PrettyTables.jl](https://github.com/ronisbr/PrettyTables.jl) v0.12. As I mentioned in my last post, it has some deprecations (nothing is breaking) because two things:

1. The `backend` is now selected using `Val` instead of a symbol. Hence, `backend = :html` must be `backend = Val(:html)`. The old version will work, but with a very bad performance.
2. The header is now selected by `header` keyword and it is a tuple of vectors instead of a matrix.

I apologize for such changes, but it was necessary to drastically reduce the time to print the first table, mainly in HTML and LaTeX backends. Take a look at the new numbers:

 ![Captura de Tela 2021-04-12 às 17.00.31](https://global.discourse-cdn.com/julialang/original/3X/c/c/cce57f1772e27bc27779858beb174f51df117a3d.png)

Notice that for HTML and LaTeX it takes now 4x less to print the first table.

This will (hopefully) be the last release before 1.0. I planning to wait one or two weeks for bugs before tagging 1.0. If you find anything weird, please, fill an issue in Github!

I would also like to thanks @bkamins to pointing the directions I need to follow to reduce these times. Furthermore, I want to thanks the developers of two amazing tools: SnoopCompiler.jl and Cthulhu.jl. I wouldn’t be able to optimize the package without those two packages.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [April 12, 2021, 8:44pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/2 "2021-04-12T20:44:50Z")

</div>

The speed like great! Any reason you went for this approach rather than defining a `HTML` struct for dispatch and using that instead?

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 12, 2021, 8:50pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/3 "2021-04-12T20:50:17Z")

</div>

It automatically identifies the table structure you are using. Hence, if you select `tf = tf_html_default`, then it automatically calls the HTML backend. The keyword is used when you just want the default table format.

I keep this `backend` keyword because of some backend I like to add like Markdown. It is a text backend (and will use everything we have in text) except for some minor differences.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [April 12, 2021, 8:57pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/4 "2021-04-12T20:57:48Z")

</div>

Bravo! This will greatly improve DataFrames.jl experience in 1.0 release for text/plain (and in the future also HTML and LaTeX).

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 12, 2021, 9:56pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/5 "2021-04-12T21:56:44Z")

</div>

Oops, I forgot to mention that the timing in the second run are in [ms], the rest are in [s].

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [April 14, 2021, 9:57am UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/6 "2021-04-14T09:57:48Z")

</div>

Really nice work! Having a performant “cross table type” solution for formatting can avoid a lot of code duplication across table implementations.

> [@Ronis\_BR](#):
>
> I keep this `backend` keyword because of some backend I like to add like Markdown. It is a text backend (and will use everything we have in text) except for some minor differences.

Definitely looking forward to the Markdown backend. I find that markdown is a pretty good format to write reports, and it’s very helpful to be able to just embed a table there. (As a stopgap for now it already works to insert the HTML in the markdown.)

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 14, 2021, 11:47am UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/7 "2021-04-14T11:47:30Z")

</div>

Very cool work!

Can we print the table like an iterator, for example to log some computation progress?

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 14, 2021, 12:58pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/8 "2021-04-14T12:58:06Z")

</div>

> [@piever](#):
>
> Definitely looking forward to the Markdown backend. I find that markdown is a pretty good format to write reports, and it’s very helpful to be able to just embed a table there. (As a stopgap for now it already works to insert the HTML in the markdown.)

Nice! It would be somewhat easy, I just need to decide which features I will implement or not. For example: do we want cropping when using Markdown? Markdown is used to create that that will be renderer somewhere, I don’t know if we need to take care of cropping due to display size.

> [@rveltz](#):
>
> Very cool work!
> 
> Can we print the table like an iterator, for example to log some computation progress?

Thanks! No, but this is a very nice idea 🙂

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [April 15, 2021, 8:14pm UTC](https://discourse.julialang.org/t/ann-prettytables-jl-v0-12/59130/9 "2021-04-15T20:14:00Z")

</div>

You might be interested to learn that Latexify.jl can also convert DataFrames to Markdown tables
