frictionlessdata / datapackage-js

A JavaScript library for working with Data Package.
http://frictionlessdata.io/
MIT License
43 stars 15 forks source link

Investigate idea of TabularResource.js (combination of Resource.js and Table.js)? #59

Closed roll closed 7 years ago

roll commented 7 years ago

@rufuspollock:

i wondered if you had seen https://github.com/rufuspollock/dataframe.js - more discussion than code.

Particularly, wondering with connections with Resources.js / Table.js stuff in https://github.com/frictionlessdata/jsontableschema-js + https://github.com/frictionlessdata/datapackage-js#resource.

It seems to me that the Table.js could basically extend to this [i.e. dataframe / TabularResource) - or we could provide some wrappers … (i don’t know how well you know dataframe stuff in pandas http://pandas.pydata.org/pandas-docs/stable/dsintro.html#dataframe)

There is a some summary of dataframe libs in the README here https://github.com/rufuspollock/dataframe.js

rufuspollock commented 7 years ago

@roll i've renmaed it a bit to reflect the point. Basically, Table.js duplicates from of the stuff from a Tabular Resource.js. Are there ways to merge them and make an awesome TabularResource - that is developing in the direction of a proper DataFrame object ...

roll commented 7 years ago

@rufuspollock Resource and Table is just an implementations of specs. My first try was to have TabularResource but it just hadn't work with all requirements from 2 different specs, sql/bigquery/etc integrations, different repos etc.

So if we need to have DataFrame object we just should wrap existent Resource/Table API to provide needed high-level API. An attempt to have 1 API (class) to conform 3 different requirements (table schema spec, tabular resource spec and data frame spec) will probably fail I suppose.

But I still have to dive in your research)

rufuspollock commented 7 years ago

@roll let's distinguish:

Focus for now is the first item.

roll commented 7 years ago

FIXED/WONTFIX


In v1 release Resource provides both non-tabular and tabular interfaces. :

resource = await Resource.load('data.csv')
resource.read() // bytes
if (resource.tabular) {
  resource.table.read() // rows
}

Link to an alternative implementation data.js: