
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@vizabi/reader-ddfcsv
Advanced tools
This package implements DDF model for datasets made of csv files and a datapackage.json. Once initialised, this reader can receive DDFQL queries, perform data searching, filtering, joinery etc and output an tidy data array for data visualisation.
See live example here https://observablehq.com/@vizabi/ddfcsv-reader
npm i @vizabi/reader-ddfcsv
There are two implementations: for frontend and backend. Additionally, you can customise file reading plugin, so that for example backend implementation would fetch files online instead of reading locally.
Backend implementation is at lib/src/index.js, also usable via es6 import import DDFCsvReader from "@vizabi/reader-ddfcsv", as aliased by "main" field in package.json
Frontend implementation is at lib-web/src/index-web.js, also bundled and minified to dist/reader-ddfcsv.js
//this will import "lib/src/index.js", aliased by "main" in package.json
import DDFCsvReader from "@vizabi/reader-ddfcsv";
//init
const readerInstance = new DDFCsvReader.getDDFCsvReaderObject();
readerInstance.init({path: "path/to/local/dataset/root"});
//test reading some concepts
const concepts = await readerInstance.read({
from: "concepts",
language: "en",
select: {key: ["concept"], value: ["concept_type", "name"]},
where: {}
})
On a plain webpage use
import "@vizabi/reader-ddfcsv/dist/reader-ddfcsv.js";
//init
const ddfReader = new DDFCsvReader.getDDFCsvReaderObject();
reader.init({
path: "https://github.com/open-numbers/ddf--gapminder--fasttrack.git"
})
const data = await readerInstance.read({
from: "datapoints",
language: "en",
select: {key: ["country", "time"], value: ["gdp_pcap", "lex", "pop"]},
where: {}
})
In Observable notebooks use
DDFCsvReader = require('https://unpkg.com/@vizabi/reader-ddfcsv@4.5.2')
which will redirect to https://unpkg.com/@vizabi/reader-ddfcsv@4.5.1/dist/reader-ddfcsv.js
See the Live demo
Each implementation has its own default file readers built-in:
lib-web/src/index-web.js version, also usable from dist/reader-ddfcsv.jslib/src/index.js version.You can find in the source code and import them readers separately
import { FrontendFileReader } from "@vizabi/reader-ddfcsv/lib-web/src/index-web.js";
This reader is designed for file reading via HTTP protocol. It uses fetch, which since v4.5.2 is no longer polyfilled
This reader is designed for file reading via OS file system. It uses fs and path
The backend version of DDFCsvReader defaults to fs for local files.
To fetch data from GitHub (or any remote source), inject the FrontendFileReader:
import DDFCsvReader from "@vizabi/reader-ddfcsv";
import { FrontendFileReader } from "@vizabi/reader-ddfcsv/lib-web/src/index-web.js";
//init
const readerInstance = new DDFCsvReader.prepareDDFCsvReaderObject(new FrontendFileReader)();
readerInstance.init({ path: "https://github.com/open-numbers/ddf--gapminder--ai_worldview_benchmark.git" });
//usage example
const concepts = await readerInstance.read({
from: "concepts",
language: "en",
select: {key: ["concept"], value: ["concept_type", "name"]},
where: {}
})
Once you can access concepts of a dataset you can run any other DDFQL query, see DDFQL specs
//typical datapoint query
data = readerInstance.read({
from: "datapoints",
language: "en",
select: {key: ["country", "time"], value: ["gdp_pcap", "lex", "pop"]},
where: {}
})
interactive example: https://observablehq.com/@vizabi/ddfcsv-reader
git clone https://github.com/vizabi/reader-ddfcsv.git
cd reader-ddfcsv
npm i
npm run build
npm test
FAQs
Vizabi DDFcsv reader
We found that @vizabi/reader-ddfcsv demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.