Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d7b9d11
Bootstrapped json plugin
roll Aug 4, 2025
14bbce6
Bootstrapped parquet plugin
roll Aug 4, 2025
107196f
Bootstraped overviews
roll Aug 4, 2025
017e58c
Bootstrapped avro plugin
roll Aug 4, 2025
1dd3f6b
Removed unused dependencies
roll Aug 5, 2025
6d5bccb
Updated slugify library
roll Aug 5, 2025
36422de
Added TODO
roll Aug 5, 2025
351d3e9
Implemented avro loader
roll Aug 5, 2025
7885430
Dropped avro plugin
roll Aug 5, 2025
f634e3b
Implemented parquet load
roll Aug 5, 2025
956aaf3
Implemented arrow loader
roll Aug 5, 2025
9ea207b
Implemented save to arrow/parquet
roll Aug 5, 2025
a1e084c
Added arrow/parquet to the docs
roll Aug 5, 2025
ae79e48
Implemented jsonl load
roll Aug 6, 2025
b34c811
Implemented save jsonl table
roll Aug 6, 2025
68547ae
Loading json dialect support
roll Aug 6, 2025
47edb1a
Added dialect support to jsonl
roll Aug 6, 2025
1b9d7f4
Extraced common loadTable
roll Aug 6, 2025
9154822
Implemented saving json
roll Aug 6, 2025
91ad47b
Simplifed docs
roll Aug 6, 2025
3871db1
Added json docs
roll Aug 6, 2025
68a6b9e
Added arrow guide
roll Aug 6, 2025
62ae655
Added parquet guide
roll Aug 6, 2025
6f08783
Fixed zenodo tests
roll Aug 6, 2025
36fc921
Fixed timezone issue
roll Aug 7, 2025
5c8ef7d
Supress polly.js warnings
roll Aug 7, 2025
4fb53e2
Fixed recordings naming
roll Aug 7, 2025
e943718
Updated tsconfig
roll Aug 7, 2025
6c1160b
Fixed build
roll Aug 7, 2025
0983e16
Fixed examples
roll Aug 7, 2025
b46cbac
Fixed folder plugin bug
roll Aug 7, 2025
4c062c1
Added deno/bun/browser support notes
roll Aug 7, 2025
8775ec2
Removed tempy when not needed
roll Aug 7, 2025
4130280
Added polly note
roll Aug 7, 2025
01f645a
Don't use node globals
roll Aug 7, 2025
1a6f6f4
Fixed examples
roll Aug 7, 2025
b9778bb
Renamed general dirs
roll Aug 7, 2025
38a3e8c
Added core/general todo
roll Aug 7, 2025
247276b
Updated broken snapshots
roll Aug 7, 2025
c7b19bd
Added notebooks guide
roll Aug 7, 2025
0b27e63
Added CLI dependencies
roll Aug 7, 2025
ce68222
Bootstrapped cli
roll Aug 7, 2025
b7a032c
Bootstrapped load command
roll Aug 7, 2025
eb2d1f9
Fixed cli
roll Aug 7, 2025
75b86a4
Rebased on es2022
roll Aug 8, 2025
5060aee
Rebased on unified tsconfig
roll Aug 8, 2025
be8f73b
Exclude docs from build
roll Aug 8, 2025
6b0edb7
Rebased from main to exports
roll Aug 8, 2025
30a4178
Rebased on ts extensions
roll Aug 8, 2025
fbb0128
Enable cli building
roll Aug 8, 2025
c093e82
Improved cli build command
roll Aug 8, 2025
f6059a0
Improved package:load
roll Aug 8, 2025
07f98a7
Fixed dpkit packageLoad
roll Aug 8, 2025
84d0f10
Added inferDialect command
roll Aug 8, 2025
22bf1c0
Bootstrapped ReadTable
roll Aug 8, 2025
a83dc93
Added Table component
roll Aug 9, 2025
e771d7b
Implemented ordering
roll Aug 9, 2025
9d199c6
Fixed csv header
roll Aug 9, 2025
f80ec16
Added shortcuts
roll Aug 9, 2025
23d7e40
Added stats command
roll Aug 9, 2025
f876ad0
Added dialect options
roll Aug 9, 2025
75c15aa
Renamed stats to describe
roll Aug 9, 2025
98d0c52
Added autocomplete support
roll Aug 9, 2025
768a97b
Renamed read to explore
roll Aug 9, 2025
819609e
Bootstrapped table validate
roll Aug 9, 2025
e74f28b
Bootstrapped validate
roll Aug 9, 2025
ae1747e
Removed bin package
roll Aug 9, 2025
f7f4999
Added ConvertTable command
roll Aug 9, 2025
93a7ce6
Added more table commands
roll Aug 9, 2025
97efb72
Removed chat command
roll Aug 9, 2025
900cbde
Fixed tests
roll Aug 11, 2025
dc9c48a
Added changesets
roll Aug 11, 2025
baaade0
Bootstrapped CLI topic docs
roll Aug 11, 2025
c32678d
Updated guide sidebar labels
roll Aug 11, 2025
e45b674
Rebased on toPath in table convert
roll Aug 11, 2025
1ebda94
Fixed cli build
roll Aug 11, 2025
0b8f0e9
Separate entrypoints/scripts
roll Aug 11, 2025
8553fd0
Improved table help
roll Aug 11, 2025
ce6965a
Added support for convert into stdout
roll Aug 11, 2025
cf6c4cb
Added d/r func under dev
roll Aug 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .changeset/breezy-knives-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
"@dpkit/camtrap": minor
"@dpkit/datahub": minor
"@dpkit/parquet": minor
"@dpkit/extend": minor
"@dpkit/folder": minor
"@dpkit/github": minor
"@dpkit/inline": minor
"@dpkit/zenodo": minor
"@dpkit/arrow": minor
"dpkit": minor
"@dpkit/excel": minor
"@dpkit/table": minor
"@dpkit/ckan": minor
"@dpkit/core": minor
"@dpkit/file": minor
"@dpkit/json": minor
"@dpkit/test": minor
"@dpkit/cli": minor
"@dpkit/csv": minor
"@dpkit/ods": minor
"@dpkit/zip": minor
"@dpkit/db": minor
"@dpkit/ui": minor
---

