jazzband / prettytable

Display tabular data in a visually appealing ASCII table format
https://pypi.org/project/PrettyTable/
Other
1.35k stars 154 forks source link

Add `get_formatted_string()` convenience function #241

Closed rickwporter closed 1 year ago

rickwporter commented 1 year ago

In a couple uses of PrettyTable, I have added a similar function to allow for less code from my CLI projects. In those projects, I allow specifying the output format type as an arguments.

codecov[bot] commented 1 year ago

Codecov Report

Merging #241 (638a2ba) into main (03510e1) will increase coverage by 0.08%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   94.75%   94.83%   +0.08%     
==========================================
  Files           5        5              
  Lines        2326     2364      +38     
==========================================
+ Hits         2204     2242      +38     
  Misses        122      122              
Flag Coverage Δ
macos-latest 94.79% <100.00%> (+0.08%) :arrow_up:
ubuntu-latest 94.79% <100.00%> (+0.08%) :arrow_up:
windows-latest 94.75% <100.00%> (+0.08%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/prettytable/prettytable.py 91.32% <100.00%> (+0.07%) :arrow_up:
tests/test_prettytable.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

hugovk commented 1 year ago

Please could you document get_formatted_string somewhere in the README?

rickwporter commented 1 year ago

Please could you document get_formatted_string somewhere in the README?

Good call. I'm open to suggestions on the README. I was not quite sure where it best fit, or if my description length and content were appropriate.