All Projects → vweevers → tabular-stream

vweevers / tabular-stream

Licence: MIT license
Detects tabular data (spreadsheets, dsv or json, 20+ different formats) and emits normalized objects.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tabular-stream

workbook
simple framework for containing spreadsheet like data
Stars: ✭ 13 (-61.76%)
Mutual labels:  csv, xlsx, xls, ods
Rows
A common, beautiful interface to tabular data, no matter the format
Stars: ✭ 739 (+2073.53%)
Mutual labels:  csv, xlsx, xls, tabular-data
Phpspreadsheet
A pure PHP library for reading and writing spreadsheet files
Stars: ✭ 10,627 (+31155.88%)
Mutual labels:  xlsx, xls, ods, sylk
eec
A fast and lower memory excel write/read tool.一个非POI底层,支持流式处理的高效且超低内存的Excel读写工具
Stars: ✭ 93 (+173.53%)
Mutual labels:  csv, stream, xlsx, xls
J
❌ Multi-format spreadsheet CLI (now merged in http://github.com/sheetjs/js-xlsx )
Stars: ✭ 343 (+908.82%)
Mutual labels:  csv, xlsx, xls
Spout
Read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way
Stars: ✭ 3,861 (+11255.88%)
Mutual labels:  csv, xlsx, ods
Sheetjs
📗 SheetJS Community Edition -- Spreadsheet Data Toolkit
Stars: ✭ 28,479 (+83661.76%)
Mutual labels:  csv, xlsx, xls
Tableexport
The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
Stars: ✭ 781 (+2197.06%)
Mutual labels:  csv, xlsx, xls
Pyexcel
Single API for reading, manipulating and writing data in csv, ods, xls, xlsx and xlsm files
Stars: ✭ 902 (+2552.94%)
Mutual labels:  csv, xlsx, xls
Myexcel
MyExcel, a new way to operate excel!
Stars: ✭ 1,198 (+3423.53%)
Mutual labels:  csv, xlsx, xls
Visidata
A terminal spreadsheet multitool for discovering and arranging data
Stars: ✭ 4,606 (+13447.06%)
Mutual labels:  tsv, csv, tabular-data
Miller
Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
Stars: ✭ 4,633 (+13526.47%)
Mutual labels:  tsv, csv, tabular-data
dbd
dbd is a database prototyping tool that enables data analysts and engineers to quickly load and transform data in SQL databases.
Stars: ✭ 30 (-11.76%)
Mutual labels:  csv, xlsx, xls
Meza
A Python toolkit for processing tabular data
Stars: ✭ 374 (+1000%)
Mutual labels:  csv, xlsx, tabular-data
Sq
swiss-army knife for data
Stars: ✭ 275 (+708.82%)
Mutual labels:  tsv, csv, xlsx
convey
CSV processing and web related data types mutual conversion
Stars: ✭ 16 (-52.94%)
Mutual labels:  csv, xlsx, ods
exoffice
Library to parse common excel formats (xls, xlsx, csv)
Stars: ✭ 31 (-8.82%)
Mutual labels:  csv, xlsx, xls
Documentserver
ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
Stars: ✭ 2,335 (+6767.65%)
Mutual labels:  xlsx, xls, ods
Android Gradle Localization Plugin
Gradle plugin for generating localized string resources
Stars: ✭ 100 (+194.12%)
Mutual labels:  csv, xlsx, xls
Faster Than Csv
Faster CSV on Python 3
Stars: ✭ 52 (+52.94%)
Mutual labels:  tsv, csv, tabular-data

tabular-stream

Note: the core of tabular-stream 1.0 has moved to detect-tabular. This is now a data normalizer on top of that.

Detects tabular data (spreadsheets, dsv or json, 20+ different formats) and emits objects. Ensures all rows have the same keys, optionally transforms keys and tries to coerce values to numbers. Spreadsheets and DSV must have a header.

npm status node Test Standard

Example

npm i tabular-stream snake-case format-data
const tabular = require('tabular-stream')
const fs = require('fs')
const snake = require('snake-case').snakeCase
const format = require('format-data')

fs.createReadStream('test/air_pollution_nl.xlsx')
  .pipe(tabular(snake))
  .pipe(format('json'))
  .pipe(process.stdout)

Need a CLI doing just this? Jump to tabular-cli, which pairs tabular-stream with format-data to convert tabular data to json, ndjson, dsv or sse. For example:

tabular -k snake-case -o tsv < input.xls > output.tsv

API

tabular([keys || options])

Returns a duplex stream - give it any tabular data, get back objects. (keys) is a shorthand for ({ keys: keys }). The available options are:

function keys

An optional function to transform and/or filter keys. Receives a single argument, for every key of the first row. Everything at change-case works well. If it returns an empty string or anything other than a string, the key is ignored (i.e. not included in the emitted objects).

function keys(key) {
  if (key === 'useless') return false
  return key.toUpperCase()
}

mixed defaultValue

Fallback value to use for null and undefined values. Default is 0.

boolean bare

Whether to emit null prototype objects via Object.create(null) or plain javascript objects (the default).

Other

Other options are passed as-is to spreadsheet-stream (if applicable). NB. Because the binary spreadsheets formats are not streamable, spreadsheet-stream will buffer the whole thing in memory. As a safe-guard you can set the maxSize option (in bytes): tabular({ maxSize: 1024 * 1024 }). See spreadsheet-stream for details.

Install

With npm do:

npm install tabular-stream

License

MIT.

Test data © Statistics Netherlands, The Hague/Heerlen.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].