Added Json/Jsonl/Arrow/Parquet support; Bootstrapped CLI
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ pids
.vscode/
.wrangler/
build/
compile/
dist/
.astro/
/docs/content/docs/packages/
/docs/content/docs/reference/
**/.claude/settings.local.json
AGENTS.md
CLAUDE.md
Expand Down
2 changes: 2 additions & 0 deletions arrow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# @dpkit/arrow

2 changes: 1 addition & 1 deletion bin/README.md → arrow/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @dpkit/bin
# @dpkit/arrow

dpkit is a fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames. It supports various formats like CSV, JSON, and Parquet and integrates with data platforms such as CKAN, Zenodo, and GitHub. For more information, please visit the [documentation portal](https://dpkit.datist.io).
2 changes: 2 additions & 0 deletions arrow/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./table/index.ts"
export * from "./plugin.ts"
20 changes: 15 additions & 5 deletions avro/package.json → arrow/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@dpkit/avro",
"name": "@dpkit/arrow",
"type": "module",
"main": "build/index.js",
"version": "0.2.0",
"version": "0.1.0",
"exports": "./build/index.js",
"license": "MIT",
"author": "Evgeny Karev",
"repository": "https://github.com/datisthq/dpkit",
Expand All @@ -17,9 +17,19 @@
"validation",
"quality",
"fair",
"avro"
"parquet"
],
"scripts": {
"build": "tsc --build"
"build": "tsc"
},
"dependencies": {
"@dpkit/core": "workspace:*",
"@dpkit/file": "workspace:*",
"@dpkit/table": "workspace:*",
"csv-sniffer": "^0.1.1",
"nodejs-polars": "^0.21.0"
},
"devDependencies": {
"@dpkit/test": "workspace:*"
}
}
26 changes: 26 additions & 0 deletions arrow/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { Resource } from "@dpkit/core"
import { inferFormat } from "@dpkit/core"
import type { TablePlugin } from "@dpkit/table"
import type { SaveTableOptions, Table } from "@dpkit/table"
import { loadArrowTable, saveArrowTable } from "./table/index.ts"

