Youtrack Markdown

It asked to update a few plugins too (markdown, IdeaVIM, bash support, etc). Edit: https://youtrack.jetbrains.com/issue/IDEA-164286. Top Android Studio Plugins for Android App Development,Top Plugins for Android Studio App Development,Best Android Studio Plugins.

  1. Youtrack Markdown Emoji
  2. Youtrack Markdown
Latest version

Released:

Pretty-print tabular data

Project description

Pretty-print tabular data in Python, a library and a command-lineutility.

The main use cases of the library are:

  • printing small tables without hassle: just one function call,formatting is guided by the data itself
  • authoring tabular data for lightweight plain-text markup: multipleoutput formats suitable for further editing or transformation
  • readable presentation of mixed textual and numeric data: smartcolumn alignment, configurable number formatting, alignment by adecimal point

Installation

To install the Python library and the command line utility, run:

The command line utility will be installed as tabulate to bin onLinux (e.g. /usr/bin); or as tabulate.exe to Scripts in yourPython installation on Windows (e.g.C:Python27Scriptstabulate.exe).

You may consider installing the library only for the current user:

In this case the command line utility will be installed to~/.local/bin/tabulate on Linux and to%APPDATA%PythonScriptstabulate.exe on Windows.

To install just the library on Unix-like operating systems:

On Windows:

Youtrack markdown emoji

The module provides just one function, tabulate, which takes a list oflists or another tabular data type as the first argument, and outputs anicely formatted plain-text table:

Youtrack Markdown Emoji

The following tabular data types are supported:

  • list of lists or another iterable of iterables
  • list or another iterable of dicts (keys as columns)
  • dict of iterables (keys as columns)
  • two-dimensional NumPy array
  • NumPy record arrays (names as columns)
  • pandas.DataFrame

Examples in this file use Python2. Tabulate supports Python3 too.

Headers

The second optional argument named headers defines a list of columnheaders to be used:

If headers='firstrow', then the first row of data is used:

If headers='keys', then the keys of a dictionary/dataframe, or columnindices are used. It also works for NumPy record arrays and lists ofdictionaries or named tuples:

Row Indices

By default, only pandas.DataFrame tables have an additional columncalled row index. To add a similar column to any other type of table,pass showindex='always' or showindex=True argument to tabulate().To suppress row indices for all types of data, pass showindex='never'or showindex=False. To add a custom row index column, passshowindex=rowIDs, where rowIDs is some iterable:

Table format

There is more than one way to format a table in plain text. The thirdoptional argument named tablefmt defines how the table is formatted.

Supported table formats are:

  • 'plain'
  • 'simple'
  • 'github'
  • 'grid'
  • 'fancy_grid'
  • 'pipe'
  • 'orgtbl'
  • 'jira'
  • 'presto'
  • 'pretty'
  • 'psql'
  • 'rst'
  • 'mediawiki'
  • 'moinmoin'
  • 'youtrack'
  • 'html'
  • 'unsafehtml'
  • 'latex'
  • 'latex_raw'
  • 'latex_booktabs'
  • 'latex_longtable'
  • 'textile'
  • 'tsv'

plain tables do not use any pseudo-graphics to draw lines:

simple is the default format (the default may change in futureversions). It corresponds to simple_tables in Pandoc Markdownextensions:

github follows the conventions of GitHub flavored Markdown. Itcorresponds to the pipe format without alignment colons:

grid is like tables formatted by Emacs'table.el package. It corresponds togrid_tables in Pandoc Markdown extensions:

fancy_grid draws a grid using box-drawing characters:

presto is like tables formatted by Presto cli:

pretty attempts to be close to the format emitted by the PrettyTableslibrary:

psql is like tables formatted by Postgres' psql cli:

pipe follows the conventions of PHP MarkdownExtra extension.It corresponds to pipe_tables in Pandoc. This format uses colons toindicate column alignment:

orgtbl follows the conventions of Emacsorg-mode, and is editable alsoin the minor orgtbl-mode. Hence its name:

jira follows the conventions of Atlassian Jira markup language:

Youtrack Markdown

rst formats data like a simple table of thereStructuredTextformat:

mediawiki format produces a table markup used inWikipedia and on otherMediaWiki-based sites:

moinmoin format produces a table markup used inMoinMoin wikis:

youtrack format produces a table markup used in Youtrack tickets:

textile format produces a table markup used inTextile format:

html produces standard HTML markup as an html.escape'd strwith a .repr_html method so that Jupyter Lab and Notebook display the HTMLand a .str property so that the raw HTML remains accessible.unsafehtml table format can be used if an unescaped HTML is required:

latex format creates a tabular environment for LaTeX markup,replacing special characters like _ or to their LaTeXcorrespondents:

latex_raw behaves like latex but does not escape LaTeX commands andspecial characters.

latex_booktabs creates a tabular environment for LaTeX markup usingspacing and style from the booktabs package.

latex_longtable creates a table that can stretch along multiple pages,using the longtable package.

Column alignment

tabulate is smart about column alignment. It detects columns whichcontain only numbers, and aligns them by a decimal point (or flushesthem to the right if they appear to be integers). Text columns areflushed to the left.

You can override the default alignment with numalign and stralignnamed arguments. Possible column alignments are: right, center,left, decimal (only for numbers), and None (to disable alignment).

Aligning by a decimal point works best when you need to compare numbersat a glance:

Compare this with a more common right alignment:

Looking for Mac fonts? Click to find the best 65 free fonts in the Mac style. Every font is free to download! You need to open Free Fonts from your Applications folder and then click the Copy Files button in the main window to save the folder of fonts to a location on your computer. You can then use Font Book to manage and install the fonts. Fonts for mac apple.

For tabulate, anything which can be parsed as a number is a number.Even numbers represented as strings are aligned properly. This featurecomes in handy when reading a mixed table of text and numbers from afile:

To disable this feature use disable_numparse=True.

Custom column alignment

tabulate allows a custom column alignment to override the above. Thecolalign argument can be a list or a tuple of stralign namedarguments. Possible column alignments are: right, center, left,decimal (only for numbers), and None (to disable alignment).Omitting an alignment uses the default. For example:

Number formatting

tabulate allows to define custom number formatting applied to allcolumns of decimal numbers. Use floatfmt named argument:

floatfmt argument can be a list or a tuple of format strings, one percolumn, in which case every column may have different number formatting:

Text formatting

By default, tabulate removes leading and trailing whitespace from textcolumns. To disable whitespace removal, set the global module-level flagPRESERVE_WHITESPACE:

Wide (fullwidth CJK) symbols

To properly align tables which contain wide characters (typicallyfullwidth glyphs from Chinese, Japanese or Korean languages), the usershould install wcwidth library. To install it together withtabulate:

Wide character support is enabled automatically if wcwidth library isalready installed. To disable wide characters support withoutuninstalling wcwidth, set the global module-level flagWIDE_CHARS_MODE:

Multiline cells

Most table formats support multiline cell text (text containing newlinecharacters). The newline characters are honored as line breakcharacters.

Multiline cells are supported for data rows and for header rows.

Further automatic line breaks are not inserted. Of course, some outputformats such as latex or html handle automatic formatting of the cellcontent on their own, but for those that don't, the newline charactersin the input cell text are the only means to break a line in cell text.

Note that some output formats (e.g. simple, or plain) do not representrow delimiters, so that the representation of multiline cells in suchformats may be ambiguous to the reader.

The following examples of formatted output use the following table witha multiline cell, and headers with a multiline cell:

plain tables:

simple tables:

grid tables:

fancy_grid tables:

pipe tables:

orgtbl tables:

jira tables:

presto tables:

pretty tables:

psql tables:

rst tables:

Multiline cells are not well supported for the other table formats.

Usage of the command line utility

Performance considerations

Such features as decimal point alignment and trying to parse everythingas a number imply that tabulate:

  • has to 'guess' how to print a particular tabular data type
  • needs to keep the entire table in-memory
  • has to 'transpose' the table twice
  • does much more work than it may appear

