pythonlib 1.0.1 → 2.0.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/README.md +3 -1
- package/dist/base64-C_am75Sv.d.ts +165 -0
- package/dist/base64.d.ts +1 -0
- package/dist/base64.js +37 -0
- package/dist/chunk-2YTO24B5.js +78 -0
- package/dist/chunk-3CLXPGAB.js +237 -0
- package/dist/{chunk-H76SKASU.js → chunk-3M3PB4RO.js} +4 -6
- package/dist/chunk-5OKGPZBQ.js +1106 -0
- package/dist/chunk-5VAHUJNC.js +348 -0
- package/dist/chunk-B5AUEOAH.js +193 -0
- package/dist/chunk-B5LQJODJ.js +37 -0
- package/dist/{chunk-HQ42WNKZ.js → chunk-BCMGGBWG.js} +2 -5
- package/dist/chunk-BCVIH2BN.js +175 -0
- package/dist/{chunk-EE7SK2GV.js → chunk-D35YI363.js} +15 -12
- package/dist/{chunk-7TH4FCVQ.js → chunk-ETBW6XNR.js} +3 -4
- package/dist/chunk-FCJ7E4OE.js +250 -0
- package/dist/chunk-HSTC277I.js +255 -0
- package/dist/chunk-IANXD4D4.js +250 -0
- package/dist/{chunk-4KYJT3DR.js → chunk-JAUU3HMH.js} +1 -2
- package/dist/chunk-JJKTRIVO.js +262 -0
- package/dist/chunk-KKHKTQNN.js +361 -0
- package/dist/chunk-KKJHGY4C.js +551 -0
- package/dist/chunk-LHPQS75Z.js +192 -0
- package/dist/{chunk-LWO6BIAD.js → chunk-LK2L2TFG.js} +5 -6
- package/dist/chunk-LLZFLQS6.js +280 -0
- package/dist/chunk-LTXTS7RP.js +154 -0
- package/dist/{chunk-4QG3772L.js → chunk-LWYBTWBZ.js} +2 -3
- package/dist/{chunk-6ZAJ37MR.js → chunk-MFKIEN7N.js} +3 -3
- package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
- package/dist/chunk-OZRS5PC4.js +312 -0
- package/dist/chunk-PWA3YQZU.js +346 -0
- package/dist/{chunk-6POEDI34.js → chunk-QKJBQKPY.js} +1 -2
- package/dist/chunk-RB6BYCIQ.js +141 -0
- package/dist/chunk-U4X5DEIP.js +188 -0
- package/dist/chunk-UGZ5OY5Z.js +165 -0
- package/dist/chunk-WTZSAITC.js +82 -0
- package/dist/{collections-CJur5Wg-.d.ts → collections-BthXtkEp.d.ts} +5 -1
- package/dist/collections.d.ts +1 -1
- package/dist/collections.js +2 -3
- package/dist/copy-6ZaZ__ge.d.ts +59 -0
- package/dist/copy.d.ts +1 -0
- package/dist/copy.js +9 -0
- package/dist/{datetime-Bpce8gG2.d.ts → datetime-BM_IjhTq.d.ts} +3 -1
- package/dist/datetime.d.ts +1 -1
- package/dist/datetime.js +2 -3
- package/dist/{functools-NrsZAqJk.d.ts → functools-uIa5g75p.d.ts} +3 -1
- package/dist/functools.d.ts +1 -1
- package/dist/functools.js +2 -3
- package/dist/glob.browser-B6d_YdV5.d.ts +50 -0
- package/dist/glob.browser.d.ts +1 -0
- package/dist/glob.browser.js +15 -0
- package/dist/glob.node-wn5ehtyM.d.ts +80 -0
- package/dist/glob.node.d.ts +1 -0
- package/dist/glob.node.js +15 -0
- package/dist/hashlib-vKP511NY.d.ts +205 -0
- package/dist/hashlib.d.ts +1 -0
- package/dist/hashlib.js +39 -0
- package/dist/index.browser.d.ts +172 -0
- package/dist/index.browser.js +304 -0
- package/dist/index.d.ts +61 -437
- package/dist/index.js +138 -1115
- package/dist/{itertools-Sjl1LB_0.d.ts → itertools-T0rwOk2j.d.ts} +2 -4
- package/dist/itertools.d.ts +1 -1
- package/dist/itertools.js +2 -3
- package/dist/{json-DAlvCadU.d.ts → json-DoWhX04T.d.ts} +1 -0
- package/dist/json.d.ts +1 -1
- package/dist/json.js +2 -3
- package/dist/logging.browser-Dux4L5kz.d.ts +185 -0
- package/dist/logging.browser.d.ts +1 -0
- package/dist/logging.browser.js +63 -0
- package/dist/logging.node-CH75bVdE.d.ts +185 -0
- package/dist/logging.node.d.ts +1 -0
- package/dist/logging.node.js +61 -0
- package/dist/{math-DwEGjjQ-.d.ts → math-D2NPMc-x.d.ts} +2 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +2 -3
- package/dist/{os-C6Nt7Ijx.d.ts → os.browser-krjSx5kF.d.ts} +32 -54
- package/dist/os.browser.d.ts +2 -0
- package/dist/{os.js → os.browser.js} +41 -16
- package/dist/os.node-CQjch8Ht.d.ts +124 -0
- package/dist/os.node.d.ts +2 -0
- package/dist/os.node.js +83 -0
- package/dist/os.shared-C3x70nhO.d.ts +59 -0
- package/dist/pathlib.browser-NC7kKQYe.d.ts +91 -0
- package/dist/pathlib.browser.d.ts +1 -0
- package/dist/pathlib.browser.js +17 -0
- package/dist/pathlib.node-CY3yUFdT.d.ts +331 -0
- package/dist/pathlib.node.d.ts +2 -0
- package/dist/pathlib.node.js +17 -0
- package/dist/{random-BJv_rSpL.d.ts → random-DcS5jtEs.d.ts} +3 -5
- package/dist/random.d.ts +1 -1
- package/dist/random.js +2 -3
- package/dist/{re-B1CHCgyr.d.ts → re-Bo-IOqov.d.ts} +3 -7
- package/dist/re.d.ts +1 -1
- package/dist/re.js +2 -3
- package/dist/set-JQbLAq8B.d.ts +592 -0
- package/dist/shutil.browser-Ck5oWhnP.d.ts +113 -0
- package/dist/shutil.browser.d.ts +1 -0
- package/dist/shutil.browser.js +33 -0
- package/dist/shutil.node-C9kwvhAf.d.ts +160 -0
- package/dist/shutil.node.d.ts +2 -0
- package/dist/shutil.node.js +33 -0
- package/dist/string.d.ts +3 -1
- package/dist/string.js +2 -3
- package/dist/subprocess-CZVYzQ3V.d.ts +214 -0
- package/dist/subprocess.d.ts +1 -0
- package/dist/subprocess.js +29 -0
- package/dist/sys-IL8LgI_W.d.ts +212 -0
- package/dist/sys.d.ts +1 -0
- package/dist/sys.js +51 -0
- package/dist/tempfile.browser-DciOKfNm.d.ts +78 -0
- package/dist/tempfile.browser.d.ts +1 -0
- package/dist/tempfile.browser.js +19 -0
- package/dist/tempfile.node-bVMY60Cu.d.ts +195 -0
- package/dist/tempfile.node.d.ts +2 -0
- package/dist/tempfile.node.js +23 -0
- package/dist/time-CcYhdiSu.d.ts +245 -0
- package/dist/time.d.ts +1 -0
- package/dist/time.js +49 -0
- package/dist/urllib-DJtkj-0f.d.ts +198 -0
- package/dist/urllib.d.ts +1 -0
- package/dist/urllib.js +37 -0
- package/dist/uuid-C0ypmn56.d.ts +160 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +23 -0
- package/package.json +127 -5
- package/dist/chunk-4KYJT3DR.js.map +0 -1
- package/dist/chunk-4QG3772L.js.map +0 -1
- package/dist/chunk-6POEDI34.js.map +0 -1
- package/dist/chunk-6ZAJ37MR.js.map +0 -1
- package/dist/chunk-7TH4FCVQ.js.map +0 -1
- package/dist/chunk-CXKGPD5D.js +0 -313
- package/dist/chunk-CXKGPD5D.js.map +0 -1
- package/dist/chunk-EE7SK2GV.js.map +0 -1
- package/dist/chunk-H76SKASU.js.map +0 -1
- package/dist/chunk-HQ42WNKZ.js.map +0 -1
- package/dist/chunk-LWO6BIAD.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/collections.js.map +0 -1
- package/dist/datetime.js.map +0 -1
- package/dist/functools.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/itertools.js.map +0 -1
- package/dist/json.js.map +0 -1
- package/dist/math.js.map +0 -1
- package/dist/os.d.ts +0 -1
- package/dist/os.js.map +0 -1
- package/dist/random.js.map +0 -1
- package/dist/re.js.map +0 -1
- package/dist/string.js.map +0 -1
|
@@ -1,59 +1,33 @@
|
|
|
1
|
+
import { p as pathJoin, a as pathBasename, b as pathDirname, c as pathSplitFn, d as pathSplitExt, e as pathExtName, f as pathIsAbs, g as pathNormPath, h as pathRelPath, i as pathCommonPath, j as pathExpandUser, k as pathExpandVars, l as altSep, m as chdir, n as curDir, o as environ, q as extSep, r as getCwd, s as getCwdb, t as getenv, u as lineSep, v as name, w as parDir, x as pathSep, y as sep } from './os.shared-C3x70nhO.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* Python os module for TypeScript
|
|
4
|
+
* Python os module for TypeScript - Browser version
|
|
3
5
|
*
|
|
4
6
|
* Provides operating system interface functions matching Python's os module.
|
|
5
|
-
*
|
|
7
|
+
* Filesystem operations are stubs in browser environment.
|
|
6
8
|
*
|
|
7
9
|
* @see {@link https://docs.python.org/3/library/os.html | Python os documentation}
|
|
8
10
|
* @see {@link https://docs.python.org/3/library/os.path.html | Python os.path documentation}
|
|
11
|
+
* @module
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
declare const environ: Record<string, string | undefined>;
|
|
12
|
-
/** Get an environment variable */
|
|
13
|
-
declare function getenv(key: string, defaultValue?: string): string | undefined;
|
|
14
|
-
/** Path separator for the current platform */
|
|
15
|
-
declare const sep: string;
|
|
16
|
-
/** Alternative path separator (Windows has both / and \) */
|
|
17
|
-
declare const altSep: string | null;
|
|
18
|
-
/** Path list separator (: on Unix, ; on Windows) */
|
|
19
|
-
declare const pathSep: string;
|
|
20
|
-
/** Line separator */
|
|
21
|
-
declare const lineSep: string;
|
|
22
|
-
/** Current directory string */
|
|
23
|
-
declare const curDir = ".";
|
|
24
|
-
/** Parent directory string */
|
|
25
|
-
declare const parDir = "..";
|
|
26
|
-
/** Extension separator */
|
|
27
|
-
declare const extSep = ".";
|
|
13
|
+
|
|
28
14
|
declare const path: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/** Test whether a path is absolute */
|
|
42
|
-
isAbs(p: string): boolean;
|
|
43
|
-
/** Normalize a pathname */
|
|
44
|
-
normPath(p: string): string;
|
|
15
|
+
join: typeof pathJoin;
|
|
16
|
+
basename: typeof pathBasename;
|
|
17
|
+
dirname: typeof pathDirname;
|
|
18
|
+
split: typeof pathSplitFn;
|
|
19
|
+
splitExt: typeof pathSplitExt;
|
|
20
|
+
extName: typeof pathExtName;
|
|
21
|
+
isAbs: typeof pathIsAbs;
|
|
22
|
+
normPath: typeof pathNormPath;
|
|
23
|
+
relPath: typeof pathRelPath;
|
|
24
|
+
commonPath: typeof pathCommonPath;
|
|
25
|
+
expandUser: typeof pathExpandUser;
|
|
26
|
+
expandVars: typeof pathExpandVars;
|
|
45
27
|
/** Return normalized absolutized version of pathname */
|
|
46
28
|
absPath(p: string): string;
|
|
47
29
|
/** Return canonical path, eliminating symlinks (stub - just normalizes) */
|
|
48
30
|
realPath(p: string): string;
|
|
49
|
-
/** Return relative path from start to path */
|
|
50
|
-
relPath(p: string, start?: string): string;
|
|
51
|
-
/** Return common path prefix */
|
|
52
|
-
commonPath(paths: string[]): string;
|
|
53
|
-
/** Expand ~ and ~user (stub - returns unchanged in browser) */
|
|
54
|
-
expandUser(p: string): string;
|
|
55
|
-
/** Expand shell variables (stub - returns unchanged) */
|
|
56
|
-
expandVars(p: string): string;
|
|
57
31
|
/** Test if path exists (stub - always returns false in browser) */
|
|
58
32
|
exists(_p: string): boolean;
|
|
59
33
|
/** Test if path is a file (stub - always returns false in browser) */
|
|
@@ -71,12 +45,6 @@ declare const path: {
|
|
|
71
45
|
/** Return creation time (stub - returns 0 in browser) */
|
|
72
46
|
getCtime(_p: string): number;
|
|
73
47
|
};
|
|
74
|
-
/** Get current working directory */
|
|
75
|
-
declare function getCwd(): string;
|
|
76
|
-
/** Get current working directory as bytes (same as getCwd in TS) */
|
|
77
|
-
declare function getCwdb(): string;
|
|
78
|
-
/** Change current working directory (stub in browser) */
|
|
79
|
-
declare function chdir(p: string): void;
|
|
80
48
|
/** List directory contents (stub - returns empty array in browser) */
|
|
81
49
|
declare function listDir(_p?: string): string[];
|
|
82
50
|
/** Create a directory (stub in browser) */
|
|
@@ -110,8 +78,6 @@ declare function stat(_p: string): {
|
|
|
110
78
|
st_atime: number;
|
|
111
79
|
st_ctime: number;
|
|
112
80
|
};
|
|
113
|
-
/** Operating system name */
|
|
114
|
-
declare const name: string;
|
|
115
81
|
|
|
116
82
|
declare const osModule_altSep: typeof altSep;
|
|
117
83
|
declare const osModule_chdir: typeof chdir;
|
|
@@ -128,7 +94,19 @@ declare const osModule_mkdir: typeof mkdir;
|
|
|
128
94
|
declare const osModule_name: typeof name;
|
|
129
95
|
declare const osModule_parDir: typeof parDir;
|
|
130
96
|
declare const osModule_path: typeof path;
|
|
97
|
+
declare const osModule_pathBasename: typeof pathBasename;
|
|
98
|
+
declare const osModule_pathCommonPath: typeof pathCommonPath;
|
|
99
|
+
declare const osModule_pathDirname: typeof pathDirname;
|
|
100
|
+
declare const osModule_pathExpandUser: typeof pathExpandUser;
|
|
101
|
+
declare const osModule_pathExpandVars: typeof pathExpandVars;
|
|
102
|
+
declare const osModule_pathExtName: typeof pathExtName;
|
|
103
|
+
declare const osModule_pathIsAbs: typeof pathIsAbs;
|
|
104
|
+
declare const osModule_pathJoin: typeof pathJoin;
|
|
105
|
+
declare const osModule_pathNormPath: typeof pathNormPath;
|
|
106
|
+
declare const osModule_pathRelPath: typeof pathRelPath;
|
|
131
107
|
declare const osModule_pathSep: typeof pathSep;
|
|
108
|
+
declare const osModule_pathSplitExt: typeof pathSplitExt;
|
|
109
|
+
declare const osModule_pathSplitFn: typeof pathSplitFn;
|
|
132
110
|
declare const osModule_remove: typeof remove;
|
|
133
111
|
declare const osModule_removeDirs: typeof removeDirs;
|
|
134
112
|
declare const osModule_rename: typeof rename;
|
|
@@ -140,7 +118,7 @@ declare const osModule_stat: typeof stat;
|
|
|
140
118
|
declare const osModule_unlink: typeof unlink;
|
|
141
119
|
declare const osModule_walk: typeof walk;
|
|
142
120
|
declare namespace osModule {
|
|
143
|
-
export { osModule_altSep as altSep, osModule_chdir as chdir, osModule_curDir as curDir, osModule_environ as environ, osModule_extSep as extSep, osModule_getCwd as getCwd, osModule_getCwdb as getCwdb, osModule_getenv as getenv, osModule_lineSep as lineSep, osModule_listDir as listDir, osModule_makeDirs as makeDirs, osModule_mkdir as mkdir, osModule_name as name, osModule_parDir as parDir, osModule_path as path, osModule_pathSep as pathSep, osModule_remove as remove, osModule_removeDirs as removeDirs, osModule_rename as rename, osModule_renames as renames, osModule_replace as replace, osModule_rmdir as rmdir, osModule_sep as sep, osModule_stat as stat, osModule_unlink as unlink, osModule_walk as walk };
|
|
121
|
+
export { osModule_altSep as altSep, osModule_chdir as chdir, osModule_curDir as curDir, osModule_environ as environ, osModule_extSep as extSep, osModule_getCwd as getCwd, osModule_getCwdb as getCwdb, osModule_getenv as getenv, osModule_lineSep as lineSep, osModule_listDir as listDir, osModule_makeDirs as makeDirs, osModule_mkdir as mkdir, osModule_name as name, osModule_parDir as parDir, osModule_path as path, osModule_pathBasename as pathBasename, osModule_pathCommonPath as pathCommonPath, osModule_pathDirname as pathDirname, osModule_pathExpandUser as pathExpandUser, osModule_pathExpandVars as pathExpandVars, osModule_pathExtName as pathExtName, osModule_pathIsAbs as pathIsAbs, osModule_pathJoin as pathJoin, osModule_pathNormPath as pathNormPath, osModule_pathRelPath as pathRelPath, osModule_pathSep as pathSep, osModule_pathSplitExt as pathSplitExt, osModule_pathSplitFn as pathSplitFn, osModule_remove as remove, osModule_removeDirs as removeDirs, osModule_rename as rename, osModule_renames as renames, osModule_replace as replace, osModule_rmdir as rmdir, osModule_sep as sep, osModule_stat as stat, osModule_unlink as unlink, osModule_walk as walk };
|
|
144
122
|
}
|
|
145
123
|
|
|
146
|
-
export {
|
|
124
|
+
export { makeDirs as a, rmdir as b, removeDirs as c, rename as d, renames as e, replace as f, listDir as l, mkdir as m, osModule as o, path as p, remove as r, stat as s, unlink as u, walk as w };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { l as altSep, m as chdir, n as curDir, o as environ, q as extSep, r as getCwd, s as getCwdb, t as getenv, u as lineSep, v as name, w as parDir, a as pathBasename, i as pathCommonPath, b as pathDirname, j as pathExpandUser, k as pathExpandVars, e as pathExtName, f as pathIsAbs, p as pathJoin, g as pathNormPath, h as pathRelPath, x as pathSep, d as pathSplitExt, c as pathSplitFn, y as sep } from './os.shared-C3x70nhO.js';
|
|
2
|
+
export { l as listDir, a as makeDirs, m as mkdir, p as path, r as remove, c as removeDirs, d as rename, e as renames, f as replace, b as rmdir, s as stat, u as unlink, w as walk } from './os.browser-krjSx5kF.js';
|
|
@@ -1,32 +1,46 @@
|
|
|
1
1
|
import {
|
|
2
|
-
altSep,
|
|
3
|
-
chdir,
|
|
4
|
-
curDir,
|
|
5
|
-
environ,
|
|
6
|
-
extSep,
|
|
7
|
-
getCwd,
|
|
8
|
-
getCwdb,
|
|
9
|
-
getenv,
|
|
10
|
-
lineSep,
|
|
11
2
|
listDir,
|
|
12
3
|
makeDirs,
|
|
13
4
|
mkdir,
|
|
14
|
-
name,
|
|
15
|
-
parDir,
|
|
16
5
|
path,
|
|
17
|
-
pathSep,
|
|
18
6
|
remove,
|
|
19
7
|
removeDirs,
|
|
20
8
|
rename,
|
|
21
9
|
renames,
|
|
22
10
|
replace,
|
|
23
11
|
rmdir,
|
|
24
|
-
sep,
|
|
25
12
|
stat,
|
|
26
13
|
unlink,
|
|
27
14
|
walk
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import
|
|
15
|
+
} from "./chunk-BCVIH2BN.js";
|
|
16
|
+
import {
|
|
17
|
+
altSep,
|
|
18
|
+
chdir,
|
|
19
|
+
curDir,
|
|
20
|
+
environ,
|
|
21
|
+
extSep,
|
|
22
|
+
getCwd,
|
|
23
|
+
getCwdb,
|
|
24
|
+
getenv,
|
|
25
|
+
lineSep,
|
|
26
|
+
name,
|
|
27
|
+
parDir,
|
|
28
|
+
pathBasename,
|
|
29
|
+
pathCommonPath,
|
|
30
|
+
pathDirname,
|
|
31
|
+
pathExpandUser,
|
|
32
|
+
pathExpandVars,
|
|
33
|
+
pathExtName,
|
|
34
|
+
pathIsAbs,
|
|
35
|
+
pathJoin,
|
|
36
|
+
pathNormPath,
|
|
37
|
+
pathRelPath,
|
|
38
|
+
pathSep,
|
|
39
|
+
pathSplitExt,
|
|
40
|
+
pathSplitFn,
|
|
41
|
+
sep
|
|
42
|
+
} from "./chunk-LHPQS75Z.js";
|
|
43
|
+
import "./chunk-MLKGABMK.js";
|
|
30
44
|
export {
|
|
31
45
|
altSep,
|
|
32
46
|
chdir,
|
|
@@ -43,7 +57,19 @@ export {
|
|
|
43
57
|
name,
|
|
44
58
|
parDir,
|
|
45
59
|
path,
|
|
60
|
+
pathBasename,
|
|
61
|
+
pathCommonPath,
|
|
62
|
+
pathDirname,
|
|
63
|
+
pathExpandUser,
|
|
64
|
+
pathExpandVars,
|
|
65
|
+
pathExtName,
|
|
66
|
+
pathIsAbs,
|
|
67
|
+
pathJoin,
|
|
68
|
+
pathNormPath,
|
|
69
|
+
pathRelPath,
|
|
46
70
|
pathSep,
|
|
71
|
+
pathSplitExt,
|
|
72
|
+
pathSplitFn,
|
|
47
73
|
remove,
|
|
48
74
|
removeDirs,
|
|
49
75
|
rename,
|
|
@@ -55,4 +81,3 @@ export {
|
|
|
55
81
|
unlink,
|
|
56
82
|
walk
|
|
57
83
|
};
|
|
58
|
-
//# sourceMappingURL=os.js.map
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { p as pathJoin, a as pathBasename, b as pathDirname, c as pathSplitFn, d as pathSplitExt, e as pathExtName, f as pathIsAbs, g as pathNormPath, h as pathRelPath, i as pathCommonPath, j as pathExpandUser, k as pathExpandVars, l as altSep, m as chdir, n as curDir, o as environ, q as extSep, r as getCwd, s as getCwdb, t as getenv, u as lineSep, v as name, w as parDir, x as pathSep, y as sep } from './os.shared-C3x70nhO.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Python os module for TypeScript - Node.js version
|
|
5
|
+
*
|
|
6
|
+
* Provides operating system interface functions matching Python's os module,
|
|
7
|
+
* with real filesystem operations using Node.js fs module (async).
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://docs.python.org/3/library/os.html | Python os documentation}
|
|
10
|
+
* @see {@link https://docs.python.org/3/library/os.path.html | Python os.path documentation}
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
declare const path: {
|
|
15
|
+
join: typeof pathJoin;
|
|
16
|
+
basename: typeof pathBasename;
|
|
17
|
+
dirname: typeof pathDirname;
|
|
18
|
+
split: typeof pathSplitFn;
|
|
19
|
+
splitExt: typeof pathSplitExt;
|
|
20
|
+
extName: typeof pathExtName;
|
|
21
|
+
isAbs: typeof pathIsAbs;
|
|
22
|
+
normPath: typeof pathNormPath;
|
|
23
|
+
relPath: typeof pathRelPath;
|
|
24
|
+
commonPath: typeof pathCommonPath;
|
|
25
|
+
expandUser: typeof pathExpandUser;
|
|
26
|
+
expandVars: typeof pathExpandVars;
|
|
27
|
+
/** Return normalized absolutized version of pathname */
|
|
28
|
+
absPath(p: string): string;
|
|
29
|
+
/** Return canonical path, eliminating symlinks */
|
|
30
|
+
realPath(p: string): Promise<string>;
|
|
31
|
+
/** Test if path exists */
|
|
32
|
+
exists(p: string): Promise<boolean>;
|
|
33
|
+
/** Test if path is a file */
|
|
34
|
+
isFile(p: string): Promise<boolean>;
|
|
35
|
+
/** Test if path is a directory */
|
|
36
|
+
isDir(p: string): Promise<boolean>;
|
|
37
|
+
/** Test if path is a symbolic link */
|
|
38
|
+
isLink(p: string): Promise<boolean>;
|
|
39
|
+
/** Return size of file */
|
|
40
|
+
getSize(p: string): Promise<number>;
|
|
41
|
+
/** Return modification time as Unix timestamp */
|
|
42
|
+
getMtime(p: string): Promise<number>;
|
|
43
|
+
/** Return access time as Unix timestamp */
|
|
44
|
+
getAtime(p: string): Promise<number>;
|
|
45
|
+
/** Return creation time as Unix timestamp */
|
|
46
|
+
getCtime(p: string): Promise<number>;
|
|
47
|
+
};
|
|
48
|
+
/** List directory contents */
|
|
49
|
+
declare function listDir(p?: string): Promise<string[]>;
|
|
50
|
+
/** Create a directory */
|
|
51
|
+
declare function mkdir(p: string, mode?: number): Promise<void>;
|
|
52
|
+
/** Create a directory and parents */
|
|
53
|
+
declare function makeDirs(p: string, mode?: number, existOk?: boolean): Promise<void>;
|
|
54
|
+
/** Remove a file */
|
|
55
|
+
declare function remove(p: string): Promise<void>;
|
|
56
|
+
/** Remove a file (alias for remove) */
|
|
57
|
+
declare const unlink: typeof remove;
|
|
58
|
+
/** Remove a directory */
|
|
59
|
+
declare function rmdir(p: string): Promise<void>;
|
|
60
|
+
/** Remove directory tree (removes empty parent directories) */
|
|
61
|
+
declare function removeDirs(p: string): Promise<void>;
|
|
62
|
+
/** Rename a file or directory */
|
|
63
|
+
declare function rename(src: string, dst: string): Promise<void>;
|
|
64
|
+
/** Rename with automatic directory creation */
|
|
65
|
+
declare function renames(src: string, dst: string): Promise<void>;
|
|
66
|
+
/** Replace file (atomic rename) */
|
|
67
|
+
declare function replace(src: string, dst: string): Promise<void>;
|
|
68
|
+
/** Walk directory tree */
|
|
69
|
+
declare function walk(top: string, options?: {
|
|
70
|
+
topdown?: boolean;
|
|
71
|
+
followlinks?: boolean;
|
|
72
|
+
}): AsyncGenerator<[string, string[], string[]]>;
|
|
73
|
+
/** Get file stat */
|
|
74
|
+
declare function stat(p: string): Promise<{
|
|
75
|
+
st_mode: number;
|
|
76
|
+
st_size: number;
|
|
77
|
+
st_mtime: number;
|
|
78
|
+
st_atime: number;
|
|
79
|
+
st_ctime: number;
|
|
80
|
+
}>;
|
|
81
|
+
|
|
82
|
+
declare const osModule_altSep: typeof altSep;
|
|
83
|
+
declare const osModule_chdir: typeof chdir;
|
|
84
|
+
declare const osModule_curDir: typeof curDir;
|
|
85
|
+
declare const osModule_environ: typeof environ;
|
|
86
|
+
declare const osModule_extSep: typeof extSep;
|
|
87
|
+
declare const osModule_getCwd: typeof getCwd;
|
|
88
|
+
declare const osModule_getCwdb: typeof getCwdb;
|
|
89
|
+
declare const osModule_getenv: typeof getenv;
|
|
90
|
+
declare const osModule_lineSep: typeof lineSep;
|
|
91
|
+
declare const osModule_listDir: typeof listDir;
|
|
92
|
+
declare const osModule_makeDirs: typeof makeDirs;
|
|
93
|
+
declare const osModule_mkdir: typeof mkdir;
|
|
94
|
+
declare const osModule_name: typeof name;
|
|
95
|
+
declare const osModule_parDir: typeof parDir;
|
|
96
|
+
declare const osModule_path: typeof path;
|
|
97
|
+
declare const osModule_pathBasename: typeof pathBasename;
|
|
98
|
+
declare const osModule_pathCommonPath: typeof pathCommonPath;
|
|
99
|
+
declare const osModule_pathDirname: typeof pathDirname;
|
|
100
|
+
declare const osModule_pathExpandUser: typeof pathExpandUser;
|
|
101
|
+
declare const osModule_pathExpandVars: typeof pathExpandVars;
|
|
102
|
+
declare const osModule_pathExtName: typeof pathExtName;
|
|
103
|
+
declare const osModule_pathIsAbs: typeof pathIsAbs;
|
|
104
|
+
declare const osModule_pathJoin: typeof pathJoin;
|
|
105
|
+
declare const osModule_pathNormPath: typeof pathNormPath;
|
|
106
|
+
declare const osModule_pathRelPath: typeof pathRelPath;
|
|
107
|
+
declare const osModule_pathSep: typeof pathSep;
|
|
108
|
+
declare const osModule_pathSplitExt: typeof pathSplitExt;
|
|
109
|
+
declare const osModule_pathSplitFn: typeof pathSplitFn;
|
|
110
|
+
declare const osModule_remove: typeof remove;
|
|
111
|
+
declare const osModule_removeDirs: typeof removeDirs;
|
|
112
|
+
declare const osModule_rename: typeof rename;
|
|
113
|
+
declare const osModule_renames: typeof renames;
|
|
114
|
+
declare const osModule_replace: typeof replace;
|
|
115
|
+
declare const osModule_rmdir: typeof rmdir;
|
|
116
|
+
declare const osModule_sep: typeof sep;
|
|
117
|
+
declare const osModule_stat: typeof stat;
|
|
118
|
+
declare const osModule_unlink: typeof unlink;
|
|
119
|
+
declare const osModule_walk: typeof walk;
|
|
120
|
+
declare namespace osModule {
|
|
121
|
+
export { osModule_altSep as altSep, osModule_chdir as chdir, osModule_curDir as curDir, osModule_environ as environ, osModule_extSep as extSep, osModule_getCwd as getCwd, osModule_getCwdb as getCwdb, osModule_getenv as getenv, osModule_lineSep as lineSep, osModule_listDir as listDir, osModule_makeDirs as makeDirs, osModule_mkdir as mkdir, osModule_name as name, osModule_parDir as parDir, osModule_path as path, osModule_pathBasename as pathBasename, osModule_pathCommonPath as pathCommonPath, osModule_pathDirname as pathDirname, osModule_pathExpandUser as pathExpandUser, osModule_pathExpandVars as pathExpandVars, osModule_pathExtName as pathExtName, osModule_pathIsAbs as pathIsAbs, osModule_pathJoin as pathJoin, osModule_pathNormPath as pathNormPath, osModule_pathRelPath as pathRelPath, osModule_pathSep as pathSep, osModule_pathSplitExt as pathSplitExt, osModule_pathSplitFn as pathSplitFn, osModule_remove as remove, osModule_removeDirs as removeDirs, osModule_rename as rename, osModule_renames as renames, osModule_replace as replace, osModule_rmdir as rmdir, osModule_sep as sep, osModule_stat as stat, osModule_unlink as unlink, osModule_walk as walk };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { makeDirs as a, rmdir as b, removeDirs as c, rename as d, renames as e, replace as f, listDir as l, mkdir as m, osModule as o, path as p, remove as r, stat as s, unlink as u, walk as w };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { l as altSep, m as chdir, n as curDir, o as environ, q as extSep, r as getCwd, s as getCwdb, t as getenv, u as lineSep, v as name, w as parDir, a as pathBasename, i as pathCommonPath, b as pathDirname, j as pathExpandUser, k as pathExpandVars, e as pathExtName, f as pathIsAbs, p as pathJoin, g as pathNormPath, h as pathRelPath, x as pathSep, d as pathSplitExt, c as pathSplitFn, y as sep } from './os.shared-C3x70nhO.js';
|
|
2
|
+
export { l as listDir, a as makeDirs, m as mkdir, p as path, r as remove, c as removeDirs, d as rename, e as renames, f as replace, b as rmdir, s as stat, u as unlink, w as walk } from './os.node-CQjch8Ht.js';
|
package/dist/os.node.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listDir,
|
|
3
|
+
makeDirs,
|
|
4
|
+
mkdir,
|
|
5
|
+
path,
|
|
6
|
+
remove,
|
|
7
|
+
removeDirs,
|
|
8
|
+
rename,
|
|
9
|
+
renames,
|
|
10
|
+
replace,
|
|
11
|
+
rmdir,
|
|
12
|
+
stat,
|
|
13
|
+
unlink,
|
|
14
|
+
walk
|
|
15
|
+
} from "./chunk-OZRS5PC4.js";
|
|
16
|
+
import {
|
|
17
|
+
altSep,
|
|
18
|
+
chdir,
|
|
19
|
+
curDir,
|
|
20
|
+
environ,
|
|
21
|
+
extSep,
|
|
22
|
+
getCwd,
|
|
23
|
+
getCwdb,
|
|
24
|
+
getenv,
|
|
25
|
+
lineSep,
|
|
26
|
+
name,
|
|
27
|
+
parDir,
|
|
28
|
+
pathBasename,
|
|
29
|
+
pathCommonPath,
|
|
30
|
+
pathDirname,
|
|
31
|
+
pathExpandUser,
|
|
32
|
+
pathExpandVars,
|
|
33
|
+
pathExtName,
|
|
34
|
+
pathIsAbs,
|
|
35
|
+
pathJoin,
|
|
36
|
+
pathNormPath,
|
|
37
|
+
pathRelPath,
|
|
38
|
+
pathSep,
|
|
39
|
+
pathSplitExt,
|
|
40
|
+
pathSplitFn,
|
|
41
|
+
sep
|
|
42
|
+
} from "./chunk-LHPQS75Z.js";
|
|
43
|
+
import "./chunk-MLKGABMK.js";
|
|
44
|
+
export {
|
|
45
|
+
altSep,
|
|
46
|
+
chdir,
|
|
47
|
+
curDir,
|
|
48
|
+
environ,
|
|
49
|
+
extSep,
|
|
50
|
+
getCwd,
|
|
51
|
+
getCwdb,
|
|
52
|
+
getenv,
|
|
53
|
+
lineSep,
|
|
54
|
+
listDir,
|
|
55
|
+
makeDirs,
|
|
56
|
+
mkdir,
|
|
57
|
+
name,
|
|
58
|
+
parDir,
|
|
59
|
+
path,
|
|
60
|
+
pathBasename,
|
|
61
|
+
pathCommonPath,
|
|
62
|
+
pathDirname,
|
|
63
|
+
pathExpandUser,
|
|
64
|
+
pathExpandVars,
|
|
65
|
+
pathExtName,
|
|
66
|
+
pathIsAbs,
|
|
67
|
+
pathJoin,
|
|
68
|
+
pathNormPath,
|
|
69
|
+
pathRelPath,
|
|
70
|
+
pathSep,
|
|
71
|
+
pathSplitExt,
|
|
72
|
+
pathSplitFn,
|
|
73
|
+
remove,
|
|
74
|
+
removeDirs,
|
|
75
|
+
rename,
|
|
76
|
+
renames,
|
|
77
|
+
replace,
|
|
78
|
+
rmdir,
|
|
79
|
+
sep,
|
|
80
|
+
stat,
|
|
81
|
+
unlink,
|
|
82
|
+
walk
|
|
83
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python os module - Shared code for browser and Node.js
|
|
3
|
+
*
|
|
4
|
+
* Contains pure path operations and constants that work in all environments.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/** Environment variables (browser-safe empty object or Node's process.env) */
|
|
9
|
+
declare const environ: Record<string, string | undefined>;
|
|
10
|
+
/** Get an environment variable */
|
|
11
|
+
declare function getenv(key: string, defaultValue?: string): string | undefined;
|
|
12
|
+
/** Path separator for the current platform */
|
|
13
|
+
declare const sep: string;
|
|
14
|
+
/** Alternative path separator (Windows has both / and \) */
|
|
15
|
+
declare const altSep: string | null;
|
|
16
|
+
/** Path list separator (: on Unix, ; on Windows) */
|
|
17
|
+
declare const pathSep: string;
|
|
18
|
+
/** Line separator */
|
|
19
|
+
declare const lineSep: string;
|
|
20
|
+
/** Current directory string */
|
|
21
|
+
declare const curDir = ".";
|
|
22
|
+
/** Parent directory string */
|
|
23
|
+
declare const parDir = "..";
|
|
24
|
+
/** Extension separator */
|
|
25
|
+
declare const extSep = ".";
|
|
26
|
+
/** Operating system name */
|
|
27
|
+
declare const name: string;
|
|
28
|
+
/** Join path components intelligently */
|
|
29
|
+
declare function pathJoin(...paths: string[]): string;
|
|
30
|
+
/** Return the base name of pathname */
|
|
31
|
+
declare function pathBasename(p: string, suffix?: string): string;
|
|
32
|
+
/** Return the directory name of pathname */
|
|
33
|
+
declare function pathDirname(p: string): string;
|
|
34
|
+
/** Split pathname into (head, tail) */
|
|
35
|
+
declare function pathSplitFn(p: string): [string, string];
|
|
36
|
+
/** Split pathname into root and extension */
|
|
37
|
+
declare function pathSplitExt(p: string): [string, string];
|
|
38
|
+
/** Return the extension of pathname */
|
|
39
|
+
declare function pathExtName(p: string): string;
|
|
40
|
+
/** Test whether a path is absolute */
|
|
41
|
+
declare function pathIsAbs(p: string): boolean;
|
|
42
|
+
/** Normalize a pathname */
|
|
43
|
+
declare function pathNormPath(p: string): string;
|
|
44
|
+
/** Return relative path from start to path */
|
|
45
|
+
declare function pathRelPath(p: string, start?: string): string;
|
|
46
|
+
/** Return common path prefix */
|
|
47
|
+
declare function pathCommonPath(paths: string[]): string;
|
|
48
|
+
/** Expand ~ and ~user */
|
|
49
|
+
declare function pathExpandUser(p: string): string;
|
|
50
|
+
/** Expand shell variables */
|
|
51
|
+
declare function pathExpandVars(p: string): string;
|
|
52
|
+
/** Get current working directory */
|
|
53
|
+
declare function getCwd(): string;
|
|
54
|
+
/** Get current working directory as bytes (same as getCwd in TS) */
|
|
55
|
+
declare function getCwdb(): string;
|
|
56
|
+
/** Change current working directory */
|
|
57
|
+
declare function chdir(p: string): void;
|
|
58
|
+
|
|
59
|
+
export { pathBasename as a, pathDirname as b, pathSplitFn as c, pathSplitExt as d, pathExtName as e, pathIsAbs as f, pathNormPath as g, pathRelPath as h, pathCommonPath as i, pathExpandUser as j, pathExpandVars as k, altSep as l, chdir as m, curDir as n, environ as o, pathJoin as p, extSep as q, getCwd as r, getCwdb as s, getenv as t, lineSep as u, name as v, parDir as w, pathSep as x, sep as y };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python pathlib module for TypeScript - Browser version
|
|
3
|
+
*
|
|
4
|
+
* Provides object-oriented filesystem paths.
|
|
5
|
+
* Filesystem operations throw errors in browser environment.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://docs.python.org/3/library/pathlib.html | Python pathlib documentation}
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Path class representing a filesystem path.
|
|
12
|
+
* Provides path manipulation; filesystem operations throw in browser.
|
|
13
|
+
*/
|
|
14
|
+
declare class Path {
|
|
15
|
+
private readonly _path;
|
|
16
|
+
constructor(...pathSegments: string[]);
|
|
17
|
+
static of(...pathSegments: string[]): Path;
|
|
18
|
+
get name(): string;
|
|
19
|
+
get stem(): string;
|
|
20
|
+
get suffix(): string;
|
|
21
|
+
get suffixes(): string[];
|
|
22
|
+
get parent(): Path;
|
|
23
|
+
get parents(): Path[];
|
|
24
|
+
get parts(): string[];
|
|
25
|
+
get anchor(): string;
|
|
26
|
+
get root(): string;
|
|
27
|
+
isAbsolute(): boolean;
|
|
28
|
+
isRelativeTo(other: string | Path): boolean;
|
|
29
|
+
joinpath(...pathSegments: (string | Path)[]): Path;
|
|
30
|
+
div(other: string | Path): Path;
|
|
31
|
+
withName(name: string): Path;
|
|
32
|
+
withStem(stem: string): Path;
|
|
33
|
+
withSuffix(suffix: string): Path;
|
|
34
|
+
toString(): string;
|
|
35
|
+
valueOf(): string;
|
|
36
|
+
[Symbol.toPrimitive](_hint: string): string;
|
|
37
|
+
exists(): Promise<boolean>;
|
|
38
|
+
isFile(): Promise<boolean>;
|
|
39
|
+
isDir(): Promise<boolean>;
|
|
40
|
+
isSymlink(): Promise<boolean>;
|
|
41
|
+
stat(): Promise<unknown>;
|
|
42
|
+
lstat(): Promise<unknown>;
|
|
43
|
+
readText(_encoding?: BufferEncoding): Promise<string>;
|
|
44
|
+
writeText(_content: string, _encoding?: BufferEncoding): Promise<void>;
|
|
45
|
+
readBytes(): Promise<Uint8Array>;
|
|
46
|
+
writeBytes(_content: Uint8Array): Promise<void>;
|
|
47
|
+
mkdir(_options?: {
|
|
48
|
+
parents?: boolean;
|
|
49
|
+
existOk?: boolean;
|
|
50
|
+
mode?: number;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
rmdir(): Promise<void>;
|
|
53
|
+
unlink(): Promise<void>;
|
|
54
|
+
rename(_target: string | Path): Promise<Path>;
|
|
55
|
+
replace(_target: string | Path): Promise<Path>;
|
|
56
|
+
resolve(): Path;
|
|
57
|
+
absolute(): Path;
|
|
58
|
+
readlink(): Promise<Path>;
|
|
59
|
+
symlinkTo(_target: string | Path): Promise<void>;
|
|
60
|
+
linkTo(_target: string | Path): Promise<void>;
|
|
61
|
+
chmod(_mode: number): Promise<void>;
|
|
62
|
+
touch(_options?: {
|
|
63
|
+
mode?: number;
|
|
64
|
+
existOk?: boolean;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
iterdir(): Promise<Path[]>;
|
|
67
|
+
glob(_pattern: string): Promise<Path[]>;
|
|
68
|
+
rglob(_pattern: string): Promise<Path[]>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* PurePath provides path operations without filesystem access.
|
|
72
|
+
* In browser, this is identical to Path.
|
|
73
|
+
*/
|
|
74
|
+
declare const PurePath: typeof Path;
|
|
75
|
+
declare const PurePosixPath: typeof Path;
|
|
76
|
+
declare const PureWindowsPath: typeof Path;
|
|
77
|
+
declare const PosixPath: typeof Path;
|
|
78
|
+
declare const WindowsPath: typeof Path;
|
|
79
|
+
|
|
80
|
+
type pathlibModule_Path = Path;
|
|
81
|
+
declare const pathlibModule_Path: typeof Path;
|
|
82
|
+
declare const pathlibModule_PosixPath: typeof PosixPath;
|
|
83
|
+
declare const pathlibModule_PurePath: typeof PurePath;
|
|
84
|
+
declare const pathlibModule_PurePosixPath: typeof PurePosixPath;
|
|
85
|
+
declare const pathlibModule_PureWindowsPath: typeof PureWindowsPath;
|
|
86
|
+
declare const pathlibModule_WindowsPath: typeof WindowsPath;
|
|
87
|
+
declare namespace pathlibModule {
|
|
88
|
+
export { pathlibModule_Path as Path, pathlibModule_PosixPath as PosixPath, pathlibModule_PurePath as PurePath, pathlibModule_PurePosixPath as PurePosixPath, pathlibModule_PureWindowsPath as PureWindowsPath, pathlibModule_WindowsPath as WindowsPath };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { Path as P, WindowsPath as W, PurePath as a, PurePosixPath as b, PureWindowsPath as c, PosixPath as d, pathlibModule as p };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { P as Path, d as PosixPath, a as PurePath, b as PurePosixPath, c as PureWindowsPath, W as WindowsPath } from './pathlib.browser-NC7kKQYe.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Path,
|
|
3
|
+
PosixPath,
|
|
4
|
+
PurePath,
|
|
5
|
+
PurePosixPath,
|
|
6
|
+
PureWindowsPath,
|
|
7
|
+
WindowsPath
|
|
8
|
+
} from "./chunk-HSTC277I.js";
|
|
9
|
+
import "./chunk-MLKGABMK.js";
|
|
10
|
+
export {
|
|
11
|
+
Path,
|
|
12
|
+
PosixPath,
|
|
13
|
+
PurePath,
|
|
14
|
+
PurePosixPath,
|
|
15
|
+
PureWindowsPath,
|
|
16
|
+
WindowsPath
|
|
17
|
+
};
|