export class ArrowPlugin implements TablePlugin {
async loadTable(resource: Partial<Resource>) {
const isArrow = getIsArrow(resource)
if (!isArrow) return undefined

return await loadArrowTable(resource)
}

async saveTable(table: Table, options: SaveTableOptions) {
const isArrow = getIsArrow(options)
if (!isArrow) return undefined

return await saveArrowTable(table, options)
}
}

function getIsArrow(resource: Partial<Resource>) {
const format = inferFormat(resource)
return format === "arrow" || format === "feather"
}
Binary file added arrow/table.arrow
Binary file not shown.
Binary file added arrow/table/fixtures/table.arrow
Binary file not shown.
2 changes: 2 additions & 0 deletions arrow/table/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { loadArrowTable } from "./load.ts"
export { saveArrowTable } from "./save.ts"
64 changes: 64 additions & 0 deletions arrow/table/load.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { getTempFilePath } from "@dpkit/file"
import { useRecording } from "@dpkit/test"
import { DataFrame } from "nodejs-polars"
import { describe, expect, it } from "vitest"
import { loadArrowTable } from "./load.ts"

describe("loadArrowTable", () => {
useRecording()

describe("file variations", () => {
it("should load local file", async () => {
const path = getTempFilePath()
DataFrame({ id: [1, 2], name: ["english", "中文"] }).writeIPC(path)

const table = await loadArrowTable({ path })
expect((await table.collect()).toRecords()).toEqual([
{ id: 1, name: "english" },
{ id: 2, name: "中文" },
])
})

it("should load local file (multipart)", async () => {
const path1 = getTempFilePath()
const path2 = getTempFilePath()
DataFrame({ id: [1, 2], name: ["english", "中文"] }).writeIPC(path1)
DataFrame({ id: [1, 2], name: ["english", "中文"] }).writeIPC(path2)

const table = await loadArrowTable({ path: [path1, path2] })
expect((await table.collect()).toRecords()).toEqual([
{ id: 1, name: "english" },
{ id: 2, name: "中文" },
{ id: 1, name: "english" },
{ id: 2, name: "中文" },
])
})

it.skip("should load remote file", async () => {
const table = await loadArrowTable({
path: "https://github.com/frictionlessdata/frictionless-py/raw/refs/heads/main/data/table.arrow",
})

expect((await table.collect()).toRecords()).toEqual([
{ id: 1, name: "english" },
{ id: 2, name: "中国人" },
])
})

it.skip("should load remote file (multipart)", async () => {
const table = await loadArrowTable({
path: [
"https://github.com/frictionlessdata/frictionless-py/raw/refs/heads/main/data/table.arrow",
"https://github.com/frictionlessdata/frictionless-py/raw/refs/heads/main/data/table.arrow",
],
})

expect((await table.collect()).toRecords()).toEqual([
{ id: 1, name: "english" },
{ id: 2, name: "中国人" },
{ id: 1, name: "english" },
{ id: 2, name: "中国人" },
])
})
})
})
19 changes: 19 additions & 0 deletions arrow/table/load.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Resource } from "@dpkit/core"
import { prefetchFiles } from "@dpkit/file"
import { concat } from "nodejs-polars"
import { DataFrame } from "nodejs-polars"
import { scanIPC } from "nodejs-polars"

export async function loadArrowTable(resource: Partial<Resource>) {
const [firstPath, ...restPaths] = await prefetchFiles(resource.path)
if (!firstPath) {
return DataFrame().lazy()
}

let table = scanIPC(firstPath)
if (restPaths.length) {
table = concat([table, ...restPaths.map(path => scanIPC(path))])
}

return table
}
24 changes: 24 additions & 0 deletions arrow/table/save.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { getTempFilePath } from "@dpkit/file"
import { DataFrame } from "nodejs-polars"
import { describe, expect, it } from "vitest"
import { loadArrowTable } from "./load.ts"
import { saveArrowTable } from "./save.ts"

describe("saveArrowTable", () => {
it("should save table to Arrow file", async () => {
const path = getTempFilePath()
const source = DataFrame({
id: [1.0, 2.0, 3.0],
name: ["Alice", "Bob", "Charlie"],
}).lazy()

await saveArrowTable(source, { path })

const target = await loadArrowTable({ path })
expect((await target.collect()).toRecords()).toEqual([
{ id: 1.0, name: "Alice" },
{ id: 2.0, name: "Bob" },
{ id: 3.0, name: "Charlie" },
])
})
})
13 changes: 13 additions & 0 deletions arrow/table/save.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { SaveTableOptions, Table } from "@dpkit/table"