It may not be suitable for serializing really big tables (but who'sgoing to do that, anyway?) or printing tables in performance sensitiveapplications. tabulate is about two orders of magnitude slower thansimply joining lists of values with a tab, comma, or other separator.

At the same time, tabulate is comparable to other tablepretty-printers. Given a 10x10 table (a list of lists) of mixed text andnumeric data, tabulate appears to be slower than asciitable, andfaster than PrettyTable and texttable The following mini-benchmarkwas run in Python 3.8.3 in Windows 10 x64:

Version history

The full version history can be found at the changelog.

How to contribute

Contributions should include tests and an explanation for the changesthey propose. Documentation (examples, docstrings, README.md) should beupdated accordingly.

This project uses pytest testingframework and tox to automate testing indifferent environments. Add tests to one of the files in the test/folder.

To run tests on all supported Python versions, make sure all Pythoninterpreters, pytest and tox are installed, then run tox in the rootof the project source tree.

On Linux tox expects to find executables like python2.6,python2.7, python3.4 etc. On Windows it looks forC:Python26python.exe, C:Python27python.exe andC:Python34python.exe respectively.

To test only some Python environments, use -e option. For example, totest only against Python 2.7 and Python 3.8, run:

in the root of the project source tree.

To enable NumPy and Pandas tests, run:

(this may take a long time the first time, because NumPy and Pandas willhave to be installed in the new virtual environments)

To fix code formatting:

See tox.ini file to learn how to use to testindividual Python versions.

Contributors

Youtrack markdown

Sergey Astanin, Pau Tallada Crespí, Erwin Marsi, Mik Kocikowski, BillRyder, Zach Dwiel, Frederik Rietdijk, Philipp Bogensberger, Greg(anonymous), Stefan Tatschner, Emiel van Miltenburg, Brandon Bennett,Amjith Ramanujam, Jan Schulz, Simon Percivall, Javier SantacruzLópez-Cepero, Sam Denton, Alexey Ziyangirov, acaird, Cesar Sanchez,naught101, John Vandenberg, Zack Dever, Christian Clauss, BenjaminMaier, Andy MacKinlay, Thomas Roten, Jue Wang, Joe King, Samuel Phan,Nick Satterly, Daniel Robbins, Dmitry B, Lars Butler, Andreas Maier,Dick Marinus, Sébastien Celles, Yago González, Andrew Gaul, Wim Glenn,Jean Michel Rouly, Tim Gates, John Vandenberg, Sorin Sbarnea,Wes Turner, Andrew Tija, Marco Gorelli, Sean McGinnis, danja100,endolith, Dominic Davis-Foster, pavlocat, Daniel Aslau, paulc,Felix Yan, Shane Loretz, Frank Busse, Harsh Singh, Derek Weitzel,Vladimir Vrzić, 서승우 (chrd5273), Georgy Frolov, Christian Cwienk,Bart Broere, Vilhelm Prytz.

Release historyRelease notifications RSS feed

0.8.9

0.8.8

0.8.7

0.8.6

0.8.5

0.8.4

0.8.3

0.8.2

0.8.1

0.8.0

0.7.7

0.7.6

0.7.5

0.7.4

0.7.3

0.7.2

0.7.1

0.7

0.6

0.5.1

0.5

0.4.4

0.4.3

0.4.2

0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tabulate, version 0.8.9
Filename, sizeFile typePython versionUpload dateHashes
Filename, size tabulate-0.8.9-py3-none-any.whl (25.1 kB) File type Wheel Python version py3 Upload dateHashes
Filename, size tabulate-0.8.9.tar.gz (53.5 kB) File type Source Python version None Upload dateHashes
Close

Hashes for tabulate-0.8.9-py3-none-any.whl

Hashes for tabulate-0.8.9-py3-none-any.whl
AlgorithmHash digest
SHA256d7c013fe7abbc5e491394e10fa845f8f32fe54f8dc60c6622c6cf482d25d47e4
MD51a2ab1fba64a6c181c0c0924601c0851
BLAKE2-256ca807c0cad11bd99985cfe7c09427ee0b4f9bd6b048bd13d4ffb32c6db237dfb
Close

Hashes for tabulate-0.8.9.tar.gz

Hashes for tabulate-0.8.9.tar.gz
AlgorithmHash digest
SHA256eb1d13f25760052e8931f2ef80aaf6045a6cceb47514db8beab24cded16f13a7
MD571e6f214512ceda2892be47767156754
BLAKE2-256ae3d9d7576d94007eaf3bb685acbaaec66ff4cdeb0b18f1bf1f17edbeebffb0a