pythonlib 1.0.2 → 2.0.1

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.
Files changed (133) hide show
  1. package/README.md +123 -49
  2. package/dist/base64-C_am75Sv.d.ts +165 -0
  3. package/dist/base64.d.ts +1 -0
  4. package/dist/base64.js +37 -0
  5. package/dist/chunk-2QEMKE7U.js +252 -0
  6. package/dist/chunk-2YTO24B5.js +78 -0
  7. package/dist/chunk-3HQSBCEC.js +348 -0
  8. package/dist/{chunk-7BZB2TQF.js → chunk-3M3PB4RO.js} +4 -6
  9. package/dist/chunk-5OKGPZBQ.js +1106 -0
  10. package/dist/chunk-B5LQJODJ.js +37 -0
  11. package/dist/{chunk-CUP6EPDB.js → chunk-BCMGGBWG.js} +2 -5
  12. package/dist/chunk-BCVIH2BN.js +175 -0
  13. package/dist/chunk-CANUXHVB.js +349 -0
  14. package/dist/{chunk-QURVRHY2.js → chunk-D35YI363.js} +15 -12
  15. package/dist/{chunk-RSBRI27Z.js → chunk-ETBW6XNR.js} +3 -4
  16. package/dist/chunk-HSTC277I.js +255 -0
  17. package/dist/chunk-HTCQ4OO5.js +238 -0
  18. package/dist/chunk-IANXD4D4.js +250 -0
  19. package/dist/{chunk-G6PUQTVZ.js → chunk-JAUU3HMH.js} +1 -2
  20. package/dist/chunk-JVTQM7CI.js +195 -0
  21. package/dist/chunk-KKJHGY4C.js +551 -0
  22. package/dist/chunk-LHPQS75Z.js +192 -0
  23. package/dist/{chunk-OSX7QZAW.js → chunk-LK2L2TFG.js} +5 -6
  24. package/dist/{chunk-CEZSBJJV.js → chunk-LWYBTWBZ.js} +2 -3
  25. package/dist/chunk-MEEU4SH5.js +362 -0
  26. package/dist/{chunk-TAYRRHJ3.js → chunk-MFKIEN7N.js} +1 -2
  27. package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
  28. package/dist/chunk-OZRS5PC4.js +312 -0
  29. package/dist/chunk-PVK4F3ME.js +194 -0
  30. package/dist/{chunk-56DGFWIJ.js → chunk-QKJBQKPY.js} +1 -2
  31. package/dist/chunk-RB6BYCIQ.js +141 -0
  32. package/dist/chunk-RRSOZXZE.js +155 -0
  33. package/dist/chunk-THMJVAK6.js +282 -0
  34. package/dist/chunk-UGZ5OY5Z.js +165 -0
  35. package/dist/chunk-WTZSAITC.js +82 -0
  36. package/dist/chunk-YONWJHJU.js +265 -0
  37. package/dist/collections.js +2 -3
  38. package/dist/copy-6ZaZ__ge.d.ts +59 -0
  39. package/dist/copy.d.ts +1 -0
  40. package/dist/copy.js +9 -0
  41. package/dist/datetime.js +2 -3
  42. package/dist/functools.js +2 -3
  43. package/dist/glob.browser-B6d_YdV5.d.ts +50 -0
  44. package/dist/glob.browser.d.ts +1 -0
  45. package/dist/glob.browser.js +15 -0
  46. package/dist/glob.node-wn5ehtyM.d.ts +80 -0
  47. package/dist/glob.node.d.ts +1 -0
  48. package/dist/glob.node.js +15 -0
  49. package/dist/hashlib-vKP511NY.d.ts +205 -0
  50. package/dist/hashlib.d.ts +1 -0
  51. package/dist/hashlib.js +39 -0
  52. package/dist/index.browser.d.ts +172 -0
  53. package/dist/index.browser.js +305 -0
  54. package/dist/index.d.ts +36 -602
  55. package/dist/index.js +138 -1073
  56. package/dist/itertools.js +2 -3
  57. package/dist/json.js +2 -3
  58. package/dist/logging.browser-Dux4L5kz.d.ts +185 -0
  59. package/dist/logging.browser.d.ts +1 -0
  60. package/dist/logging.browser.js +63 -0
  61. package/dist/logging.node-CH75bVdE.d.ts +185 -0
  62. package/dist/logging.node.d.ts +1 -0
  63. package/dist/logging.node.js +61 -0
  64. package/dist/math.js +2 -3
  65. package/dist/{os-CqGKe872.d.ts → os.browser-krjSx5kF.d.ts} +32 -55
  66. package/dist/os.browser.d.ts +2 -0
  67. package/dist/{os.js → os.browser.js} +41 -16
  68. package/dist/os.node-CQjch8Ht.d.ts +124 -0
  69. package/dist/os.node.d.ts +2 -0
  70. package/dist/os.node.js +83 -0
  71. package/dist/os.shared-C3x70nhO.d.ts +59 -0
  72. package/dist/pathlib.browser-NC7kKQYe.d.ts +91 -0
  73. package/dist/pathlib.browser.d.ts +1 -0
  74. package/dist/pathlib.browser.js +17 -0
  75. package/dist/pathlib.node-CY3yUFdT.d.ts +331 -0
  76. package/dist/pathlib.node.d.ts +2 -0
  77. package/dist/pathlib.node.js +17 -0
  78. package/dist/random.js +2 -3
  79. package/dist/re.js +2 -3
  80. package/dist/set-JQbLAq8B.d.ts +592 -0
  81. package/dist/shutil.browser-Ck5oWhnP.d.ts +113 -0
  82. package/dist/shutil.browser.d.ts +1 -0
  83. package/dist/shutil.browser.js +33 -0
  84. package/dist/shutil.node-C9kwvhAf.d.ts +160 -0
  85. package/dist/shutil.node.d.ts +2 -0
  86. package/dist/shutil.node.js +33 -0
  87. package/dist/string.js +2 -3
  88. package/dist/subprocess-CZVYzQ3V.d.ts +214 -0
  89. package/dist/subprocess.d.ts +1 -0
  90. package/dist/subprocess.js +29 -0
  91. package/dist/sys-IL8LgI_W.d.ts +212 -0
  92. package/dist/sys.d.ts +1 -0
  93. package/dist/sys.js +51 -0
  94. package/dist/tempfile.browser-DciOKfNm.d.ts +78 -0
  95. package/dist/tempfile.browser.d.ts +1 -0
  96. package/dist/tempfile.browser.js +19 -0
  97. package/dist/tempfile.node-bVMY60Cu.d.ts +195 -0
  98. package/dist/tempfile.node.d.ts +2 -0
  99. package/dist/tempfile.node.js +23 -0
  100. package/dist/time-CcYhdiSu.d.ts +245 -0
  101. package/dist/time.d.ts +1 -0
  102. package/dist/time.js +49 -0
  103. package/dist/urllib-DJtkj-0f.d.ts +198 -0
  104. package/dist/urllib.d.ts +1 -0
  105. package/dist/urllib.js +37 -0
  106. package/dist/uuid-C0ypmn56.d.ts +160 -0
  107. package/dist/uuid.d.ts +1 -0
  108. package/dist/uuid.js +23 -0
  109. package/package.json +128 -5
  110. package/dist/chunk-56DGFWIJ.js.map +0 -1
  111. package/dist/chunk-5AOJFFYN.js +0 -313
  112. package/dist/chunk-5AOJFFYN.js.map +0 -1
  113. package/dist/chunk-7BZB2TQF.js.map +0 -1
  114. package/dist/chunk-CEZSBJJV.js.map +0 -1
  115. package/dist/chunk-CUP6EPDB.js.map +0 -1
  116. package/dist/chunk-G6PUQTVZ.js.map +0 -1
  117. package/dist/chunk-OSX7QZAW.js.map +0 -1
  118. package/dist/chunk-PZ5AY32C.js.map +0 -1
  119. package/dist/chunk-QURVRHY2.js.map +0 -1
  120. package/dist/chunk-RSBRI27Z.js.map +0 -1
  121. package/dist/chunk-TAYRRHJ3.js.map +0 -1
  122. package/dist/collections.js.map +0 -1
  123. package/dist/datetime.js.map +0 -1
  124. package/dist/functools.js.map +0 -1
  125. package/dist/index.js.map +0 -1
  126. package/dist/itertools.js.map +0 -1
  127. package/dist/json.js.map +0 -1
  128. package/dist/math.js.map +0 -1
  129. package/dist/os.d.ts +0 -1
  130. package/dist/os.js.map +0 -1
  131. package/dist/random.js.map +0 -1
  132. package/dist/re.js.map +0 -1
  133. package/dist/string.js.map +0 -1