// TODO: rebase on sinkIPC when it is available
// https://github.com/pola-rs/nodejs-polars/issues/353

export async function saveArrowTable(table: Table, options: SaveTableOptions) {
const { path } = options

const df = await table.collect()
df.writeIPC(path)

return path
}
3 changes: 3 additions & 0 deletions arrow/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../tsconfig.json"
}
4 changes: 4 additions & 0 deletions arrow/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entryPoints": ["index.ts"],
"skipErrorChecking": true
}
7 changes: 0 additions & 7 deletions avro/CHANGELOG.md

This file was deleted.

3 changes: 0 additions & 3 deletions avro/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions avro/tsconfig.json

This file was deleted.

5 changes: 0 additions & 5 deletions bin/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions camtrap/OVERVIEW.md

This file was deleted.

2 changes: 1 addition & 1 deletion camtrap/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./package/index.js"
export * from "./package/index.ts"
4 changes: 2 additions & 2 deletions camtrap/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@dpkit/camtrap",
"type": "module",
"main": "build/index.js",
"version": "0.5.1",
"exports": "./build/index.js",
"license": "MIT",
"author": "Evgeny Karev",
"repository": "https://github.com/datisthq/dpkit",
Expand All @@ -20,7 +20,7 @@
"camtrap"
],
"scripts": {
"build": "tsc --build"
"build": "tsc"
},
"dependencies": {
"@dpkit/core": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion camtrap/package/assert.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AssertionError, validatePackageDescriptor } from "@dpkit/core"
import type { Descriptor, Package } from "@dpkit/core"
import type { CamtrapPackage } from "./Package.js"
import type { CamtrapPackage } from "./Package.ts"

const SUPPORTED_PROFILES = [
"https://raw.githubusercontent.com/tdwg/camtrap-dp/1.0/camtrap-dp-profile.json",
Expand Down
4 changes: 2 additions & 2 deletions camtrap/package/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type { CamtrapPackage } from "./Package.js"
export { assertCamtrapPackage } from "./assert.js"
export type { CamtrapPackage } from "./Package.ts"
export { assertCamtrapPackage } from "./assert.ts"
9 changes: 1 addition & 8 deletions camtrap/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"exclude": ["**/build/"],
"compilerOptions": {
"outDir": "build",
"noEmit": false,
"declaration": true
}
"extends": "../tsconfig.json"
}
1 change: 0 additions & 1 deletion camtrap/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"entryPoints": ["index.ts"],
"projectDocuments": ["CHANGELOG.md", "OVERVIEW.md"],
"skipErrorChecking": true
}
6 changes: 0 additions & 6 deletions ckan/OVERVIEW.md

This file was deleted.

1 change: 1 addition & 0 deletions ckan/ckan/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { makeCkanApiRequest } from "./request.ts"
File renamed without changes.
1 change: 0 additions & 1 deletion ckan/general/index.ts

This file was deleted.

8 changes: 4 additions & 4 deletions ckan/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./package/index.js"
export * from "./resource/index.js"
export * from "./schema/index.js"
export * from "./plugin.js"
export * from "./package/index.ts"
export * from "./resource/index.ts"
export * from "./schema/index.ts"
export * from "./plugin.ts"
4 changes: 2 additions & 2 deletions ckan/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@dpkit/ckan",
"type": "module",
"main": "build/index.js",
"version": "0.6.0",
"exports": "./build/index.js",
"license": "MIT",
"author": "Evgeny Karev",
"repository": "https://github.com/datisthq/dpkit",
Expand All @@ -20,7 +20,7 @@
"ckan"
],
"scripts": {
"build": "tsc --build"
"build": "tsc"
},
"dependencies": {
"@dpkit/core": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions ckan/package/Package.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CkanResource } from "../resource/index.js"
import type { CkanOrganization } from "./Organization.js"
import type { CkanTag } from "./Tag.js"
import type { CkanResource } from "../resource/index.ts"
import type { CkanOrganization } from "./Organization.ts"
import type { CkanTag } from "./Tag.ts"

/**
* CKAN Package interface
Expand Down
Loading