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.
Files changed (150) hide show
  1. package/README.md +3 -1
  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-2YTO24B5.js +78 -0
  6. package/dist/chunk-3CLXPGAB.js +237 -0
  7. package/dist/{chunk-H76SKASU.js → chunk-3M3PB4RO.js} +4 -6
  8. package/dist/chunk-5OKGPZBQ.js +1106 -0
  9. package/dist/chunk-5VAHUJNC.js +348 -0
  10. package/dist/chunk-B5AUEOAH.js +193 -0
  11. package/dist/chunk-B5LQJODJ.js +37 -0
  12. package/dist/{chunk-HQ42WNKZ.js → chunk-BCMGGBWG.js} +2 -5
  13. package/dist/chunk-BCVIH2BN.js +175 -0
  14. package/dist/{chunk-EE7SK2GV.js → chunk-D35YI363.js} +15 -12
  15. package/dist/{chunk-7TH4FCVQ.js → chunk-ETBW6XNR.js} +3 -4
  16. package/dist/chunk-FCJ7E4OE.js +250 -0
  17. package/dist/chunk-HSTC277I.js +255 -0
  18. package/dist/chunk-IANXD4D4.js +250 -0
  19. package/dist/{chunk-4KYJT3DR.js → chunk-JAUU3HMH.js} +1 -2
  20. package/dist/chunk-JJKTRIVO.js +262 -0
  21. package/dist/chunk-KKHKTQNN.js +361 -0
  22. package/dist/chunk-KKJHGY4C.js +551 -0
  23. package/dist/chunk-LHPQS75Z.js +192 -0
  24. package/dist/{chunk-LWO6BIAD.js → chunk-LK2L2TFG.js} +5 -6
  25. package/dist/chunk-LLZFLQS6.js +280 -0
  26. package/dist/chunk-LTXTS7RP.js +154 -0
  27. package/dist/{chunk-4QG3772L.js → chunk-LWYBTWBZ.js} +2 -3
  28. package/dist/{chunk-6ZAJ37MR.js → chunk-MFKIEN7N.js} +3 -3
  29. package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
  30. package/dist/chunk-OZRS5PC4.js +312 -0
  31. package/dist/chunk-PWA3YQZU.js +346 -0
  32. package/dist/{chunk-6POEDI34.js → chunk-QKJBQKPY.js} +1 -2
  33. package/dist/chunk-RB6BYCIQ.js +141 -0
  34. package/dist/chunk-U4X5DEIP.js +188 -0
  35. package/dist/chunk-UGZ5OY5Z.js +165 -0
  36. package/dist/chunk-WTZSAITC.js +82 -0
  37. package/dist/{collections-CJur5Wg-.d.ts → collections-BthXtkEp.d.ts} +5 -1
  38. package/dist/collections.d.ts +1 -1
  39. package/dist/collections.js +2 -3
  40. package/dist/copy-6ZaZ__ge.d.ts +59 -0
  41. package/dist/copy.d.ts +1 -0
  42. package/dist/copy.js +9 -0
  43. package/dist/{datetime-Bpce8gG2.d.ts → datetime-BM_IjhTq.d.ts} +3 -1
  44. package/dist/datetime.d.ts +1 -1
  45. package/dist/datetime.js +2 -3
  46. package/dist/{functools-NrsZAqJk.d.ts → functools-uIa5g75p.d.ts} +3 -1
  47. package/dist/functools.d.ts +1 -1
  48. package/dist/functools.js +2 -3
  49. package/dist/glob.browser-B6d_YdV5.d.ts +50 -0
  50. package/dist/glob.browser.d.ts +1 -0
  51. package/dist/glob.browser.js +15 -0
  52. package/dist/glob.node-wn5ehtyM.d.ts +80 -0
  53. package/dist/glob.node.d.ts +1 -0
  54. package/dist/glob.node.js +15 -0
  55. package/dist/hashlib-vKP511NY.d.ts +205 -0
  56. package/dist/hashlib.d.ts +1 -0
  57. package/dist/hashlib.js +39 -0
  58. package/dist/index.browser.d.ts +172 -0
  59. package/dist/index.browser.js +304 -0
  60. package/dist/index.d.ts +61 -437
  61. package/dist/index.js +138 -1115
  62. package/dist/{itertools-Sjl1LB_0.d.ts → itertools-T0rwOk2j.d.ts} +2 -4
  63. package/dist/itertools.d.ts +1 -1
  64. package/dist/itertools.js +2 -3
  65. package/dist/{json-DAlvCadU.d.ts → json-DoWhX04T.d.ts} +1 -0
  66. package/dist/json.d.ts +1 -1
  67. package/dist/json.js +2 -3
  68. package/dist/logging.browser-Dux4L5kz.d.ts +185 -0
  69. package/dist/logging.browser.d.ts +1 -0
  70. package/dist/logging.browser.js +63 -0
  71. package/dist/logging.node-CH75bVdE.d.ts +185 -0
  72. package/dist/logging.node.d.ts +1 -0
  73. package/dist/logging.node.js +61 -0
  74. package/dist/{math-DwEGjjQ-.d.ts → math-D2NPMc-x.d.ts} +2 -1
  75. package/dist/math.d.ts +1 -1
  76. package/dist/math.js +2 -3
  77. package/dist/{os-C6Nt7Ijx.d.ts → os.browser-krjSx5kF.d.ts} +32 -54
  78. package/dist/os.browser.d.ts +2 -0
  79. package/dist/{os.js → os.browser.js} +41 -16
  80. package/dist/os.node-CQjch8Ht.d.ts +124 -0
  81. package/dist/os.node.d.ts +2 -0
  82. package/dist/os.node.js +83 -0
  83. package/dist/os.shared-C3x70nhO.d.ts +59 -0
  84. package/dist/pathlib.browser-NC7kKQYe.d.ts +91 -0
  85. package/dist/pathlib.browser.d.ts +1 -0
  86. package/dist/pathlib.browser.js +17 -0
  87. package/dist/pathlib.node-CY3yUFdT.d.ts +331 -0
  88. package/dist/pathlib.node.d.ts +2 -0
  89. package/dist/pathlib.node.js +17 -0
  90. package/dist/{random-BJv_rSpL.d.ts → random-DcS5jtEs.d.ts} +3 -5
  91. package/dist/random.d.ts +1 -1
  92. package/dist/random.js +2 -3
  93. package/dist/{re-B1CHCgyr.d.ts → re-Bo-IOqov.d.ts} +3 -7
  94. package/dist/re.d.ts +1 -1
  95. package/dist/re.js +2 -3
  96. package/dist/set-JQbLAq8B.d.ts +592 -0
  97. package/dist/shutil.browser-Ck5oWhnP.d.ts +113 -0
  98. package/dist/shutil.browser.d.ts +1 -0
  99. package/dist/shutil.browser.js +33 -0
  100. package/dist/shutil.node-C9kwvhAf.d.ts +160 -0
  101. package/dist/shutil.node.d.ts +2 -0
  102. package/dist/shutil.node.js +33 -0
  103. package/dist/string.d.ts +3 -1
  104. package/dist/string.js +2 -3
  105. package/dist/subprocess-CZVYzQ3V.d.ts +214 -0
  106. package/dist/subprocess.d.ts +1 -0
  107. package/dist/subprocess.js +29 -0
  108. package/dist/sys-IL8LgI_W.d.ts +212 -0
  109. package/dist/sys.d.ts +1 -0
  110. package/dist/sys.js +51 -0
  111. package/dist/tempfile.browser-DciOKfNm.d.ts +78 -0
  112. package/dist/tempfile.browser.d.ts +1 -0
  113. package/dist/tempfile.browser.js +19 -0
  114. package/dist/tempfile.node-bVMY60Cu.d.ts +195 -0
  115. package/dist/tempfile.node.d.ts +2 -0
  116. package/dist/tempfile.node.js +23 -0
  117. package/dist/time-CcYhdiSu.d.ts +245 -0
  118. package/dist/time.d.ts +1 -0
  119. package/dist/time.js +49 -0
  120. package/dist/urllib-DJtkj-0f.d.ts +198 -0
  121. package/dist/urllib.d.ts +1 -0
  122. package/dist/urllib.js +37 -0
  123. package/dist/uuid-C0ypmn56.d.ts +160 -0
  124. package/dist/uuid.d.ts +1 -0
  125. package/dist/uuid.js +23 -0
  126. package/package.json +127 -5
  127. package/dist/chunk-4KYJT3DR.js.map +0 -1
  128. package/dist/chunk-4QG3772L.js.map +0 -1
  129. package/dist/chunk-6POEDI34.js.map +0 -1
  130. package/dist/chunk-6ZAJ37MR.js.map +0 -1
  131. package/dist/chunk-7TH4FCVQ.js.map +0 -1
  132. package/dist/chunk-CXKGPD5D.js +0 -313
  133. package/dist/chunk-CXKGPD5D.js.map +0 -1
  134. package/dist/chunk-EE7SK2GV.js.map +0 -1
  135. package/dist/chunk-H76SKASU.js.map +0 -1
  136. package/dist/chunk-HQ42WNKZ.js.map +0 -1
  137. package/dist/chunk-LWO6BIAD.js.map +0 -1
  138. package/dist/chunk-PZ5AY32C.js.map +0 -1
  139. package/dist/collections.js.map +0 -1
  140. package/dist/datetime.js.map +0 -1
  141. package/dist/functools.js.map +0 -1
  142. package/dist/index.js.map +0 -1
  143. package/dist/itertools.js.map +0 -1
  144. package/dist/json.js.map +0 -1
  145. package/dist/math.js.map +0 -1
  146. package/dist/os.d.ts +0 -1
  147. package/dist/os.js.map +0 -1
  148. package/dist/random.js.map +0 -1
  149. package/dist/re.js.map +0 -1
  150. package/dist/string.js.map +0 -1
@@ -2,12 +2,10 @@
2
2
  * Python itertools module for TypeScript
3
3
  *
4
4
  * Provides iterator building blocks inspired by Python's itertools module.
5
+ * Includes functions for permutations, combinations, grouping, and chaining iterables.
5
6
  *
6
7
  * @see {@link https://docs.python.org/3/library/itertools.html | Python itertools documentation}
7
- *
8
- * Design Decision (ADR-0008):
9
- * - Most functions return eager arrays for better debugging and familiarity
10
- * - Only infinite sequences (cycle, repeat without count) use generators
8
+ * @module
11
9
  */
12
10
  /**
13
11
  * Chain multiple iterables together into a single array
@@ -1 +1 @@
1
- export { j as accumulate, c as chain, s as chunk, a as combinations, q as combinationsWithReplacement, g as compress, l as count, d as cycle, f as dropWhile, h as filterFalse, k as groupby, e as islice, n as pairwise, u as partition, p as permutations, b as product, o as productRepeat, r as repeat, t as takeWhile, m as tee, z as zipLongest } from './itertools-Sjl1LB_0.js';
1
+ export { j as accumulate, c as chain, s as chunk, a as combinations, q as combinationsWithReplacement, g as compress, l as count, d as cycle, f as dropWhile, h as filterFalse, k as groupby, e as islice, n as pairwise, u as partition, p as permutations, b as product, o as productRepeat, r as repeat, t as takeWhile, m as tee, z as zipLongest } from './itertools-T0rwOk2j.js';
package/dist/itertools.js CHANGED
@@ -20,8 +20,8 @@ import {
20
20
  takeWhile,
21
21
  tee,
22
22
  zipLongest
23
- } from "./chunk-HQ42WNKZ.js";
24
- import "./chunk-PZ5AY32C.js";
23
+ } from "./chunk-BCMGGBWG.js";
24
+ import "./chunk-MLKGABMK.js";
25
25
  export {
26
26
  accumulate,
27
27
  chain,
@@ -45,4 +45,3 @@ export {
45
45
  tee,
46
46
  zipLongest
47
47
  };
48
- //# sourceMappingURL=itertools.js.map
@@ -5,6 +5,7 @@
5
5
  * Maps directly to JavaScript's JSON object with Python-compatible options.
6
6
  *
7
7
  * @see {@link https://docs.python.org/3/library/json.html | Python json documentation}
8
+ * @module
8
9
  */
9
10
  type JsonValue = string | number | boolean | null | JsonValue[] | {
10
11
  [key: string]: JsonValue;
package/dist/json.d.ts CHANGED
@@ -1 +1 @@
1
- export { a as dump, d as dumps, b as load, l as loads } from './json-DAlvCadU.js';
1
+ export { a as dump, d as dumps, b as load, l as loads } from './json-DoWhX04T.js';
package/dist/json.js CHANGED
@@ -3,12 +3,11 @@ import {
3
3
  dumps,
4
4
  load,
5
5
  loads
6
- } from "./chunk-4KYJT3DR.js";
7
- import "./chunk-PZ5AY32C.js";
6
+ } from "./chunk-JAUU3HMH.js";
7
+ import "./chunk-MLKGABMK.js";
8
8
  export {
9
9
  dump,
10
10
  dumps,
11
11
  load,
12
12
  loads
13
13
  };
14
- //# sourceMappingURL=json.js.map
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Python logging module for TypeScript - Browser version
3
+ *
4
+ * Provides a flexible event logging system.
5
+ * FileHandler falls back to console output in browser environment.
6
+ *
7
+ * @see {@link https://docs.python.org/3/library/logging.html | Python logging documentation}
8
+ * @module
9
+ */
10
+ /**
11
+ * Logging levels.
12
+ */
13
+ declare const CRITICAL = 50;
14
+ declare const FATAL = 50;
15
+ declare const ERROR = 40;
16
+ declare const WARNING = 30;
17
+ declare const WARN = 30;
18
+ declare const INFO = 20;
19
+ declare const DEBUG = 10;
20
+ declare const NOTSET = 0;
21
+ /**
22
+ * Map of level names to values.
23
+ */
24
+ declare const levelNames: Record<number, string>;
25
+ /**
26
+ * Get the level value from a level name.
27
+ */
28
+ declare function getLevelName(level: number | string): string | number;
29
+ /**
30
+ * Log record containing information about a logging event.
31
+ */
32
+ interface LogRecord {
33
+ name: string;
34
+ levelno: number;
35
+ levelname: string;
36
+ msg: string;
37
+ args: unknown[];
38
+ created: number;
39
+ filename?: string;
40
+ lineno?: number;
41
+ funcName?: string;
42
+ exc_info?: Error;
43
+ }
44
+ /**
45
+ * Handler base class for processing log records.
46
+ */
47
+ declare abstract class Handler {
48
+ level: number;
49
+ formatter: Formatter | null;
50
+ setLevel(level: number): void;
51
+ setFormatter(formatter: Formatter): void;
52
+ format(record: LogRecord): string;
53
+ abstract emit(record: LogRecord): void;
54
+ handle(record: LogRecord): void;
55
+ }
56
+ /**
57
+ * Handler that writes to console.
58
+ */
59
+ declare class StreamHandler extends Handler {
60
+ emit(record: LogRecord): void;
61
+ }
62
+ /**
63
+ * Handler that writes to a file.
64
+ * Browser version: falls back to console output with filename prefix.
65
+ */
66
+ declare class FileHandler extends Handler {
67
+ private readonly filename;
68
+ readonly mode: string;
69
+ constructor(filename: string, mode?: string);
70
+ emit(record: LogRecord): void;
71
+ }
72
+ /**
73
+ * Formatter for log records.
74
+ */
75
+ declare class Formatter {
76
+ private readonly fmt;
77
+ private readonly datefmt;
78
+ constructor(fmt?: string, datefmt?: string);
79
+ formatTime(record: LogRecord): string;
80
+ format(record: LogRecord): string;
81
+ }
82
+ /**
83
+ * Logger class for logging events.
84
+ */
85
+ declare class Logger {
86
+ readonly name: string;
87
+ level: number;
88
+ handlers: Handler[];
89
+ parent: Logger | null;
90
+ propagate: boolean;
91
+ constructor(name: string);
92
+ setLevel(level: number): void;
93
+ addHandler(handler: Handler): void;
94
+ removeHandler(handler: Handler): void;
95
+ getEffectiveLevel(): number;
96
+ isEnabledFor(level: number): boolean;
97
+ private makeRecord;
98
+ private handle;
99
+ log(level: number, msg: string, ...args: unknown[]): void;
100
+ debug(msg: string, ...args: unknown[]): void;
101
+ info(msg: string, ...args: unknown[]): void;
102
+ warning(msg: string, ...args: unknown[]): void;
103
+ warn(msg: string, ...args: unknown[]): void;
104
+ error(msg: string, ...args: unknown[]): void;
105
+ critical(msg: string, ...args: unknown[]): void;
106
+ fatal(msg: string, ...args: unknown[]): void;
107
+ exception(msg: string, ...args: unknown[]): void;
108
+ }
109
+ /**
110
+ * Get a logger with the specified name.
111
+ */
112
+ declare function getLogger(name?: string): Logger;
113
+ /**
114
+ * Configure the root logger.
115
+ */
116
+ declare function basicConfig(options?: {
117
+ level?: number;
118
+ format?: string;
119
+ datefmt?: string;
120
+ filename?: string;
121
+ filemode?: string;
122
+ handlers?: Handler[];
123
+ }): void;
124
+ declare function debug(msg: string, ...args: unknown[]): void;
125
+ declare function info(msg: string, ...args: unknown[]): void;
126
+ declare function warning(msg: string, ...args: unknown[]): void;
127
+ declare function warn(msg: string, ...args: unknown[]): void;
128
+ declare function error(msg: string, ...args: unknown[]): void;
129
+ declare function critical(msg: string, ...args: unknown[]): void;
130
+ declare function fatal(msg: string, ...args: unknown[]): void;
131
+ declare function exception(msg: string, ...args: unknown[]): void;
132
+ declare function log(level: number, msg: string, ...args: unknown[]): void;
133
+ /**
134
+ * Set the root logger level.
135
+ */
136
+ declare function setLevel(level: number): void;
137
+ /**
138
+ * Disable all logging calls of level below the specified level.
139
+ */
140
+ declare function disable(level?: number): void;
141
+ /**
142
+ * Shut down the logging system.
143
+ */
144
+ declare function shutdown(): void;
145
+
146
+ declare const loggingModule_CRITICAL: typeof CRITICAL;
147
+ declare const loggingModule_DEBUG: typeof DEBUG;
148
+ declare const loggingModule_ERROR: typeof ERROR;
149
+ declare const loggingModule_FATAL: typeof FATAL;
150
+ type loggingModule_FileHandler = FileHandler;
151
+ declare const loggingModule_FileHandler: typeof FileHandler;
152
+ type loggingModule_Formatter = Formatter;
153
+ declare const loggingModule_Formatter: typeof Formatter;
154
+ type loggingModule_Handler = Handler;
155
+ declare const loggingModule_Handler: typeof Handler;
156
+ declare const loggingModule_INFO: typeof INFO;
157
+ type loggingModule_LogRecord = LogRecord;
158
+ type loggingModule_Logger = Logger;
159
+ declare const loggingModule_Logger: typeof Logger;
160
+ declare const loggingModule_NOTSET: typeof NOTSET;
161
+ type loggingModule_StreamHandler = StreamHandler;
162
+ declare const loggingModule_StreamHandler: typeof StreamHandler;
163
+ declare const loggingModule_WARN: typeof WARN;
164
+ declare const loggingModule_WARNING: typeof WARNING;
165
+ declare const loggingModule_basicConfig: typeof basicConfig;
166
+ declare const loggingModule_critical: typeof critical;
167
+ declare const loggingModule_debug: typeof debug;
168
+ declare const loggingModule_disable: typeof disable;
169
+ declare const loggingModule_error: typeof error;
170
+ declare const loggingModule_exception: typeof exception;
171
+ declare const loggingModule_fatal: typeof fatal;
172
+ declare const loggingModule_getLevelName: typeof getLevelName;
173
+ declare const loggingModule_getLogger: typeof getLogger;
174
+ declare const loggingModule_info: typeof info;
175
+ declare const loggingModule_levelNames: typeof levelNames;
176
+ declare const loggingModule_log: typeof log;
177
+ declare const loggingModule_setLevel: typeof setLevel;
178
+ declare const loggingModule_shutdown: typeof shutdown;
179
+ declare const loggingModule_warn: typeof warn;
180
+ declare const loggingModule_warning: typeof warning;
181
+ declare namespace loggingModule {
182
+ export { loggingModule_CRITICAL as CRITICAL, loggingModule_DEBUG as DEBUG, loggingModule_ERROR as ERROR, loggingModule_FATAL as FATAL, loggingModule_FileHandler as FileHandler, loggingModule_Formatter as Formatter, loggingModule_Handler as Handler, loggingModule_INFO as INFO, type loggingModule_LogRecord as LogRecord, loggingModule_Logger as Logger, loggingModule_NOTSET as NOTSET, loggingModule_StreamHandler as StreamHandler, loggingModule_WARN as WARN, loggingModule_WARNING as WARNING, loggingModule_basicConfig as basicConfig, loggingModule_critical as critical, loggingModule_debug as debug, loggingModule_disable as disable, loggingModule_error as error, loggingModule_exception as exception, loggingModule_fatal as fatal, loggingModule_getLevelName as getLevelName, loggingModule_getLogger as getLogger, loggingModule_info as info, loggingModule_levelNames as levelNames, loggingModule_log as log, loggingModule_setLevel as setLevel, loggingModule_shutdown as shutdown, loggingModule_warn as warn, loggingModule_warning as warning };
183
+ }
184
+
185
+ export { CRITICAL as C, DEBUG as D, ERROR as E, FATAL as F, Handler as H, INFO as I, type LogRecord as L, NOTSET as N, StreamHandler as S, WARNING as W, WARN as a, levelNames as b, FileHandler as c, Formatter as d, Logger as e, getLogger as f, getLevelName as g, basicConfig as h, debug as i, info as j, warn as k, loggingModule as l, error as m, critical as n, fatal as o, exception as p, log as q, disable as r, setLevel as s, shutdown as t, warning as w };
@@ -0,0 +1 @@
1
+ export { C as CRITICAL, D as DEBUG, E as ERROR, F as FATAL, c as FileHandler, d as Formatter, H as Handler, I as INFO, L as LogRecord, e as Logger, N as NOTSET, S as StreamHandler, a as WARN, W as WARNING, h as basicConfig, n as critical, i as debug, r as disable, m as error, p as exception, o as fatal, g as getLevelName, f as getLogger, j as info, b as levelNames, q as log, s as setLevel, t as shutdown, k as warn, w as warning } from './logging.browser-Dux4L5kz.js';
@@ -0,0 +1,63 @@
1
+ import {
2
+ CRITICAL,
3
+ DEBUG,
4
+ ERROR,
5
+ FATAL,
6
+ FileHandler,
7
+ Formatter,
8
+ Handler,
9
+ INFO,
10
+ Logger,
11
+ NOTSET,
12
+ StreamHandler,
13
+ WARN,
14
+ WARNING,
15
+ basicConfig,
16
+ critical,
17
+ debug,
18
+ disable,
19
+ error,
20
+ exception,
21
+ fatal,
22
+ getLevelName,
23
+ getLogger,
24
+ info,
25
+ levelNames,
26
+ log,
27
+ setLevel,
28
+ shutdown,
29
+ warn,
30
+ warning
31
+ } from "./chunk-5VAHUJNC.js";
32
+ import "./chunk-MLKGABMK.js";
33
+ export {
34
+ CRITICAL,
35
+ DEBUG,
36
+ ERROR,
37
+ FATAL,
38
+ FileHandler,
39
+ Formatter,
40
+ Handler,
41
+ INFO,
42
+ Logger,
43
+ NOTSET,
44
+ StreamHandler,
45
+ WARN,
46
+ WARNING,
47
+ basicConfig,
48
+ critical,
49
+ debug,
50
+ disable,
51
+ error,
52
+ exception,
53
+ fatal,
54
+ getLevelName,
55
+ getLogger,
56
+ info,
57
+ levelNames,
58
+ log,
59
+ setLevel,
60
+ shutdown,
61
+ warn,
62
+ warning
63
+ };
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Python logging module for TypeScript
3
+ *
4
+ * Provides a flexible event logging system.
5
+ *
6
+ * @see {@link https://docs.python.org/3/library/logging.html | Python logging documentation}
7
+ * @module
8
+ */
9
+ /**
10
+ * Logging levels.
11
+ */
12
+ declare const CRITICAL = 50;
13
+ declare const FATAL = 50;
14
+ declare const ERROR = 40;
15
+ declare const WARNING = 30;
16
+ declare const WARN = 30;
17
+ declare const INFO = 20;
18
+ declare const DEBUG = 10;
19
+ declare const NOTSET = 0;
20
+ /**
21
+ * Map of level names to values.
22
+ */
23
+ declare const levelNames: Record<number, string>;
24
+ /**
25
+ * Get the level value from a level name.
26
+ */
27
+ declare function getLevelName(level: number | string): string | number;
28
+ /**
29
+ * Log record containing information about a logging event.
30
+ */
31
+ interface LogRecord {
32
+ name: string;
33
+ levelno: number;
34
+ levelname: string;
35
+ msg: string;
36
+ args: unknown[];
37
+ created: number;
38
+ filename?: string;
39
+ lineno?: number;
40
+ funcName?: string;
41
+ exc_info?: Error;
42
+ }
43
+ /**
44
+ * Handler base class for processing log records.
45
+ */
46
+ declare abstract class Handler {
47
+ level: number;
48
+ formatter: Formatter | null;
49
+ setLevel(level: number): void;
50
+ setFormatter(formatter: Formatter): void;
51
+ format(record: LogRecord): string;
52
+ abstract emit(record: LogRecord): void;
53
+ handle(record: LogRecord): void;
54
+ }
55
+ /**
56
+ * Handler that writes to console.
57
+ */
58
+ declare class StreamHandler extends Handler {
59
+ emit(record: LogRecord): void;
60
+ }
61
+ /**
62
+ * Handler that writes to a file (Node.js only).
63
+ */
64
+ declare class FileHandler extends Handler {
65
+ private readonly filename;
66
+ readonly mode: string;
67
+ constructor(filename: string, mode?: string);
68
+ emit(record: LogRecord): void;
69
+ }
70
+ /**
71
+ * Formatter for log records.
72
+ */
73
+ declare class Formatter {
74
+ private readonly fmt;
75
+ private readonly datefmt;
76
+ constructor(fmt?: string, datefmt?: string);
77
+ formatTime(record: LogRecord): string;
78
+ format(record: LogRecord): string;
79
+ }
80
+ /**
81
+ * Logger class for logging events.
82
+ */
83
+ declare class Logger {
84
+ readonly name: string;
85
+ level: number;
86
+ handlers: Handler[];
87
+ parent: Logger | null;
88
+ propagate: boolean;
89
+ constructor(name: string);
90
+ setLevel(level: number): void;
91
+ addHandler(handler: Handler): void;
92
+ removeHandler(handler: Handler): void;
93
+ getEffectiveLevel(): number;
94
+ isEnabledFor(level: number): boolean;
95
+ private makeRecord;
96
+ private handle;
97
+ log(level: number, msg: string, ...args: unknown[]): void;
98
+ debug(msg: string, ...args: unknown[]): void;
99
+ info(msg: string, ...args: unknown[]): void;
100
+ warning(msg: string, ...args: unknown[]): void;
101
+ warn(msg: string, ...args: unknown[]): void;
102
+ error(msg: string, ...args: unknown[]): void;
103
+ critical(msg: string, ...args: unknown[]): void;
104
+ fatal(msg: string, ...args: unknown[]): void;
105
+ exception(msg: string, ...args: unknown[]): void;
106
+ }
107
+ /**
108
+ * Get a logger with the specified name.
109
+ *
110
+ * @param name - Logger name (default: root logger)
111
+ * @returns Logger instance
112
+ */
113
+ declare function getLogger(name?: string): Logger;
114
+ /**
115
+ * Configure the root logger.
116
+ *
117
+ * @param options - Configuration options
118
+ */
119
+ declare function basicConfig(options?: {
120
+ level?: number;
121
+ format?: string;
122
+ datefmt?: string;
123
+ filename?: string;
124
+ filemode?: string;
125
+ handlers?: Handler[];
126
+ }): void;
127
+ declare function debug(msg: string, ...args: unknown[]): void;
128
+ declare function info(msg: string, ...args: unknown[]): void;
129
+ declare function warning(msg: string, ...args: unknown[]): void;
130
+ declare function warn(msg: string, ...args: unknown[]): void;
131
+ declare function error(msg: string, ...args: unknown[]): void;
132
+ declare function critical(msg: string, ...args: unknown[]): void;
133
+ declare function fatal(msg: string, ...args: unknown[]): void;
134
+ declare function exception(msg: string, ...args: unknown[]): void;
135
+ declare function log(level: number, msg: string, ...args: unknown[]): void;
136
+ /**
137
+ * Disable all logging calls of level below the specified level.
138
+ *
139
+ * @param level - Minimum level to allow
140
+ */
141
+ declare function disable(level?: number): void;
142
+ /**
143
+ * Shut down the logging system.
144
+ */
145
+ declare function shutdown(): void;
146
+
147
+ declare const loggingModule_CRITICAL: typeof CRITICAL;
148
+ declare const loggingModule_DEBUG: typeof DEBUG;
149
+ declare const loggingModule_ERROR: typeof ERROR;
150
+ declare const loggingModule_FATAL: typeof FATAL;
151
+ type loggingModule_FileHandler = FileHandler;
152
+ declare const loggingModule_FileHandler: typeof FileHandler;
153
+ type loggingModule_Formatter = Formatter;
154
+ declare const loggingModule_Formatter: typeof Formatter;
155
+ type loggingModule_Handler = Handler;
156
+ declare const loggingModule_Handler: typeof Handler;
157
+ declare const loggingModule_INFO: typeof INFO;
158
+ type loggingModule_LogRecord = LogRecord;
159
+ type loggingModule_Logger = Logger;
160
+ declare const loggingModule_Logger: typeof Logger;
161
+ declare const loggingModule_NOTSET: typeof NOTSET;
162
+ type loggingModule_StreamHandler = StreamHandler;
163
+ declare const loggingModule_StreamHandler: typeof StreamHandler;
164
+ declare const loggingModule_WARN: typeof WARN;
165
+ declare const loggingModule_WARNING: typeof WARNING;
166
+ declare const loggingModule_basicConfig: typeof basicConfig;
167
+ declare const loggingModule_critical: typeof critical;
168
+ declare const loggingModule_debug: typeof debug;
169
+ declare const loggingModule_disable: typeof disable;
170
+ declare const loggingModule_error: typeof error;
171
+ declare const loggingModule_exception: typeof exception;
172
+ declare const loggingModule_fatal: typeof fatal;
173
+ declare const loggingModule_getLevelName: typeof getLevelName;
174
+ declare const loggingModule_getLogger: typeof getLogger;
175
+ declare const loggingModule_info: typeof info;
176
+ declare const loggingModule_levelNames: typeof levelNames;
177
+ declare const loggingModule_log: typeof log;
178
+ declare const loggingModule_shutdown: typeof shutdown;
179
+ declare const loggingModule_warn: typeof warn;
180
+ declare const loggingModule_warning: typeof warning;
181
+ declare namespace loggingModule {
182
+ export { loggingModule_CRITICAL as CRITICAL, loggingModule_DEBUG as DEBUG, loggingModule_ERROR as ERROR, loggingModule_FATAL as FATAL, loggingModule_FileHandler as FileHandler, loggingModule_Formatter as Formatter, loggingModule_Handler as Handler, loggingModule_INFO as INFO, type loggingModule_LogRecord as LogRecord, loggingModule_Logger as Logger, loggingModule_NOTSET as NOTSET, loggingModule_StreamHandler as StreamHandler, loggingModule_WARN as WARN, loggingModule_WARNING as WARNING, loggingModule_basicConfig as basicConfig, loggingModule_critical as critical, loggingModule_debug as debug, loggingModule_disable as disable, loggingModule_error as error, loggingModule_exception as exception, loggingModule_fatal as fatal, loggingModule_getLevelName as getLevelName, loggingModule_getLogger as getLogger, loggingModule_info as info, loggingModule_levelNames as levelNames, loggingModule_log as log, loggingModule_shutdown as shutdown, loggingModule_warn as warn, loggingModule_warning as warning };
183
+ }
184
+
185
+ export { CRITICAL as C, DEBUG as D, ERROR as E, FATAL as F, Handler as H, INFO as I, type LogRecord as L, NOTSET as N, StreamHandler as S, WARNING as W, WARN as a, levelNames as b, FileHandler as c, Formatter as d, Logger as e, getLogger as f, getLevelName as g, basicConfig as h, debug as i, info as j, warn as k, loggingModule as l, error as m, critical as n, fatal as o, exception as p, log as q, disable as r, shutdown as s, warning as w };
@@ -0,0 +1 @@
1
+ export { C as CRITICAL, D as DEBUG, E as ERROR, F as FATAL, c as FileHandler, d as Formatter, H as Handler, I as INFO, L as LogRecord, e as Logger, N as NOTSET, S as StreamHandler, a as WARN, W as WARNING, h as basicConfig, n as critical, i as debug, r as disable, m as error, p as exception, o as fatal, g as getLevelName, f as getLogger, j as info, b as levelNames, q as log, s as shutdown, k as warn, w as warning } from './logging.node-CH75bVdE.js';
@@ -0,0 +1,61 @@
1
+ import {
2
+ CRITICAL,
3
+ DEBUG,
4
+ ERROR,
5
+ FATAL,
6
+ FileHandler,
7
+ Formatter,
8
+ Handler,
9
+ INFO,
10
+ Logger,
11
+ NOTSET,
12
+ StreamHandler,
13
+ WARN,
14
+ WARNING,
15
+ basicConfig,
16
+ critical,
17
+ debug,
18
+ disable,
19
+ error,
20
+ exception,
21
+ fatal,
22
+ getLevelName,
23
+ getLogger,
24
+ info,
25
+ levelNames,
26
+ log,
27
+ shutdown,
28
+ warn,
29
+ warning
30
+ } from "./chunk-PWA3YQZU.js";
31
+ import "./chunk-MLKGABMK.js";
32
+ export {
33
+ CRITICAL,
34
+ DEBUG,
35
+ ERROR,
36
+ FATAL,
37
+ FileHandler,
38
+ Formatter,
39
+ Handler,
40
+ INFO,
41
+ Logger,
42
+ NOTSET,
43
+ StreamHandler,
44
+ WARN,
45
+ WARNING,
46
+ basicConfig,
47
+ critical,
48
+ debug,
49
+ disable,
50
+ error,
51
+ exception,
52
+ fatal,
53
+ getLevelName,
54
+ getLogger,
55
+ info,
56
+ levelNames,
57
+ log,
58
+ shutdown,
59
+ warn,
60
+ warning
61
+ };
@@ -2,9 +2,10 @@
2
2
  * Python math module for TypeScript
3
3
  *
4
4
  * Provides mathematical functions and constants matching Python's math module.
5
- * Most functions map directly to JavaScript's Math object.
5
+ * Includes trigonometric, logarithmic, and special functions like factorial and gcd.
6
6
  *
7
7
  * @see {@link https://docs.python.org/3/library/math.html | Python math documentation}
8
+ * @module
8
9
  */
9
10
  /** Mathematical constant π = 3.141592... */
10
11
  declare const pi: number;
package/dist/math.d.ts CHANGED
@@ -1 +1 @@
1
- export { G as acos, N as acosh, F as asin, M as asinh, H as atan, I as atan2, O as atanh, A as cbrt, c as ceil, d as copysign, D as cos, K as cosh, P as degrees, e, r as exp, s as expm1, b as fabs, R as factorial, f as floor, S as fsum, h as gcd, B as hypot, i as inf, q as isclose, j as isfinite, k as isinf, o as isnan, l as lcm, u as log, x as log10, v as log1p, w as log2, g as modf, n as nan, p as pi, y as pow, T as prod, Q as radians, C as sin, J as sinh, z as sqrt, E as tan, L as tanh, t as tau, a as trunc } from './math-DwEGjjQ-.js';
1
+ export { G as acos, N as acosh, F as asin, M as asinh, H as atan, I as atan2, O as atanh, A as cbrt, c as ceil, d as copysign, D as cos, K as cosh, P as degrees, e, r as exp, s as expm1, b as fabs, R as factorial, f as floor, S as fsum, h as gcd, B as hypot, i as inf, q as isclose, j as isfinite, k as isinf, o as isnan, l as lcm, u as log, x as log10, v as log1p, w as log2, g as modf, n as nan, p as pi, y as pow, T as prod, Q as radians, C as sin, J as sinh, z as sqrt, E as tan, L as tanh, t as tau, a as trunc } from './math-D2NPMc-x.js';
package/dist/math.js CHANGED
@@ -44,8 +44,8 @@ import {
44
44
  tanh,
45
45
  tau,
46
46
  trunc
47
- } from "./chunk-6POEDI34.js";
48
- import "./chunk-PZ5AY32C.js";
47
+ } from "./chunk-QKJBQKPY.js";
48
+ import "./chunk-MLKGABMK.js";
49
49
  export {
50
50
  acos,
51
51
  acosh,
@@ -93,4 +93,3 @@ export {
93
93
  tau,
94
94
  trunc
95
95
  };
96
- //# sourceMappingURL=math.js.map