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
package/dist/index.d.ts CHANGED
@@ -4,601 +4,28 @@ import { c as collectionsModule } from './collections-BthXtkEp.js';
4
4
  import { m as mathModule } from './math-D2NPMc-x.js';
5
5
  import { r as randomModule } from './random-DcS5jtEs.js';
6
6
  import { j as jsonModule } from './json-DoWhX04T.js';
7
- import { o as osModule } from './os-CqGKe872.js';
7
+ import { o as osModule } from './os.node-CQjch8Ht.js';
8
8
  import { d as datetimeModule } from './datetime-BM_IjhTq.js';
9
9
  import { r as reModule } from './re-Bo-IOqov.js';
10
10
  import { capWords, Template } from './string.js';
11
-
12
- /**
13
- * Core Python operations for TypeScript
14
- * Arithmetic operations with Python semantics, slicing, etc.
15
- */
16
- /**
17
- * Floor division (Python //)
18
- * Always rounds towards negative infinity, unlike Math.floor for negatives
19
- */
20
- declare function floorDiv$1(a: number, b: number): number;
21
- /**
22
- * Power operator (Python **)
23
- */
24
- declare function pow(base: number, exp: number): number;
25
- /**
26
- * Modulo (Python %)
27
- * Python's % always returns a result with the same sign as the divisor
28
- */
29
- declare function mod$1(a: number, b: number): number;
30
- /**
31
- * Python divMod()
32
- */
33
- declare function divMod$1(a: number, b: number): [number, number];
34
- /**
35
- * Python %-style string formatting
36
- * Handles %s, %d, %i, %f, %r, %x, %o, etc.
37
- */
38
- declare function sprintf$1(template: string, args: unknown): string;
39
- /**
40
- * Python str.format() style string formatting
41
- * Handles {} positional and {name} named placeholders
42
- */
43
- declare function strFormat$1(template: string, ...args: unknown[]): string;
44
- /**
45
- * Python-style slice operation
46
- * Supports negative indices and step
47
- */
48
- declare function slice$1<T>(obj: string | T[], start?: number, stop?: number, step?: number): string | T[];
49
- /**
50
- * Python-style index access with support for negative indices
51
- */
52
- declare function at$1<T>(obj: string | T[], index: number): T | string;
53
- /**
54
- * Python-style string/array repetition
55
- */
56
- declare function repeat<T>(obj: string | T[], count: number): string | T[];
57
- /**
58
- * Python 'in' operator
59
- */
60
- declare function contains$1<T>(item: T, container: Iterable<T> | string | Map<T, unknown> | Set<T>): boolean;
61
- /**
62
- * Python 'is' operator (identity comparison)
63
- */
64
- declare function is$1(a: unknown, b: unknown): boolean;
65
-
66
- /**
67
- * Python built-in functions for TypeScript
68
- *
69
- * Provides core Python built-in functions like len, range, enumerate, sorted, min, max, etc.
70
- *
71
- * @see {@link https://docs.python.org/3/library/functions.html | Python built-in functions documentation}
72
- */
73
- /**
74
- * Return a sequence of numbers from start to stop (exclusive) by step.
75
- *
76
- * @param startOrStop - If only one argument, this is stop (start defaults to 0). Otherwise, this is start.
77
- * @param stop - The end value (exclusive)
78
- * @param step - The increment (default: 1)
79
- * @returns An iterable of numbers
80
- * @see {@link https://docs.python.org/3/library/functions.html#func-range | Python range()}
81
- */
82
- declare function range$1(startOrStop: number, stop?: number, step?: number): Iterable<number>;
83
- /**
84
- * Return an iterable of tuples containing (index, value) pairs.
85
- *
86
- * @param iterable - The sequence to enumerate
87
- * @param start - The starting index (default: 0)
88
- * @returns An iterable of [index, value] tuples
89
- * @see {@link https://docs.python.org/3/library/functions.html#enumerate | Python enumerate()}
90
- */
91
- declare function enumerate$1<T>(iterable: Iterable<T>, start?: number): Iterable<[number, T]>;
92
- /**
93
- * Iterate over multiple iterables in parallel, yielding tuples.
94
- *
95
- * Stops when the shortest iterable is exhausted.
96
- *
97
- * @param iterables - The iterables to zip together
98
- * @returns An iterable of tuples containing elements from each input
99
- * @see {@link https://docs.python.org/3/library/functions.html#zip | Python zip()}
100
- */
101
- declare function zip$1<T extends unknown[][]>(...iterables: {
102
- [K in keyof T]: Iterable<T[K]>;
103
- }): Iterable<T>;
104
- /**
105
- * Return an iterator object for the given iterable.
106
- *
107
- * For objects without Symbol.iterator, returns the object's keys.
108
- *
109
- * @param obj - The object to iterate over
110
- * @returns An iterable
111
- * @see {@link https://docs.python.org/3/library/functions.html#iter | Python iter()}
112
- */
113
- declare function iter$1<T>(obj: Iterable<T> | Record<string, unknown> | null | undefined): Iterable<T> | string[];
114
- /**
115
- * Return a reversed iterator over the values of the given sequence.
116
- *
117
- * Uses ES2023 Array.prototype.toReversed() for immutable reversal.
118
- *
119
- * @param iterable - The sequence to reverse
120
- * @returns An iterable yielding elements in reverse order
121
- * @see {@link https://docs.python.org/3/library/functions.html#reversed | Python reversed()}
122
- */
123
- declare function reversed$1<T>(iterable: Iterable<T>): Iterable<T>;
124
- /**
125
- * Return a new sorted list from the items in the iterable.
126
- *
127
- * Uses ES2023 Array.prototype.toSorted() for immutable sorting.
128
- *
129
- * @param iterable - The sequence to sort
130
- * @param options - Sorting options: key function and/or reverse flag
131
- * @returns A new sorted array
132
- * @see {@link https://docs.python.org/3/library/functions.html#sorted | Python sorted()}
133
- */
134
- declare function sorted$1<T>(iterable: Iterable<T>, options?: {
135
- key?: (x: T) => unknown;
136
- reverse?: boolean;
137
- }): T[];
138
- /**
139
- * Apply a function to every item of the iterable and yield the results.
140
- *
141
- * Uses ES2024 Iterator.prototype.map() for lazy evaluation.
142
- *
143
- * @param fn - The function to apply to each element
144
- * @param iterable - The input iterable
145
- * @returns An iterable of transformed values
146
- * @see {@link https://docs.python.org/3/library/functions.html#map | Python map()}
147
- */
148
- declare function map$1<T, U>(fn: (x: T) => U, iterable: Iterable<T>): Iterable<U>;
149
- /**
150
- * Return an iterable yielding items where the function returns true.
151
- *
152
- * If function is null, return items that are truthy.
153
- * Uses ES2024 Iterator.prototype.filter() for lazy evaluation.
154
- *
155
- * @param fn - The predicate function (or null for truthiness check)
156
- * @param iterable - The input iterable
157
- * @returns An iterable of filtered values
158
- * @see {@link https://docs.python.org/3/library/functions.html#filter | Python filter()}
159
- */
160
- declare function filter$1<T>(fn: ((x: T) => boolean) | null, iterable: Iterable<T>): Iterable<T>;
161
- /**
162
- * Create an immutable tuple (frozen array).
163
- *
164
- * @param items - The elements to include in the tuple
165
- * @returns A frozen (readonly) array
166
- * @see {@link https://docs.python.org/3/library/functions.html#func-tuple | Python tuple()}
167
- */
168
- declare function tuple$1<T extends unknown[]>(...items: T): Readonly<T>;
169
- /**
170
- * Return the number of items in an object.
171
- *
172
- * Works with strings, arrays, Maps, Sets, and objects with a length property.
173
- *
174
- * @param obj - The object to measure
175
- * @returns The number of items
176
- * @see {@link https://docs.python.org/3/library/functions.html#len | Python len()}
177
- */
178
- declare function len$1(obj: string | unknown[] | Map<unknown, unknown> | Set<unknown> | {
179
- length: number;
180
- }): number;
181
- /**
182
- * Return the absolute value of a number.
183
- *
184
- * @param x - The number
185
- * @returns The absolute value
186
- * @see {@link https://docs.python.org/3/library/functions.html#abs | Python abs()}
187
- */
188
- declare function abs$1(x: number): number;
189
- /**
190
- * Return the smallest item in an iterable or the smallest of two or more arguments.
191
- *
192
- * @param args - An iterable, or multiple values to compare
193
- * @returns The minimum value
194
- * @see {@link https://docs.python.org/3/library/functions.html#min | Python min()}
195
- */
196
- declare function min$1<T>(...args: T[] | [Iterable<T>]): T;
197
- /**
198
- * Return the largest item in an iterable or the largest of two or more arguments.
199
- *
200
- * @param args - An iterable, or multiple values to compare
201
- * @returns The maximum value
202
- * @see {@link https://docs.python.org/3/library/functions.html#max | Python max()}
203
- */
204
- declare function max$1<T>(...args: T[] | [Iterable<T>]): T;
205
- /**
206
- * Return the sum of all items in the iterable plus an optional start value.
207
- *
208
- * @param iterable - The numbers to sum
209
- * @param start - The initial value (default: 0)
210
- * @returns The sum
211
- * @see {@link https://docs.python.org/3/library/functions.html#sum | Python sum()}
212
- */
213
- declare function sum$1(iterable: Iterable<number>, start?: number): number;
214
- /**
215
- * Return True if all elements of the iterable are truthy (or if empty).
216
- *
217
- * @param iterable - The elements to test
218
- * @returns True if all elements are truthy
219
- * @see {@link https://docs.python.org/3/library/functions.html#all | Python all()}
220
- */
221
- declare function all$1(iterable: Iterable<unknown>): boolean;
222
- /**
223
- * Return True if any element of the iterable is truthy.
224
- *
225
- * @param iterable - The elements to test
226
- * @returns True if any element is truthy
227
- * @see {@link https://docs.python.org/3/library/functions.html#any | Python any()}
228
- */
229
- declare function any$1(iterable: Iterable<unknown>): boolean;
230
- /**
231
- * Round a number to a given precision in decimal digits.
232
- *
233
- * Uses banker's rounding (round half to even) for values exactly halfway.
234
- *
235
- * @param number - The number to round
236
- * @param ndigits - Number of decimal places (default: 0)
237
- * @returns The rounded number
238
- * @see {@link https://docs.python.org/3/library/functions.html#round | Python round()}
239
- */
240
- declare function round$1(number: number, ndigits?: number): number;
241
- /**
242
- * Return the Unicode code point for a one-character string.
243
- *
244
- * @param char - A single character
245
- * @returns The Unicode code point
246
- * @see {@link https://docs.python.org/3/library/functions.html#ord | Python ord()}
247
- */
248
- declare function ord$1(char: string): number;
249
- /**
250
- * Return the string representing a character at the given Unicode code point.
251
- *
252
- * @param code - The Unicode code point
253
- * @returns A single-character string
254
- * @see {@link https://docs.python.org/3/library/functions.html#chr | Python chr()}
255
- */
256
- declare function chr$1(code: number): string;
257
- /**
258
- * Convert an integer to a lowercase hexadecimal string prefixed with "0x".
259
- *
260
- * @param x - The integer to convert
261
- * @returns Hexadecimal string (e.g., "0xff")
262
- * @see {@link https://docs.python.org/3/library/functions.html#hex | Python hex()}
263
- */
264
- declare function hex$1(x: number): string;
265
- /**
266
- * Convert an integer to an octal string prefixed with "0o".
267
- *
268
- * @param x - The integer to convert
269
- * @returns Octal string (e.g., "0o17")
270
- * @see {@link https://docs.python.org/3/library/functions.html#oct | Python oct()}
271
- */
272
- declare function oct$1(x: number): string;
273
- /**
274
- * Convert an integer to a binary string prefixed with "0b".
275
- *
276
- * @param x - The integer to convert
277
- * @returns Binary string (e.g., "0b1010")
278
- * @see {@link https://docs.python.org/3/library/functions.html#bin | Python bin()}
279
- */
280
- declare function bin$1(x: number): string;
281
- /**
282
- * Convert a value to an integer.
283
- *
284
- * Truncates floats toward zero. Parses strings in the given base.
285
- *
286
- * @param x - The value to convert
287
- * @param base - The base for string conversion (default: 10)
288
- * @returns The integer value
289
- * @see {@link https://docs.python.org/3/library/functions.html#int | Python int()}
290
- */
291
- declare function int$1(x: string | number | boolean, base?: number): number;
292
- /**
293
- * Convert a value to a floating-point number.
294
- *
295
- * @param x - The value to convert
296
- * @returns The float value
297
- * @see {@link https://docs.python.org/3/library/functions.html#float | Python float()}
298
- */
299
- declare function float$1(x: string | number): number;
300
- /**
301
- * Convert a value to its string representation.
302
- *
303
- * Uses Python-style formatting for booleans (True/False), None, and collections.
304
- *
305
- * @param x - The value to convert
306
- * @returns The string representation
307
- * @see {@link https://docs.python.org/3/library/functions.html#func-str | Python str()}
308
- */
309
- declare function str$1(x: unknown): string;
310
- /**
311
- * Return a string containing a printable representation of an object.
312
- *
313
- * Strings are quoted, other types use str() representation.
314
- *
315
- * @param x - The value to represent
316
- * @returns A printable representation
317
- * @see {@link https://docs.python.org/3/library/functions.html#repr | Python repr()}
318
- */
319
- declare function repr$1(x: unknown): string;
320
- /**
321
- * Convert a value to a boolean using Python's truthiness rules.
322
- *
323
- * False values: null, undefined, false, 0, empty strings, empty arrays, empty Maps/Sets.
324
- *
325
- * @param x - The value to convert
326
- * @returns The boolean value
327
- * @see {@link https://docs.python.org/3/library/functions.html#bool | Python bool()}
328
- */
329
- declare function bool$1(x: unknown): boolean;
330
- /**
331
- * Return a string containing a printable ASCII representation.
332
- *
333
- * Non-ASCII characters are escaped using \\xhh, \\uhhhh, or \\Uhhhhhhhh.
334
- *
335
- * @param x - The value to represent
336
- * @returns ASCII-safe printable representation
337
- * @see {@link https://docs.python.org/3/library/functions.html#ascii | Python ascii()}
338
- */
339
- declare function ascii$1(x: unknown): string;
340
- /**
341
- * Return True if the object is an instance of the specified class.
342
- *
343
- * Supports JavaScript constructors (Number, String, etc.) and Python type names.
344
- *
345
- * @param obj - The object to check
346
- * @param classInfo - The class or type name to check against
347
- * @returns True if obj is an instance of classInfo
348
- * @see {@link https://docs.python.org/3/library/functions.html#isinstance | Python isinstance()}
349
- */
350
- declare function isinstance$1(obj: unknown, classInfo: unknown): boolean;
351
- /**
352
- * Return the type name of an object as a string.
353
- *
354
- * Returns Python-style type names: 'int', 'float', 'str', 'bool', 'list', 'dict', 'set'.
355
- *
356
- * @param obj - The object to check
357
- * @returns The type name
358
- * @see {@link https://docs.python.org/3/library/functions.html#type | Python type()}
359
- */
360
- declare function type$1(obj: unknown): string;
361
- /**
362
- * Read a line of input from the user.
363
- *
364
- * Note: This function requires async implementation in JavaScript environments.
365
- *
366
- * @param prompt - Optional prompt string to display
367
- * @returns The input string
368
- * @see {@link https://docs.python.org/3/library/functions.html#input | Python input()}
369
- */
370
- declare function input$1(prompt?: string): string;
371
- /**
372
- * Convert a value to a formatted representation using a format specification.
373
- *
374
- * Supports Python format spec mini-language for numbers and strings.
375
- *
376
- * @param value - The value to format
377
- * @param spec - The format specification string
378
- * @returns The formatted string
379
- * @see {@link https://docs.python.org/3/library/functions.html#format | Python format()}
380
- */
381
- declare function format$1(value: unknown, spec: string): string;
382
- /**
383
- * Python getattr() function - get an attribute from an object
384
- *
385
- * @param obj - The object to get the attribute from
386
- * @param name - The name of the attribute
387
- * @param defaultValue - Optional default value if attribute doesn't exist
388
- * @returns The attribute value or default value
389
- */
390
- declare function getattr$1<T>(obj: unknown, name: string, defaultValue?: T): T | undefined;
391
- /**
392
- * Python hasattr() function - check if an object has an attribute
393
- *
394
- * @param obj - The object to check
395
- * @param name - The name of the attribute
396
- * @returns True if the attribute exists, false otherwise
397
- */
398
- declare function hasattr$1(obj: unknown, name: string): boolean;
399
- /**
400
- * Python setattr() function - set an attribute on an object
401
- *
402
- * @param obj - The object to set the attribute on
403
- * @param name - The name of the attribute
404
- * @param value - The value to set
405
- */
406
- declare function setattr$1(obj: unknown, name: string, value: unknown): void;
407
-
408
- /**
409
- * Python list methods for TypeScript
410
- * Usage: py.list.remove(), py.list.sort(), etc.
411
- */
412
- declare const list$1: {
413
- /**
414
- * Python list.append() - modifies array in place
415
- */
416
- append<T>(arr: T[], item: T): void;
417
- /**
418
- * Python list.extend() - modifies array in place
419
- */
420
- extend<T>(arr: T[], items: Iterable<T>): void;
421
- /**
422
- * Python list.insert() - modifies array in place
423
- */
424
- insert<T>(arr: T[], index: number, item: T): void;
425
- /**
426
- * Python list.remove() - removes first occurrence, modifies in place
427
- */
428
- remove<T>(arr: T[], value: T): void;
429
- /**
430
- * Python list.pop() - removes and returns item at index
431
- */
432
- pop<T>(arr: T[], index?: number): T;
433
- /**
434
- * Python list.clear() - removes all items
435
- */
436
- clear(arr: unknown[]): void;
437
- /**
438
- * Python list.index() - finds first occurrence
439
- */
440
- index<T>(arr: T[], value: T, start?: number, end?: number): number;
441
- /**
442
- * Python list.count() - counts occurrences
443
- */
444
- count<T>(arr: T[], value: T): number;
445
- /**
446
- * Python list.sort() with key function - modifies in place
447
- */
448
- sort<T>(arr: T[], options?: {
449
- key?: (x: T) => unknown;
450
- reverse?: boolean;
451
- }): void;
452
- /**
453
- * Python list.reverse() - reverses in place
454
- */
455
- reverse(arr: unknown[]): void;
456
- /**
457
- * Python list.copy() - shallow copy
458
- */
459
- copy<T>(arr: T[]): T[];
460
- /**
461
- * Python slice assignment: arr[start:end:step] = values
462
- * Replaces a slice of the array with new values, modifying in place
463
- */
464
- sliceAssign<T>(arr: T[], start: number | undefined, end: number | undefined, step: number | undefined, values: T[]): void;
465
- };
466
-
467
- /**
468
- * Python dict methods for TypeScript
469
- * Usage: py.dict.get(), py.dict.keys(), etc.
470
- */
471
- declare const dict$1: {
472
- /**
473
- * Python dict.get() - get value with optional default
474
- */
475
- get<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue?: V): V | undefined;
476
- /**
477
- * Python dict.setDefault() - get value or set default
478
- */
479
- setDefault<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue: V): V;
480
- /**
481
- * Python dict.pop() - remove and return value
482
- */
483
- pop<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue?: V): V | undefined;
484
- /**
485
- * Python dict.popItem() - remove and return last item
486
- */
487
- popItem<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V];
488
- /**
489
- * Python dict.update() - update with another dict
490
- */
491
- update<K extends string | number | symbol, V>(obj: Record<K, V>, other: Record<K, V> | Iterable<[K, V]>): void;
492
- /**
493
- * Python dict.clear() - remove all items
494
- */
495
- clear<K extends string | number | symbol, V>(obj: Record<K, V>): void;
496
- /**
497
- * Python dict.copy() - shallow copy
498
- */
499
- copy<K extends string | number | symbol, V>(obj: Record<K, V>): Record<K, V>;
500
- /**
501
- * Python dict.keys() - returns iterable of keys
502
- */
503
- keys<K extends string | number | symbol, V>(obj: Record<K, V>): K[];
504
- /**
505
- * Python dict.values() - returns iterable of values
506
- */
507
- values<K extends string | number | symbol, V>(obj: Record<K, V>): V[];
508
- /**
509
- * Python dict.items() - returns iterable of [key, value] pairs
510
- */
511
- items<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V][];
512
- /**
513
- * Python dict.fromKeys() - create dict from keys
514
- */
515
- fromKeys<K extends string | number | symbol, V>(keys: K[], value?: V): Record<K, V | undefined>;
516
- };
517
-
518
- /**
519
- * Python set methods for TypeScript
520
- * Usage: py.set.intersection(), py.set.union(), etc.
521
- *
522
- * Uses ES2024 native Set methods where available for optimal performance.
523
- */
524
- declare const set$1: {
525
- /**
526
- * Python set.add() - add element
527
- */
528
- add<T>(s: Set<T>, item: T): void;
529
- /**
530
- * Python set.remove() - remove element, raises error if not found
531
- */
532
- remove<T>(s: Set<T>, item: T): void;
533
- /**
534
- * Python set.discard() - remove element if present
535
- */
536
- discard<T>(s: Set<T>, item: T): void;
537
- /**
538
- * Python set.pop() - remove and return arbitrary element
539
- */
540
- pop<T>(s: Set<T>): T;
541
- /**
542
- * Python set.clear() - remove all elements
543
- */
544
- clear<T>(s: Set<T>): void;
545
- /**
546
- * Python set.copy() - shallow copy
547
- */
548
- copy<T>(s: Set<T>): Set<T>;
549
- /**
550
- * Python set.update() - add elements from iterable
551
- */
552
- update<T>(s: Set<T>, ...iterables: Iterable<T>[]): void;
553
- /**
554
- * Python set.union() - returns new set with all elements
555
- * Uses ES2024 Set.prototype.union()
556
- */
557
- union<T>(a: Set<T>, ...others: Iterable<T>[]): Set<T>;
558
- /**
559
- * Python set.intersection() - returns new set with common elements
560
- * Uses ES2024 Set.prototype.intersection()
561
- */
562
- intersection<T>(a: Set<T>, b: Set<T>): Set<T>;
563
- /**
564
- * Python set.intersection_update() - keep only common elements
565
- */
566
- intersectionUpdate<T>(a: Set<T>, b: Set<T>): void;
567
- /**
568
- * Python set.difference() - returns new set with elements in a but not in b
569
- * Uses ES2024 Set.prototype.difference()
570
- */
571
- difference<T>(a: Set<T>, b: Set<T>): Set<T>;
572
- /**
573
- * Python set.difference_update() - remove elements found in b
574
- */
575
- differenceUpdate<T>(a: Set<T>, b: Set<T>): void;
576
- /**
577
- * Python set.symmetric_difference() - returns new set with elements in either but not both
578
- * Uses ES2024 Set.prototype.symmetricDifference()
579
- */
580
- symmetricDifference<T>(a: Set<T>, b: Set<T>): Set<T>;
581
- /**
582
- * Python set.symmetric_difference_update() - update with symmetric difference
583
- * Uses ES2024 Set.prototype.symmetricDifference()
584
- */
585
- symmetricDifferenceUpdate<T>(a: Set<T>, b: Set<T>): void;
586
- /**
587
- * Python set.isSubset() - test if all elements are in other
588
- * Uses ES2024 Set.prototype.isSubsetOf()
589
- */
590
- isSubset<T>(a: Set<T>, b: Set<T>): boolean;
591
- /**
592
- * Python set.isSuperset() - test if all other elements are in this set
593
- * Uses ES2024 Set.prototype.isSupersetOf()
594
- */
595
- isSuperset<T>(a: Set<T>, b: Set<T>): boolean;
596
- /**
597
- * Python set.isDisjoint() - test if no common elements
598
- * Uses ES2024 Set.prototype.isDisjointFrom()
599
- */
600
- isDisjoint<T>(a: Set<T>, b: Set<T>): boolean;
601
- };
11
+ import { s as sysModule } from './sys-IL8LgI_W.js';
12
+ import { t as timeModule } from './time-CcYhdiSu.js';
13
+ import { c as copyModule } from './copy-6ZaZ__ge.js';
14
+ import { b as base64Module } from './base64-C_am75Sv.js';
15
+ import { u as uuidModule } from './uuid-C0ypmn56.js';
16
+ import { h as hashlibModule } from './hashlib-vKP511NY.js';
17
+ import { p as pathlibModule } from './pathlib.node-CY3yUFdT.js';
18
+ import { g as globModule } from './glob.node-wn5ehtyM.js';
19
+ import { s as shutilModule } from './shutil.node-C9kwvhAf.js';
20
+ import { t as tempfileModule } from './tempfile.node-bVMY60Cu.js';
21
+ import { s as subprocessModule } from './subprocess-CZVYzQ3V.js';
22
+ import { u as urllibModule } from './urllib-DJtkj-0f.js';
23
+ import { l as loggingModule } from './logging.node-CH75bVdE.js';
24
+ import { l as list$1, d as dict$1, s as set$1, f as floorDiv$1, m as mod$1, a as divMod$1, b as sprintf$1, c as strFormat$1, e as slice$1, g as at$1, h as contains$1, i as is$1, r as range$1, j as enumerate$1, z as zip$1, k as iter$1, n as reversed$1, o as sorted$1, p as map$1, q as filter$1, t as tuple$1, u as len$1, v as abs$1, w as min$1, x as max$1, y as sum$1, A as all$1, B as any$1, C as round$1, D as ord$1, E as chr$1, F as hex$1, G as oct$1, H as bin$1, I as int$1, J as float$1, K as str$1, L as repr$1, M as bool$1, N as ascii$1, O as isinstance$1, P as type$1, Q as input$1, R as format$1, S as getattr$1, T as hasattr$1, U as setattr$1 } from './set-JQbLAq8B.js';
25
+ export { W as pow, V as repeatValue } from './set-JQbLAq8B.js';
26
+ import './os.shared-C3x70nhO.js';
27
+ import 'node:fs';
28
+ import 'node:fs/promises';
602
29
 
603
30
  /**
604
31
  * Python Built-in Functions for TypeScript
@@ -679,15 +106,22 @@ declare const string: {
679
106
  isLower(s: string): boolean;
680
107
  format(s: string, ...args: unknown[]): string;
681
108
  };
682
- type ListConstructor = {
683
- <T>(iterable?: Iterable<T>): T[];
684
- } & typeof list$1;
685
- type DictConstructor = {
686
- <K, V>(entries?: Iterable<[K, V]>): Map<K, V>;
687
- } & typeof dict$1;
688
- type SetConstructor = {
689
- <T>(iterable?: Iterable<T>): Set<T>;
690
- } & typeof set$1;
109
+ declare const sys: typeof sysModule;
110
+ declare const time: typeof timeModule;
111
+ declare const copy: typeof copyModule;
112
+ declare const base64: typeof base64Module;
113
+ declare const uuid: typeof uuidModule;
114
+ declare const hashlib: typeof hashlibModule;
115
+ declare const pathlib: typeof pathlibModule;
116
+ declare const glob: typeof globModule;
117
+ declare const shutil: typeof shutilModule;
118
+ declare const tempfile: typeof tempfileModule;
119
+ declare const subprocess: typeof subprocessModule;
120
+ declare const urllib: typeof urllibModule;
121
+ declare const logging: typeof loggingModule;
122
+ type ListConstructor = (<T>(iterable?: Iterable<T>) => T[]) & typeof list$1;
123
+ type DictConstructor = (<K, V>(entries?: Iterable<[K, V]>) => Map<K, V>) & typeof dict$1;
124
+ type SetConstructor = (<T>(iterable?: Iterable<T>) => Set<T>) & typeof set$1;
691
125
  declare const list: ListConstructor;
692
126
  declare const dict: DictConstructor;
693
127
  declare const set: SetConstructor;
@@ -737,4 +171,4 @@ declare const getattr: typeof getattr$1;
737
171
  declare const hasattr: typeof hasattr$1;
738
172
  declare const setattr: typeof setattr$1;
739
173
 
740
- export { abs, all, any, ascii, at, bin, bool, chr, collections, contains, datetime, dict, divMod, enumerate, filter, float, floorDiv, format, functools, getattr, hasattr, hex, input, int, is, isinstance, iter, itertools, json, len, list, map, math, max, min, mod, oct, ord, os, pow, random, range, re, repeat as repeatValue, repr, reversed, round, set, setattr, slice, sorted, sprintf, str, strFormat, string, sum, tuple, type, zip };
174
+ export { abs, all, any, ascii, at, base64, bin, bool, chr, collections, contains, copy, datetime, dict, divMod, enumerate, filter, float, floorDiv, format, functools, getattr, glob, hasattr, hashlib, hex, input, int, is, isinstance, iter, itertools, json, len, list, logging, map, math, max, min, mod, oct, ord, os, pathlib, random, range, re, repr, reversed, round, set, setattr, shutil, slice, sorted, sprintf, str, strFormat, string, subprocess, sum, sys, tempfile, time, tuple, type, urllib, uuid, zip };