Skip to content
AddHunt
VS Code extensions

Pastum

VS Code extension that pastes tables as dataframes

Works with Visual Studio Marketplace, Open VSXOpen source

  • Open source
  • Licence: MIT

In short

Pastum is a VS Code extension that converts a text table on the clipboard into dataframe code for R, Python, Julia, JavaScript or Markdown. It is aimed at data analysts and scientists who copy tables from the web, Excel or Word into their scripts.

What you get

  • Paste clipboard tables as dataframe code
  • Targets R, Python, Julia, JavaScript and Markdown
  • Supports pandas, polars, tibble, data.table and DataFrames.jl
  • Command palette and right-click menu commands
  • Configurable default language and framework
  • Automatic string, integer and float detection

The details

Pastum removes the step of retyping a table by hand as code. A table copied from a web page, an Excel sheet or a Word document can be inserted into the editor as a dataframe definition in the chosen language and library.

Supported targets

  • R: tibble (including tribble and a transposed form), data.frame and data.table
  • Python: pandas and polars
  • Julia: DataFrames.jl
  • JavaScript: arquero
  • Markdown tables

How it works

The extension adds entries to the command palette and to the editor's right-click menu. The context-menu command uses a default language and framework pair set in the settings, such as Python with pandas or R with tibble, while separate palette commands let users pick a different target each time they paste.

Column types are detected automatically as strings, integers or floats. A column becomes float when any of its values is a float; otherwise it is treated as integer. By default, floats get trailing zeros so that the output also suits polars.

Pastum is open source under the MIT license and can be installed from the Visual Studio Marketplace or from the Open VSX Registry.

Alternatives to Pastum

Questions

Where can a table be copied from?

Any text table on the clipboard works, for example a table from a web page such as Wikipedia, an Excel sheet or a Word document.

Which dataframe libraries does Pastum support?

It has built-in support for pandas, polars, tibble, data.table and DataFrames.jl, and it can also produce arquero code for JavaScript or a Markdown table.

Can the default output be changed?

Yes. The right-click command uses a language and framework pair chosen in the settings, and the command palette offers commands to pick another target on the fly.

More like this