-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathindex.ts
299 lines (279 loc) · 11.2 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
import * as df from "./dataframe";
import { DataType, Field as _field } from "./datatypes";
import * as series from "./series";
export { DataType } from "./datatypes";
import * as cfg from "./cfg";
import * as func from "./functions";
import pli from "./internals/polars_internal";
import * as io from "./io";
import * as ldf from "./lazy/dataframe";
export * from "./series";
export * from "./dataframe";
export * from "./functions";
export * from "./io";
export * from "./cfg";
export * from "./lazy/dataframe";
export * from "./lazy";
import * as lazy from "./lazy";
export * from "./types";
import * as sql from "./sql";
export type { GroupBy } from "./groupby";
export namespace pl {
export import Expr = lazy.Expr;
export import DataFrame = df.DataFrame;
export import LazyDataFrame = ldf.LazyDataFrame;
export import Series = series.Series;
export type LazyGroupBy = lazy.LazyGroupBy;
export type When = lazy.When;
export type Then = lazy.Then;
export type ChainedWhen = lazy.ChainedWhen;
export type ChainedThen = lazy.ChainedThen;
export import Config = cfg.Config;
export import Field = _field;
export import repeat = func.repeat;
export import concat = func.concat;
// IO
export import scanCSV = io.scanCSV;
export import scanJson = io.scanJson;
export import scanIPC = io.scanIPC;
export import scanParquet = io.scanParquet;
export import readRecords = io.readRecords;
export import readCSV = io.readCSV;
export import readIPC = io.readIPC;
export import readIPCStream = io.readIPCStream;
export import readJSON = io.readJSON;
export import readParquet = io.readParquet;
export import readAvro = io.readAvro;
export import readCSVStream = io.readCSVStream;
export import readJSONStream = io.readJSONStream;
// lazy
export import col = lazy.col;
export import nth = lazy.nth;
export import cols = lazy.cols;
export import lit = lazy.lit;
export import intRange = lazy.intRange;
export import intRanges = lazy.intRanges;
export import argSortBy = lazy.argSortBy;
export import avg = lazy.avg;
export import concatList = lazy.concatList;
export import concatString = lazy.concatString;
export import count = lazy.count;
export import cov = lazy.cov;
export import exclude = lazy.exclude;
export import element = lazy.element;
export import first = lazy.first;
export import format = lazy.format;
export import groups = lazy.groups;
export import head = lazy.head;
export import last = lazy.last;
export import len = lazy.len;
export import mean = lazy.mean;
export import median = lazy.median;
export import nUnique = lazy.nUnique;
export import pearsonCorr = lazy.pearsonCorr;
export import quantile = lazy.quantile;
export import select = lazy.select;
export import struct = lazy.struct;
export import allHorizontal = lazy.allHorizontal;
export import anyHorizontal = lazy.anyHorizontal;
export import minHorizontal = lazy.minHorizontal;
export import maxHorizontal = lazy.maxHorizontal;
export import sumHorizontal = lazy.sumHorizontal;
export import spearmanRankCorr = lazy.spearmanRankCorr;
export import tail = lazy.tail;
export import list = lazy.list;
export import when = lazy.when;
export const version = pli.version();
export type Categorical = import("./datatypes").Categorical;
export type Int8 = import("./datatypes").Int8;
export type Int16 = import("./datatypes").Int16;
export type Int32 = import("./datatypes").Int32;
export type Int64 = import("./datatypes").Int64;
export type UInt8 = import("./datatypes").UInt8;
export type UInt16 = import("./datatypes").UInt16;
export type UInt32 = import("./datatypes").UInt32;
export type UInt64 = import("./datatypes").UInt64;
export type Float32 = import("./datatypes").Float32;
export type Float64 = import("./datatypes").Float64;
export type Bool = import("./datatypes").Bool;
export type Utf8 = import("./datatypes").Utf8;
export type String = import("./datatypes").String;
export type List = import("./datatypes").List;
export type FixedSizeList = import("./datatypes").FixedSizeList;
export type Date = import("./datatypes").Date;
export type Datetime = import("./datatypes").Datetime;
export type Time = import("./datatypes").Time;
export type Object = import("./datatypes").Object_;
export type Null = import("./datatypes").Null;
export type Struct = import("./datatypes").Struct;
export type Decimal = import("./datatypes").Decimal;
export const Categorical = DataType.Categorical;
export const Int8 = DataType.Int8;
export const Int16 = DataType.Int16;
export const Int32 = DataType.Int32;
export const Int64 = DataType.Int64;
export const UInt8 = DataType.UInt8;
export const UInt16 = DataType.UInt16;
export const UInt32 = DataType.UInt32;
export const UInt64 = DataType.UInt64;
export const Float32 = DataType.Float32;
export const Float64 = DataType.Float64;
export const Bool = DataType.Bool;
export const Utf8 = DataType.Utf8;
// biome-ignore lint/suspicious/noShadowRestrictedNames: pl.String
export const String = DataType.String;
export const List = DataType.List;
export const FixedSizeList = DataType.FixedSizeList;
// biome-ignore lint/suspicious/noShadowRestrictedNames: pl.Date
export const Date = DataType.Date;
export const Datetime = DataType.Datetime;
export const Time = DataType.Time;
// biome-ignore lint/suspicious/noShadowRestrictedNames: pl.Object
export const Object = DataType.Object;
export const Null = DataType.Null;
export const Struct = DataType.Struct;
export const Decimal = DataType.Decimal;
/**
* Run SQL queries against DataFrame/LazyFrame data.
*
* @experimental This functionality is considered **unstable**, although it is close to being
* considered stable. It may be changed at any point without it being considered a breaking change.
*/
export function SQLContext(
frames?: Record<string, DataFrame | LazyDataFrame>,
): sql.SQLContext {
return new sql.SQLContext(frames);
}
}
export default pl;
// ------
// CommonJS compatibility.
// This allows the user to use any of the following
// `import * as pl from "nodejs-polars"`
// `import pl from "nodejs-polars"`.
// `const pl = require("nodejs-polars")`.
// `const { DataFrame, Series, } = require("nodejs-polars")`.
// ------
export import Expr = lazy.Expr;
export import DataFrame = df.DataFrame;
export import LazyDataFrame = ldf.LazyDataFrame;
export import Series = series.Series;
export type LazyGroupBy = lazy.LazyGroupBy;
export type When = lazy.When;
export type Then = lazy.Then;
export type ChainedWhen = lazy.ChainedWhen;
export type ChainedThen = lazy.ChainedThen;
export import Config = cfg.Config;
export import Field = _field;
export import repeat = func.repeat;
export import concat = func.concat;
// IO
export import scanCSV = io.scanCSV;
export import scanJson = io.scanJson;
export import scanIPC = io.scanIPC;
export import scanParquet = io.scanParquet;
export import readRecords = io.readRecords;
export import readCSV = io.readCSV;
export import readIPC = io.readIPC;
export import readIPCStream = io.readIPCStream;
export import readJSON = io.readJSON;
export import readParquet = io.readParquet;
export import readAvro = io.readAvro;
export import readCSVStream = io.readCSVStream;
export import readJSONStream = io.readJSONStream;
// lazy
export import col = lazy.col;
export import cols = lazy.cols;
export import lit = lazy.lit;
export import intRange = lazy.intRange;
export import intRanges = lazy.intRanges;
export import argSortBy = lazy.argSortBy;
export import avg = lazy.avg;
export import concatList = lazy.concatList;
export import concatString = lazy.concatString;
export import count = lazy.count;
export import cov = lazy.cov;
export import exclude = lazy.exclude;
export import element = lazy.element;
export import first = lazy.first;
export import format = lazy.format;
export import groups = lazy.groups;
export import head = lazy.head;
export import last = lazy.last;
export import mean = lazy.mean;
export import median = lazy.median;
export import nUnique = lazy.nUnique;
export import pearsonCorr = lazy.pearsonCorr;
export import quantile = lazy.quantile;
export import select = lazy.select;
export import struct = lazy.struct;
export import allHorizontal = lazy.allHorizontal;
export import anyHorizontal = lazy.anyHorizontal;
export import minHorizontal = lazy.minHorizontal;
export import maxHorizontal = lazy.maxHorizontal;
export import sumHorizontal = lazy.sumHorizontal;
export import spearmanRankCorr = lazy.spearmanRankCorr;
export import tail = lazy.tail;
export import list = lazy.list;
export import when = lazy.when;
export const version = pli.version();
export type Categorical = import("./datatypes").Categorical;
export type Int8 = import("./datatypes").Int8;
export type Int16 = import("./datatypes").Int16;
export type Int32 = import("./datatypes").Int32;
export type Int64 = import("./datatypes").Int64;
export type UInt8 = import("./datatypes").UInt8;
export type UInt16 = import("./datatypes").UInt16;
export type UInt32 = import("./datatypes").UInt32;
export type UInt64 = import("./datatypes").UInt64;
export type Float32 = import("./datatypes").Float32;
export type Float64 = import("./datatypes").Float64;
export type Bool = import("./datatypes").Bool;
export type Utf8 = import("./datatypes").Utf8;
export type String = import("./datatypes").String;
export type List = import("./datatypes").List;
export type FixedSizeList = import("./datatypes").FixedSizeList;
export type Date = import("./datatypes").Date;
export type Datetime = import("./datatypes").Datetime;
export type Time = import("./datatypes").Time;
export type Object = import("./datatypes").Object_;
export type Null = import("./datatypes").Null;
export type Struct = import("./datatypes").Struct;
export type Decimal = import("./datatypes").Decimal;
export const Categorical = DataType.Categorical;
export const Int8 = DataType.Int8;
export const Int16 = DataType.Int16;
export const Int32 = DataType.Int32;
export const Int64 = DataType.Int64;
export const UInt8 = DataType.UInt8;
export const UInt16 = DataType.UInt16;
export const UInt32 = DataType.UInt32;
export const UInt64 = DataType.UInt64;
export const Float32 = DataType.Float32;
export const Float64 = DataType.Float64;
export const Bool = DataType.Bool;
export const Utf8 = DataType.Utf8;
// biome-ignore lint/suspicious/noShadowRestrictedNames: pl.String
export const String = DataType.String;
export const List = DataType.List;
export const FixedSizeList = DataType.FixedSizeList;
// biome-ignore lint/suspicious/noShadowRestrictedNames: pl.Date
export const Date = DataType.Date;
export const Datetime = DataType.Datetime;
export const Time = DataType.Time;
// biome-ignore lint/suspicious/noShadowRestrictedNames: pl.Object
export const Object = DataType.Object;
export const Null = DataType.Null;
export const Struct = DataType.Struct;
export const Decimal = DataType.Decimal;
/**
* Run SQL queries against DataFrame/LazyFrame data.
*
* @experimental This functionality is considered **unstable**, although it is close to being
* considered stable. It may be changed at any point without it being considered a breaking change.
*/
export function SQLContext(
frames?: Record<string, DataFrame | LazyDataFrame>,
): sql.SQLContext {
return new sql.SQLContext(frames);
}