@@ -0,0 +1,331 @@
1
+ import { Stats } from 'node:fs';
2
+
3
+ /**
4
+ * Python pathlib module for TypeScript
5
+ *
6
+ * Provides object-oriented filesystem paths with async operations.
7
+ *
8
+ * @see {@link https://docs.python.org/3/library/pathlib.html | Python pathlib documentation}
9
+ * @module
10
+ */
11
+
12
+ /**
13
+ * Path class representing a filesystem path.
14
+ * Provides both path manipulation (pure) and filesystem operations.
15
+ */
16
+ declare class Path {
17
+ private readonly _path;
18
+ /**
19
+ * Create a new Path instance.
20
+ *
21
+ * @param pathSegments - Path segments to join
22
+ */
23
+ constructor(...pathSegments: string[]);
24
+ /**
25
+ * Static factory method to create a Path.
26
+ */
27
+ static of(...pathSegments: string[]): Path;
28
+ /**
29
+ * The final component of the path.
30
+ */
31
+ get name(): string;
32
+ /**
33
+ * The final component without its suffix.
34
+ */
35
+ get stem(): string;
36
+ /**
37
+ * The file extension of the final component.
38
+ */
39
+ get suffix(): string;
40
+ /**
41
+ * A list of the path's file extensions.
42
+ */
43
+ get suffixes(): string[];
44
+ /**
45
+ * The logical parent of the path.
46
+ */
47
+ get parent(): Path;
48
+ /**
49
+ * An immutable sequence of the path's ancestors.
50
+ */
51
+ get parents(): Path[];
52
+ /**
53
+ * The individual components of the path.
54
+ */
55
+ get parts(): string[];
56
+ /**
57
+ * The drive or root (on Windows, the drive letter; on Unix, empty or /).
58
+ */
59
+ get anchor(): string;
60
+ /**
61
+ * The drive letter (Windows only, empty on Unix).
62
+ */
63
+ get drive(): string;
64
+ /**
65
+ * The root of the path (/ on Unix, \\ or drive:\\ on Windows).
66
+ */
67
+ get root(): string;
68
+ /**
69
+ * Whether the path is absolute.
70
+ */
71
+ isAbsolute(): boolean;
72
+ /**
73
+ * Combine this path with additional segments.
74
+ *
75
+ * @param pathSegments - Path segments to join
76
+ * @returns A new Path
77
+ */
78
+ joinpath(...pathSegments: string[]): Path;
79
+ /**
80
+ * Division operator alternative: join paths.
81
+ *
82
+ * @param other - Path segment to join
83
+ * @returns A new Path
84
+ */
85
+ div(other: string | Path): Path;
86
+ /**
87
+ * Return a string representation of the path.
88
+ */
89
+ toString(): string;
90
+ /**
91
+ * Return the path as a POSIX path string.
92
+ */
93
+ asPosix(): string;
94
+ /**
95
+ * Return the path as a URI.
96
+ */
97
+ asUri(): string;
98
+ /**
99
+ * Whether the path exists.
100
+ */
101
+ exists(): Promise<boolean>;
102
+ /**
103
+ * Whether the path is a file.
104
+ */
105
+ isFile(): Promise<boolean>;
106
+ /**
107
+ * Whether the path is a directory.
108
+ */
109
+ isDir(): Promise<boolean>;
110
+ /**
111
+ * Whether the path is a symbolic link.
112
+ */
113
+ isSymlink(): Promise<boolean>;
114
+ /**
115
+ * Read the file contents as text.
116
+ *
117
+ * @param encoding - Text encoding (default: utf-8)
118
+ * @returns File contents as string
119
+ */
120
+ readText(encoding?: BufferEncoding): Promise<string>;
121
+ /**
122
+ * Write text to the file.
123
+ *
124
+ * @param data - Text to write
125
+ * @param encoding - Text encoding (default: utf-8)
126
+ */
127
+ writeText(data: string, encoding?: BufferEncoding): Promise<void>;
128
+ /**
129
+ * Read the file contents as bytes.
130
+ *
131
+ * @returns File contents as Uint8Array
132
+ */
133
+ readBytes(): Promise<Uint8Array>;
134
+ /**
135
+ * Write bytes to the file.
136
+ *
137
+ * @param data - Bytes to write
138
+ */
139
+ writeBytes(data: Uint8Array): Promise<void>;
140
+ /**
141
+ * Create the directory (and parents if necessary).
142
+ *
143
+ * @param options - Options object
144
+ */
145
+ mkdir(options?: {
146
+ parents?: boolean;
147
+ existOk?: boolean;
148
+ }): Promise<void>;
149
+ /**
150
+ * Remove the directory.
151
+ */
152
+ rmdir(): Promise<void>;
153
+ /**
154
+ * Remove the file or symbolic link.
155
+ */
156
+ unlink(): Promise<void>;
157
+ /**
158
+ * Rename the path to target.
159
+ *
160
+ * @param target - New path
161
+ * @returns The new Path
162
+ */
163
+ rename(target: string | Path): Promise<Path>;
164
+ /**
165
+ * Replace target with this file.
166
+ *
167
+ * @param target - Target path to replace
168
+ * @returns The new Path
169
+ */
170
+ replace(target: string | Path): Promise<Path>;
171
+ /**
172
+ * Make the path absolute.
173
+ *
174
+ * @returns Absolute path
175
+ */
176
+ resolve(): Path;
177
+ /**
178
+ * Return the absolute path.
179
+ *
180
+ * @returns Absolute path
181
+ */
182
+ absolute(): Path;
183
+ /**
184
+ * Return the real path (resolving symlinks).
185
+ *
186
+ * @returns Real path
187
+ */
188
+ readlink(): Promise<Path>;
189
+ /**
190
+ * Get file statistics.
191
+ *
192
+ * @returns File stat object
193
+ */
194
+ stat(): Promise<Stats>;
195
+ /**
196
+ * Get symbolic link statistics.
197
+ *
198
+ * @returns Stat object for the symlink itself
199
+ */
200
+ lstat(): Promise<Stats>;
201
+ /**
202
+ * Iterate over directory contents.
203
+ *
204
+ * @returns Array of Path objects
205
+ */
206
+ iterdir(): Promise<Path[]>;
207
+ /**
208
+ * Glob pattern matching.
209
+ *
210
+ * @param pattern - Glob pattern
211
+ * @returns Array of matching Path objects
212
+ */
213
+ glob(pattern: string): Promise<Path[]>;
214
+ /**
215
+ * Recursive glob pattern matching.
216
+ *
217
+ * @param pattern - Glob pattern
218
+ * @returns Array of matching Path objects
219
+ */
220
+ rglob(pattern: string): Promise<Path[]>;
221
+ /**
222
+ * Internal glob matching implementation.
223
+ */
224
+ private matchGlob;
225
+ /**
226
+ * Convert glob pattern to regex.
227
+ */
228
+ private globToRegex;
229
+ /**
230
+ * Create a symbolic link.
231
+ *
232
+ * @param target - Target of the symlink
233
+ */
234
+ symlinkTo(target: string | Path): Promise<void>;
235
+ /**
236
+ * Create a hard link.
237
+ *
238
+ * @param target - Target of the link
239
+ */
240
+ linkTo(target: string | Path): Promise<void>;
241
+ /**
242
+ * Change file permissions.
243
+ *
244
+ * @param mode - Permission mode
245
+ */
246
+ chmod(mode: number): Promise<void>;
247
+ /**
248
+ * Update access and modification times.
249
+ *
250
+ * @param atime - Access time
251
+ * @param mtime - Modification time
252
+ */
253
+ touch(atime?: Date, mtime?: Date): Promise<void>;
254
+ /**
255
+ * Check if path matches a pattern.
256
+ *
257
+ * @param pattern - Glob pattern
258
+ * @returns True if matches
259
+ */
260
+ match(pattern: string): boolean;
261
+ /**
262
+ * Return path relative to another path.
263
+ *
264
+ * @param other - Base path
265
+ * @returns Relative path
266
+ */
267
+ relativeTo(other: string | Path): Path;
268
+ /**
269
+ * Return a new path with a different suffix.
270
+ *
271
+ * @param suffix - New suffix
272
+ * @returns New Path
273
+ */
274
+ withSuffix(suffix: string): Path;
275
+ /**
276
+ * Return a new path with a different name.
277
+ *
278
+ * @param name - New name
279
+ * @returns New Path
280
+ */
281
+ withName(name: string): Path;
282
+ /**
283
+ * Return a new path with a different stem.
284
+ *
285
+ * @param stem - New stem
286
+ * @returns New Path
287
+ */
288
+ withStem(stem: string): Path;
289
+ /**
290
+ * Get the current working directory as a Path.
291
+ */
292
+ static cwd(): Path;
293
+ /**
294
+ * Get the home directory as a Path.
295
+ */
296
+ static home(): Path;
297
+ }
298
+ /**
299
+ * PurePath class for path manipulation without filesystem access.
300
+ * This is an alias for Path that only uses the pure path operations.
301
+ */
302
+ declare const PurePath: typeof Path;
303
+ /**
304
+ * PurePosixPath for POSIX-style paths.
305
+ */
306
+ declare const PurePosixPath: typeof Path;
307
+ /**
308
+ * PureWindowsPath for Windows-style paths.
309
+ */
310
+ declare const PureWindowsPath: typeof Path;
311
+ /**
312
+ * PosixPath for POSIX filesystem operations.
313
+ */
314
+ declare const PosixPath: typeof Path;
315
+ /**
316
+ * WindowsPath for Windows filesystem operations.
317
+ */
318
+ declare const WindowsPath: typeof Path;
319
+
320
+ type pathlibModule_Path = Path;
321
+ declare const pathlibModule_Path: typeof Path;
322
+ declare const pathlibModule_PosixPath: typeof PosixPath;
323
+ declare const pathlibModule_PurePath: typeof PurePath;
324
+ declare const pathlibModule_PurePosixPath: typeof PurePosixPath;
325
+ declare const pathlibModule_PureWindowsPath: typeof PureWindowsPath;
326
+ declare const pathlibModule_WindowsPath: typeof WindowsPath;
327
+ declare namespace pathlibModule {
328
+ 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 };
329
+ }
330
+
331
+ 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,2 @@
1
+ import 'node:fs';
2
+ export { P as Path, d as PosixPath, a as PurePath, b as PurePosixPath, c as PureWindowsPath, W as WindowsPath } from './pathlib.node-CY3yUFdT.js';
@@ -0,0 +1,17 @@
1
+ import {
2
+ Path,
3
+ PosixPath,
4
+ PurePath,
5
+ PurePosixPath,
6
+ PureWindowsPath,
7
+ WindowsPath
8
+ } from "./chunk-KKJHGY4C.js";
9
+ import "./chunk-MLKGABMK.js";
10
+ export {
11
+ Path,
12
+ PosixPath,
13
+ PurePath,
14
+ PurePosixPath,
15
+ PureWindowsPath,
16
+ WindowsPath
17
+ };
package/dist/random.js CHANGED
@@ -17,8 +17,8 @@ import {
17
17
  uniform,
18
18
  vonMisesVariate,
19
19
  weibullVariate
20
- } from "./chunk-7BZB2TQF.js";
21
- import "./chunk-PZ5AY32C.js";
20
+ } from "./chunk-3M3PB4RO.js";
21
+ import "./chunk-MLKGABMK.js";
22
22
  export {
23
23
  betaVariate,
24
24
  choice,
@@ -39,4 +39,3 @@ export {
39
39
  vonMisesVariate,
40
40
  weibullVariate
41
41
  };
42
- //# sourceMappingURL=random.js.map
package/dist/re.js CHANGED
@@ -22,8 +22,8 @@ import {
22
22
  split,
23
23
  sub,
24
24
  subn
25
- } from "./chunk-RSBRI27Z.js";
26
- import "./chunk-PZ5AY32C.js";
25
+ } from "./chunk-ETBW6XNR.js";
26
+ import "./chunk-MLKGABMK.js";
27
27
  export {
28
28
  A,
29
29
  ASCII,
@@ -49,4 +49,3 @@ export {
49
49
  sub,
50
50
  subn
51
51
  };
52
- //# sourceMappingURL=re.js.map