@ohos-ports/nodejs-polars 0.23.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +217 -0
- package/bin/cfg.d.ts +156 -0
- package/bin/cfg.js +52 -0
- package/bin/dataframe.d.ts +2135 -0
- package/bin/dataframe.js +783 -0
- package/bin/datatypes/conversion.d.ts +2 -0
- package/bin/datatypes/conversion.js +2 -0
- package/bin/datatypes/datatype.d.ts +285 -0
- package/bin/datatypes/datatype.js +430 -0
- package/bin/datatypes/field.d.ts +26 -0
- package/bin/datatypes/field.js +36 -0
- package/bin/datatypes/index.d.ts +43 -0
- package/bin/datatypes/index.js +120 -0
- package/bin/error.d.ts +7 -0
- package/bin/error.js +17 -0
- package/bin/functions.d.ts +26 -0
- package/bin/functions.js +208 -0
- package/bin/groupby.d.ts +212 -0
- package/bin/groupby.js +156 -0
- package/bin/html.d.ts +4 -0
- package/bin/html.js +18 -0
- package/bin/index.d.ts +256 -0
- package/bin/index.js +267 -0
- package/bin/internals/construction.d.ts +7 -0
- package/bin/internals/construction.js +256 -0
- package/bin/internals/polars_internal.d.ts +2 -0
- package/bin/internals/polars_internal.js +7 -0
- package/bin/io.d.ts +433 -0
- package/bin/io.js +344 -0
- package/bin/lazy/dataframe.d.ts +785 -0
- package/bin/lazy/dataframe.js +427 -0
- package/bin/lazy/expr/datetime.d.ts +8 -0
- package/bin/lazy/expr/datetime.js +27 -0
- package/bin/lazy/expr/index.d.ts +1152 -0
- package/bin/lazy/expr/index.js +632 -0
- package/bin/lazy/expr/list.d.ts +8 -0
- package/bin/lazy/expr/list.js +115 -0
- package/bin/lazy/expr/string.d.ts +534 -0
- package/bin/lazy/expr/string.js +131 -0
- package/bin/lazy/expr/struct.d.ts +126 -0
- package/bin/lazy/expr/struct.js +26 -0
- package/bin/lazy/functions.d.ts +612 -0
- package/bin/lazy/functions.js +687 -0
- package/bin/lazy/groupby.d.ts +29 -0
- package/bin/lazy/groupby.js +30 -0
- package/bin/lazy/index.d.ts +4 -0
- package/bin/lazy/index.js +20 -0
- package/bin/lazy/whenthen.d.ts +67 -0
- package/bin/lazy/whenthen.js +81 -0
- package/bin/native-polars.d.ts +2 -0
- package/bin/native-polars.js +267 -0
- package/bin/series/datetime.d.ts +8 -0
- package/bin/series/datetime.js +34 -0
- package/bin/series/index.d.ts +1135 -0
- package/bin/series/index.js +700 -0
- package/bin/series/list.d.ts +8 -0
- package/bin/series/list.js +87 -0
- package/bin/series/string.d.ts +300 -0
- package/bin/series/string.js +125 -0
- package/bin/series/struct.d.ts +36 -0
- package/bin/series/struct.js +35 -0
- package/bin/shared_traits.d.ts +1458 -0
- package/bin/shared_traits.js +2 -0
- package/bin/sql.d.ts +244 -0
- package/bin/sql.js +63 -0
- package/bin/types.d.ts +287 -0
- package/bin/types.js +2 -0
- package/bin/utils.d.ts +38 -0
- package/bin/utils.js +69 -0
- package/package.json +45 -0
package/bin/utils.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.INSPECT_SYMBOL = exports.commonValue = exports.regexToString = exports.isIterator = exports.isExprArray = exports.isSeriesArray = exports.isLazyDataFrameArray = exports.isDataFrameArray = exports.range = void 0;
|
|
7
|
+
exports.columnOrColumns = columnOrColumns;
|
|
8
|
+
exports.columnOrColumnsStrict = columnOrColumnsStrict;
|
|
9
|
+
exports.selectionToExprList = selectionToExprList;
|
|
10
|
+
exports.isPath = isPath;
|
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
const types_1 = require("node:util/types");
|
|
13
|
+
const dataframe_1 = require("./dataframe");
|
|
14
|
+
const dataframe_2 = require("./lazy/dataframe");
|
|
15
|
+
const expr_1 = require("./lazy/expr");
|
|
16
|
+
const series_1 = require("./series");
|
|
17
|
+
/** @ignore */
|
|
18
|
+
function columnOrColumns(columns) {
|
|
19
|
+
if (columns) {
|
|
20
|
+
return columnOrColumnsStrict(columns);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** @ignore */
|
|
24
|
+
function columnOrColumnsStrict(...columns) {
|
|
25
|
+
return columns.flat(3);
|
|
26
|
+
}
|
|
27
|
+
/** @ignore */
|
|
28
|
+
function selectionToExprList(columns, stringToLit) {
|
|
29
|
+
return [columns]
|
|
30
|
+
.flat(3)
|
|
31
|
+
.map((expr) => (0, expr_1.exprToLitOrExpr)(expr, stringToLit)._expr);
|
|
32
|
+
}
|
|
33
|
+
/** @ignore */
|
|
34
|
+
function isPath(s, expectedExtensions) {
|
|
35
|
+
const { base, ext, name } = node_path_1.default.parse(s);
|
|
36
|
+
return Boolean(base && ext && name) && !!expectedExtensions?.includes(ext);
|
|
37
|
+
}
|
|
38
|
+
const range = (start, end) => {
|
|
39
|
+
const length = end - start;
|
|
40
|
+
return Array.from({ length }, (_, i) => start + i);
|
|
41
|
+
};
|
|
42
|
+
exports.range = range;
|
|
43
|
+
const isDataFrameArray = (ty) => Array.isArray(ty) && dataframe_1.DataFrame.isDataFrame(ty[0]);
|
|
44
|
+
exports.isDataFrameArray = isDataFrameArray;
|
|
45
|
+
const isLazyDataFrameArray = (ty) => Array.isArray(ty) && dataframe_2.LazyDataFrame.isLazyDataFrame(ty[0]);
|
|
46
|
+
exports.isLazyDataFrameArray = isLazyDataFrameArray;
|
|
47
|
+
const isSeriesArray = (ty) => Array.isArray(ty) && ty.every(series_1.Series.isSeries);
|
|
48
|
+
exports.isSeriesArray = isSeriesArray;
|
|
49
|
+
const isExprArray = (ty) => Array.isArray(ty) && expr_1.Expr.isExpr(ty[0]);
|
|
50
|
+
exports.isExprArray = isExprArray;
|
|
51
|
+
const isIterator = (ty) => ty !== null && typeof ty[Symbol.iterator] === "function";
|
|
52
|
+
exports.isIterator = isIterator;
|
|
53
|
+
const regexToString = (r) => {
|
|
54
|
+
if ((0, types_1.isRegExp)(r)) {
|
|
55
|
+
if (r.flags.includes("g")) {
|
|
56
|
+
throw new Error("global flag is not supported");
|
|
57
|
+
}
|
|
58
|
+
if (r.flags.includes("y")) {
|
|
59
|
+
throw new Error("sticky flag is not supported");
|
|
60
|
+
}
|
|
61
|
+
return r.flags ? `(?${r.flags})${r.source}` : r.source;
|
|
62
|
+
}
|
|
63
|
+
return r;
|
|
64
|
+
};
|
|
65
|
+
exports.regexToString = regexToString;
|
|
66
|
+
// find common value in array of arrays of strings: string[][]
|
|
67
|
+
const commonValue = (...arr) => arr[0].filter((x) => arr.every((y) => y.includes(x)));
|
|
68
|
+
exports.commonValue = commonValue;
|
|
69
|
+
exports.INSPECT_SYMBOL = Symbol.for("nodejs.util.inspect.custom");
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ohos-ports/nodejs-polars",
|
|
3
|
+
"version": "0.23.4-beta.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/ohos-ports/ohos-ports.git",
|
|
7
|
+
"directory": "ports/nodejs-polars/0.23.4"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"main": "bin/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"bin"
|
|
13
|
+
],
|
|
14
|
+
"keywords": [
|
|
15
|
+
"csv",
|
|
16
|
+
"transform",
|
|
17
|
+
"parse",
|
|
18
|
+
"json",
|
|
19
|
+
"polars",
|
|
20
|
+
"dataframe",
|
|
21
|
+
"data-processing",
|
|
22
|
+
"rust"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">= 20"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"registry": "https://registry.npmjs.org/",
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"nodejs-polars-linux-x64-gnu": "0.23.4",
|
|
33
|
+
"nodejs-polars-win32-x64-msvc": "0.23.4",
|
|
34
|
+
"nodejs-polars-darwin-x64": "0.23.4",
|
|
35
|
+
"nodejs-polars-linux-x64-musl": "0.23.4",
|
|
36
|
+
"nodejs-polars-darwin-arm64": "0.23.4",
|
|
37
|
+
"nodejs-polars-linux-arm64-gnu": "0.23.4",
|
|
38
|
+
"nodejs-polars-linux-arm64-musl": "0.23.4",
|
|
39
|
+
"nodejs-polars-android-arm64": "0.23.4",
|
|
40
|
+
"@ohos-ports/nodejs-polars-openharmony-arm64": "0.23.4-beta.0"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/ohos-ports/ohos-ports/issues"
|
|
44
|
+
}
|
|
45
|
+
}
|