diff --git a/src/pykx/lib/4-1-libs/bq.q_ b/src/pykx/lib/4-1-libs/bq.q_ deleted file mode 100644 index eb8a30e..0000000 Binary files a/src/pykx/lib/4-1-libs/bq.q_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/csvutil.q b/src/pykx/lib/4-1-libs/csvutil.q deleted file mode 100644 index 2c7653f..0000000 --- a/src/pykx/lib/4-1-libs/csvutil.q +++ /dev/null @@ -1,113 +0,0 @@ -/ utilities to quickly load a csv file - for more exhaustive analysis of the csv contents see csvguess.q -/ 2020.05.06 - bugfix for infolike and info0 -/ 2016.11.09 - add " " as valid delimiter in P -/ 2016.09.03 - allow HHMMSSXYZXYZXYZ N timestamps -/ 2014.08.07 - use .Q.id for colhdrs -/ 2014.01.27 - favour type P rather than Z -/ 2013.05.25 - tighten up U+V -/ 2012.07.11 - add GUID -/ 2009.09.20 - updated to match latest csvguess.q - -/ .csvutil.colhdrs[file] - return a list of colhdrs from file -/ info:.csvutil.info[file] - return a table of information about the file -/ columns are: -/ c - column name; ci - column index; t - load type; mw - max width; -/ dchar - distinct characters in values; rules - rules that caught the type -/ maybe - needs checking, _could_ be say a date, but perhaps just a float? -/ .csvutil.infoonly[file;onlycols] - like .csvutil.info except that it only analyses -/ example: -/ info:.csvutil.infoonly[file;`col0`col1`col3] -/ info:.csvutil.infolike[file;"*price"] -/ show delete from info where t=" " -/ .csvutil.data[file;info] - use the info from .csvutil.info to read the data -/ .csvutil.data10[file;info] - like .csvutil.data but only returns the first 10 rows -/ .csvutil.read[file]/read10[file] - for when you don't care about checking/tweaking the before reading - -\d .csvutil -DELIM:"," -ZAPHDRS:0b / lowercase and remove _ from colhdrs (junk characters are always removed) -WIDTHHDR:25000 / number of characters read to get the header -READLINES:222 / number of lines read and used to guess the types -SYMMAXWIDTH:11 / character columns narrower than this are stored as symbols -SYMMAXGR:10 / max symbol granularity% before we give up and keep as a * string -FORCECHARWIDTH:30 / every field (of any type) with values this wide or more is forced to character "*" -DISCARDEMPTY:0b / completely ignore empty columns if true else set them to "C" -CHUNKSIZE:50000000 / used in fs2 (modified .Q.fs) - -k)nameltrim:{$[~@x;.z.s'x;~(*x)in aA:.Q.a,.Q.A;(+/&\~x in aA)_x;x]} -k)fs2:{[f;s]((-7!s)>){[f;s;x]i:1+last@&0xa=r:1:(s;x;CHUNKSIZE);f@`\:i#r;x+i}[f;s]/0j} -cleanhdrs:{{$[ZAPHDRS;lower x except"_";x]}x where x in DELIM,.Q.an} -cancast:{nw:x$"";if[not x in"BXGCS";nw:(min 0#;max 0#;::)@\:nw];$[not any nw in x$(11&count y)#y;$[11.csvutil.FORCECHARWIDTH; / long values - info:update t:"C "[.csvutil.DISCARDEMPTY],(rules:rules,'30),empty:1b from info where t="?",mw=0; / empty columns - info:update dchar:{asc distinct raze x}peach sdv from info where t="?"; - info:update mdot:{max sum each"."=x}peach sdv from info where t="?",{"."in x}each dchar; - info:update t:"n",(rules:rules,'40)from info where t="?",{any x in"0123456789"}each dchar; / vaguely numeric.. - info:update t:"I",(rules:rules,'50),ipa:1b from info where t="n",mw within 7 15,mdot=3,{all x in".0123456789"}each dchar,.csvutil.cancast["I"]peach sdv; / ip-address - info:update t:"F",(rules:rules,'51)from info where t="n",mw>2,mdot<2,{all" /"in x}each dchar,.csvutil.cancast["F"]peach sdv; / fractions, "1 3/4" -> 1.75f - info:update t:"G",(rules:rules,'52) from info where t="*",mw=36,mdot=0,{all x like"????????-????-????-????-????????????"}peach sdv,.csvutil.cancast["G"]peach sdv; / GUID, v3.0 or later - info:update t:"N",(rules:rules,'53),maybe:1b from info where t="n",mw=15,mdot=0,{all x in"0123456789"}each dchar,.csvutil.cancast["N"]peach sdv; / N, could be T but that'd loose precision - info:update t:"T",(rules:rules,'54),maybe:1b from info where t="n",mw=9,mdot=0,{all x in"0123456789"}each dchar,.csvutil.cancast["T"]peach sdv; - info:update t:"G",(rules:rules,'55) from info where t="*",mw=38,mdot=0,{all x like"{????????-????-????-????-????????????}"}peach sdv,.csvutil.cancast["G"]peach sdv; / GUID, v3.0 or later - info:update t:"J",(rules:rules,'60)from info where t="n",mdot=0,{all x in"+-0123456789"}each dchar,.csvutil.cancast["J"]peach sdv; - info:update t:"I",(rules:rules,'70)from info where t="J",mw<12,.csvutil.cancast["I"]peach sdv; - info:update t:"H",(rules:rules,'80)from info where t="I",mw<7,.csvutil.cancast["H"]peach sdv; - info:update t:"F",(rules:rules,'90)from info where t="n",mdot<2,mw>1,.csvutil.cancast["F"]peach sdv; - info:update t:"E",(rules:rules,'100),maybe:1b from info where t="F",mw<9; - info:update t:"M",(rules:rules,'110),maybe:1b from info where t in"nIHEF",mdot<2,mw within 4 7,.csvutil.cancast["M"]peach sdv; - info:update t:"D",(rules:rules,'120),maybe:1b from info where t in"nI",mdot in 0 2,mw within 6 11,.csvutil.cancast["D"]peach sdv; - info:update t:"V",(rules:rules,'130),maybe:1b from info where t="I",mw=6,{all x like"[012][0-9][0-5][0-9][0-5][0-9]"}peach sdv,.csvutil.nostar["V"]peach sdv; / 235959 123456 - info:update t:"U",(rules:rules,'140),maybe:1b from info where t="H",mw=4,{all x like"[012][0-9][0-5][0-9]"}peach sdv,.csvutil.nostar["U"]peach sdv; /2359 - info:update t:"U",(rules:rules,'150),maybe:0b from info where t="n",mw in 4 5,mdot=0,{all x like"*[0-9]:[0-5][0-9]"}peach sdv,.csvutil.cancast["U"]peach sdv; - info:update t:"T",(rules:rules,'160),maybe:0b from info where t="n",mw within 7 12,mdot<2,{all x like"*[0-9]:[0-5][0-9]:[0-5][0-9]*"}peach sdv,.csvutil.cancast["T"]peach sdv; - info:update t:"V",(rules:rules,'170),maybe:0b from info where t="T",mw in 7 8,mdot=0,.csvutil.cancast["V"]peach sdv; - info:update t:"T",(rules:rules,'180),maybe:1b from info where t in"EF",mw within 7 10,mdot=1,{all x like"*[0-9][0-5][0-9][0-5][0-9].*"}peach sdv,.csvutil.cancast["T"]peach sdv; - / info:update t:"Z",(rules:rules,'190),maybe:0b from info where t="n",mw within 11 24,mdot<4,.csvutil.cancast["Z"]peach sdv; - info:update t:"P",(rules:rules,'200),maybe:1b from info where t="n",mw within 11 29,mdot<4,{all x like"[12][0-9][0-9][0-9][ ./-][01][0-9][ ./-][0-3][0-9]*"}peach sdv,.csvutil.cancast["P"]peach sdv; - info:update t:"N",(rules:rules,'210),maybe:1b from info where t="n",mw within 3 28,mdot=1,.csvutil.cancast["N"]peach sdv; - info:update t:"?",(rules:rules,'220),maybe:0b from info where t="n"; / reset remaining maybe numeric - info:update t:"C",(rules:rules,'230),maybe:0b from info where t="?",mw=1; / char - info:update t:"D",(rules:rules,'231),maybe:0b from info where t="?",mdot=0,mw within 5 9,{all x like"*[0-9][a-sA-S][a-uA-U][b-yB-Y][0-9][0-9]*"}peach sdv,.csvutil.cancast["D"]peach sdv; / 1dec12..01dec2011 - info:update t:"B",(rules:rules,'240),maybe:0b from info where t in"HC",mw=1,mdot=0,{$[all x in"01tTfFyYnN";(any"0fFnN"in x)and any"1tTyY"in x;0b]}each dchar; / boolean - info:update t:"B",(rules:rules,'250),maybe:1b from info where t in"HC",mw=1,mdot=0,{all x in"01tTfFyYnN"}each dchar; / boolean - info:update t:"X",(rules:rules,'260),maybe:0b from info where t="?",mw=2,{$[all x in"0123456789abcdefABCDEF";(any .Q.n in x)and any"abcdefABCDEF"in x;0b]}each dchar; /hex - info:update t:"S",(rules:rules,'270),maybe:1b from info where t="?",mw<.csvutil.SYMMAXWIDTH,mw>1,gr<.csvutil.SYMMAXGR; / symbols (max width permitting) - info:update t:"*",(rules:rules,'280),maybe:0b from info where t="?"; / the rest as strings - / flag those S/* columns which could be encoded to integers (.Q.j10/x10/j12/x12) to avoid symbols - info:update j12:1b from info where t in"S*",mw<13,{all x in .Q.nA}each dchar; - info:update j10:1b from info where t in"S*",mw<11,{all x in .Q.b6}each dchar; - select c,ci,t,maybe,empty,res,j10,j12,ipa,mw,mdot,rules,gr,ndv,dchar from info} -info:info0[;()] / by default don't restrict columns -infolike:{[file;pattern] info0[file;{x where(lower x)like lower y}[colhdrs[file];pattern]]} / .csvutil.infolike[file;"*time"] -infoonly:info0 / only some columns .csvutil.infoonly[file;`this`and`that] - -\d . diff --git a/src/pykx/lib/4-1-libs/dbmaint.q b/src/pykx/lib/4-1-libs/dbmaint.q deleted file mode 100644 index 78fbc9e..0000000 --- a/src/pykx/lib/4-1-libs/dbmaint.q +++ /dev/null @@ -1,151 +0,0 @@ -/ kdb+ partitioned database maintenance -\d .os -WIN:.z.o in`w32`w64 -pth:{p:$[10h=type x;x;string x];if[WIN;p[where"/"=p]:"\\"];(":"=first p)_ p} -cpy:{system$[WIN;"copy /v /z ";"cp "],pth[x]," ",pth y} -del:{system$[WIN;"del ";"rm "],pth x} -ren:{system$[WIN;"move ";"mv "],pth[x]," ",pth y} -here:{hsym`$system$[WIN;"cd";"pwd"]} -\d . - -\d .dbmaint -add1col:{[tabledir;colname;defaultvalue] - if[not colname in ac:allcols tabledir; - stdout"adding column ",(string colname)," (type ",(string type defaultvalue),") to `",string tabledir; - num:count get(`)sv tabledir,first ac; - .[(`)sv tabledir,colname;();:;num#defaultvalue]; - @[tabledir;`.d;,;colname]]} - -allcols:{[tabledir]get tabledir,`.d} - -allpaths:{[dbdir;table] - files:key dbdir; - if[any files like"par.txt";:raze allpaths[;table]each hsym each`$read0(`)sv dbdir,`par.txt]; - files@:where files like"[0-9]*";(`)sv'dbdir,'files,'table} - -copy1col:{[tabledir;oldcol;newcol] - if[(oldcol in ac)and not newcol in ac:allcols tabledir; - stdout"copying ",(string oldcol)," to ",(string newcol)," in `",string tabledir; - .os.cpy[(`)sv tabledir,oldcol;(`)sv tabledir,newcol];@[tabledir;`.d;,;newcol]]} - -delete1col:{[tabledir;col] - if[col in ac:allcols tabledir; - stdout"deleting column ",(string col)," from `",string tabledir; - .os.del[(`)sv tabledir,col];@[tabledir;`.d;:;ac except col]]} - -/ -enum:{[tabledir;val] - if[not 11=abs type val;:val]; - .[p;();,;u@:iasc u@:where not(u:distinct enlist val)in v:$[type key p:(`)sv tabledir,`sym;get p;0#`]];`sym!(v,u)?val} -\ - -enum:{[tabledir;val]if[not 11=abs type val;:val];.Q.dd[tabledir;`sym]?val} - - -find1col:{[tabledir;col] - $[col in allcols tabledir; - [stdout"column ",string[col]," (type ",(string first"i"$read1((`)sv tabledir,col;8;1)),") in `",string tabledir;1b]; - [stdout"column ",string[col]," *NOT*FOUND* in `",string tabledir;0b]]} - -fix1table:{[tabledir;goodpartition;goodpartitioncols] - if[count missing:goodpartitioncols except allcols tabledir; - stdout"fixing table `",string tabledir;{add1col[x;z;0#get y,z]}[tabledir;goodpartition]each missing]} - -fn1col:{[tabledir;col;fn] - if[col in allcols tabledir; - oldattr:-2!oldvalue:get p:tabledir,col; - newattr:-2!newvalue:fn oldvalue; - if[$[not oldattr~newattr;1b;not oldvalue~newvalue]; - stdout"resaving column ",(string col)," (type ",(string type newvalue),") in `",string tabledir; - oldvalue:0;.[(`)sv p;();:;newvalue]]]} - -reordercols0:{[tabledir;neworder] - if[not((count ac)=count neworder)or all neworder in ac:allcols tabledir;'`order]; - stdout"reordering columns in `",string tabledir; - @[tabledir;`.d;:;neworder]} - -rename1col:{[tabledir;oldname;newname] - if[(oldname in ac)and not newname in ac:allcols tabledir; - stdout"renaming ",(string oldname)," to ",(string newname)," in `",string tabledir; - .os.ren[` sv tabledir,oldname;` sv tabledir,newname];@[tabledir;`.d;:;.[ac;where ac=oldname;:;newname]]]} - -ren1table:{[old;new]stdout"renaming ",(string old)," to ",string new;.os.ren[old;new];} - -add1table:{[dbdir;tablename;table] - stdout"adding ",string tablename; - @[tablename;`;:;.Q.en[dbdir]0#table];} - -stdout:{-1 raze[" "sv string`date`second$.z.P]," ",x;} -validcolname:{(not x in `i,.Q.res,key`.q)and x = .Q.id x} - -////////////////////////////////////////////////////////////////////////////////////////////////////////// -// * public - -thisdb:`:. / if functions are to be run within the database instance then use (`:.) as dbdir - -addcol:{[dbdir;table;colname;defaultvalue] / addcol[`:/data/taq;`trade;`noo;0h] - if[not validcolname colname;'(`)sv colname,`invalid.colname]; - add1col[;colname;enum[dbdir;defaultvalue]]each allpaths[dbdir;table];} - -castcol:{[dbdir;table;col;newtype] / castcol[thisdb;`trade;`size;`short] - fncol[dbdir;table;col;newtype$]} - -clearattrcol:{[dbdir;table;col] / clearattr[thisdb;`trade;`sym] - setattrcol[dbdir;table;col;(`)]} - -copycol:{[dbdir;table;oldcol;newcol] / copycol[`:/k4/data/taq;`trade;`size;`size2] - if[not validcolname newcol;'(`)sv newcol,`invalid.newname]; - copy1col[;oldcol;newcol]each allpaths[dbdir;table];} - -deletecol:{[dbdir;table;col] / deletecol[`:/k4/data/taq;`trade;`iz] - delete1col[;col]each allpaths[dbdir;table];} - -findcol:{[dbdir;table;col] / findcol[`:/k4/data/taq;`trade;`iz] - fndcols:find1col[;col]each allpaths[dbdir;table]; - if[not any fndcols;'"Requested column not found in all partitions, see log output above"]} - -/ adds missing columns, but DOESN'T delete extra columns - do that manually -fixtable:{[dbdir;table;goodpartition] / fixtable[`:/k4/data/taq;`trade;`:/data/taq/2005.02.19] - fix1table[;goodpartition;allcols goodpartition]each allpaths[dbdir;table]except goodpartition;} - -fncol:{[dbdir;table;col;fn] / fncol[thisdb;`trade;`price;2*] - fn1col[;col;fn]each allpaths[dbdir;table];} - -listcols:{[dbdir;table] / listcols[`:/k4/data/taq;`trade] - allcols first allpaths[dbdir;table]} - -renamecol:{[dbdir;table;oldname;newname] / renamecol[`:/k4/data/taq;`trade;`woz;`iz] - if[not validcolname newname;'` sv newname,`invalid.newname]; - rename1col[;oldname;newname]each allpaths[dbdir;table];} - -reordercols:{[dbdir;table;neworder] / reordercols[`:/k4/data/taq;`trade;reverse cols trade] - reordercols0[;neworder]each allpaths[dbdir;table];} - -setattrcol:{[dbdir;table;col;newattr] / setattr[thisdb;`trade;`sym;`g] / `s `p `u - fncol[dbdir;table;col;newattr#]} - -addtable:{[dbdir;tablename;table] / addtable[`:.;`trade;([]price...)] - add1table[dbdir;;table]each allpaths[dbdir;tablename];} - -rentable:{[dbdir;old;new] / rentable[`:.;`trade;`transactions] - ren1table'[allpaths[dbdir;old];allpaths[dbdir;new]];} - -\d . -\ -test with https://github.com/KxSystems/kdb/blob/master/tq.q (sample taq database) - -if making changes to current database you need to reload (\l .) to make modifications visible - -if the database you've been modifying is a tick database don't forget to adjust the schema (tick/???.q) to reflect your changes to the data - - -.dbmaint.addcol[`:.;`trade;`num;10] -.dbmaint.addcol[`:.;`trade;`F;`test] -.dbmaint.delete1col[`:./2000.10.02/trade;`F] -.dbmaint.fixtable[`:.;`trade;`:./2000.10.03/trade] -.dbmaint.reordercols[`:.;`quote;except[2 rotate cols quote;`date]] -.dbmaint.clearattrcol[`:.;`trade;`sym] -.dbmaint.setattrcol[`:.;`trade;`sym;`p] -.dbmaint.castcol[`:.;`trade;`time;`second] -.dbmaint.renamecol[`:.;`trade;`price;`PRICE] -`PRICE`size .dbmaint.renamecol[`:.;`trade]'`p`s diff --git a/src/pykx/lib/4-1-libs/kurl.q_ b/src/pykx/lib/4-1-libs/kurl.q_ deleted file mode 100644 index d7fe527..0000000 Binary files a/src/pykx/lib/4-1-libs/kurl.q_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/kurl.sidecar.q_ b/src/pykx/lib/4-1-libs/kurl.sidecar.q_ deleted file mode 100644 index 5c5b03f..0000000 Binary files a/src/pykx/lib/4-1-libs/kurl.sidecar.q_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/kxic.k b/src/pykx/lib/4-1-libs/kxic.k deleted file mode 100644 index b7239f3..0000000 --- a/src/pykx/lib/4-1-libs/kxic.k +++ /dev/null @@ -1,17 +0,0 @@ -.pykx.i.kxic.loadfailed:()!(); -.comkxic.Kf:{[v]r:,/'$2\:'ri:"I"$raw:"."\:v:v@&v in .Q.n,".";if[max "b"$ri>1023;'version];vi:sum/ 2/:'.:'"0"^(r[0],20#"0";-20$r[1],10#"0";-10$r 2),\:"b";"***III"$`K`k`Kl`major`minor`patch!enlist[v],enlist["D"$"2022.03.10"],vi,raw}; -.[`.comkxic;();,;.comkxic.Kf "3.0.0"]; -.[`.comkxic.libs;();,;`nelf`kurl`objstor`qlog`restserver`bq`sql`l64!("6a93b2b";"7fa6ae8";"32363d0";"a49dc65";"00a5b89";"14d547d";"99f3988";"3fa87f1")]; -if[(.z.o~`l64)&$[0=#.z.x;1b;~"--no-qce"in .z.x]; - {[] - lf:{@[{."\\l ",$[""~x:getenv`QHOME;getenv[`HOME],"/q";x],"/",($x),"_"};x;{.pykx.i.kxic.loadfailed,:enlist[x]!enlist y}[x]]}; - d:`kurl.q`objstor.q`qlog.q`s.k!$`insights.lib.kurl`insights.lib.objstore`insights.lib.qlog`insights.lib.sql; - if[`s in !`;d:d _ `s.k]; - if[~0=#.z.x; - if["--no-kurl"in .z.x;d:d _ `kurl.q]; - if["--no-objstor"in .z.x;d:d _ `objstor.q]; - if["--no-qlog"in .z.x;d:d _ `qlog.q]; - if["--no-sql"in .z.x;d:d _ `s.k]]; - if[~0=#d;lf' (!d) @ & (.:d) in " "\:.z.l 4;]; / only load enabled features - }[] - ]; diff --git a/src/pykx/lib/4-1-libs/licmet.q_ b/src/pykx/lib/4-1-libs/licmet.q_ deleted file mode 100644 index 68d39c0..0000000 Binary files a/src/pykx/lib/4-1-libs/licmet.q_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/objstor.q_ b/src/pykx/lib/4-1-libs/objstor.q_ deleted file mode 100644 index 2c38917..0000000 --- a/src/pykx/lib/4-1-libs/objstor.q_ +++ /dev/null @@ -1,5 +0,0 @@ - -V%% ;k';[ĈV ,6 GLGrG'[F퇊,k -} -LGJs['d'f 6V f - ڈhLC6 \ No newline at end of file diff --git a/src/pykx/lib/4-1-libs/qlog.q_ b/src/pykx/lib/4-1-libs/qlog.q_ deleted file mode 100644 index d45d4b1..0000000 Binary files a/src/pykx/lib/4-1-libs/qlog.q_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/read.q b/src/pykx/lib/4-1-libs/read.q deleted file mode 100644 index 41bfd1a..0000000 --- a/src/pykx/lib/4-1-libs/read.q +++ /dev/null @@ -1,46 +0,0 @@ -system"l ", {x sv (-1 _ x vs y),enlist "csvutil.q"}[$[.z.o~`w64;"\\";"/"]; (value{})6]; - -system"d .read"; - -// @kind readme -// @name .read/README.md -// # pykx.q.module.read -// @end - -// @kind function -// @fileoverview Loads a CSV file as a table; column types are guessed if not provided -// @param path {#hsym|symbol} The path to the csv file -// @param types {(char)|string|null} A list/string of uppercase type characters representing the types, or null. Space is used to drop the associated column. Null is used to guess the type of the associated column. -// @param delimiter {char|null} The single-character delimiter used in the csv file. If null, comma will be used. -// @param asTable {bool} Whether the first line of the csv file should be interpreted as column names. If true, a table will be returned. Otherwise, a list of vectors of columnar data will be returned. -// @returns {table|#any[][]} The data from the csv file as a table or list of vectors depending on the value of the asTable parameter -.read.csv:{[path; types; delimiter; asTable] - guessedTypes:.csv.info[path]`t; - :($[(::)~types;guessedTypes;1_?[1b,(::)~'types;guessedTypes;(::),types]];$[asTable;enlist;::]$[(::)~delimiter;delimiter:",";delimiter]) 0: hsym path - }; - -// @kind function -// @fileoverview Loads a file of typed data with fixed-width fields. It is expected that there will either be a newline after every record, or none at all. -// @param path {#hsym|symbol} The path to the fixed-width data file -// @param types {string} A string of uppercase type characters representing the types. Space is used to drop the associated column. -// @param widths {long[]} The widths of the fields -// @returns {#any[]|#any[][]} A vector or list of vectors representating the data -.read.fixed:{[path; types; widths] - :(types;widths) 0: path - }; - -// @kind function -// @fileoverview Loads a json file as a q object. Serialization/deserialization to/from JSON may not preserve q datatype -// @param path {#hsym|symbol} The path to the json file -// @returns {table} The JSON object converted to its closest q analogue -.read.json:{[path] - :.j.k raze read0 path - }; - -// @kind function -// @fileoverview Loads a q table -// @param path {#hsym|symbol} The path to the table file/directory -// @returns {table} The table stored at the given path -.read.qtab:{[path] - :get hsym path - }; diff --git a/src/pykx/lib/4-1-libs/rest.q_ b/src/pykx/lib/4-1-libs/rest.q_ deleted file mode 100644 index 0c69e53..0000000 Binary files a/src/pykx/lib/4-1-libs/rest.q_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/s.k_ b/src/pykx/lib/4-1-libs/s.k_ deleted file mode 100644 index e7d1aa8..0000000 Binary files a/src/pykx/lib/4-1-libs/s.k_ and /dev/null differ diff --git a/src/pykx/lib/4-1-libs/write.q b/src/pykx/lib/4-1-libs/write.q deleted file mode 100644 index 9ad4a11..0000000 --- a/src/pykx/lib/4-1-libs/write.q +++ /dev/null @@ -1,44 +0,0 @@ -system"d .write"; - -// @kind readme -// @name .write/README.md -// # pykx.q.module.write -// @end - -// @kind function -// @fileoverview Splays and writes a q table to disk -// @param dirPath {#hsym|symbol} The path to the root directory into which the splayed table will be written -// @param name {symbol} The name of the table. A directory with this name within the root directory will be created, and will contain the serialized columns of the table -// @param table {table} The table to be splayed and written to disk -// @returns {#hsym} The path to the directory within dirPath which contains the splayed table -.write.splayed:{[dirPath; name; table] - :(hsym `$"/" sv string dirPath,name) set .Q.en[hsym dirPath;] table - }; - -// @kind function -// @fileoverview Writes a q object to disk -// @param path {#hsym|symbol} The path to the file which will store the given data. If a file with this path already exists, it is overwritten. -// @param data {#any} The data to be serialized and written to disk -// @returns {#hsym} The path written to -.write.serialized:{[path; data] - :hsym[path] set data - }; - -// @kind function -// @fileoverview Writes a CSV file given a table -// @param path {#hsym|symbol} The path to the csv file. If a file with this path already exists, it is overwritten. -// @param delimiter {char|null} The single-character delimiter used in the csv file. If null, comma will be used. -// @param table {table} The table to be written as a csv file -// @returns {#hsym} The path written to -.write.csv:{[path; delimiter; table] - :hsym[path] 0: $[(::)~delimiter;delimiter:",";delimiter] 0: table - }; - -// @kind function -// @fileoverview Writes a JSON representation of the given q object -// @param path {#hsym|symbol} The path to the JSON file. If a file with this path already exists, it is overwritten. -// @param data {#any} The q object to be written as a JSON file -// @returns {#hsym} The path written to -.write.json:{[path; data] - :hsym[path] 0: enlist .j.j data - };