pythonlib 0.1.0 → 0.2.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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -138
  3. package/dist/{chunk-P3SGIF72.js → chunk-4KYJT3DR.js} +8 -6
  4. package/dist/chunk-4KYJT3DR.js.map +1 -0
  5. package/dist/{chunk-3CSEXTA7.js → chunk-4QG3772L.js} +53 -53
  6. package/dist/chunk-4QG3772L.js.map +1 -0
  7. package/dist/{chunk-IVYYI2VR.js → chunk-6POEDI34.js} +1 -1
  8. package/dist/chunk-6POEDI34.js.map +1 -0
  9. package/dist/{chunk-UFMTN4T4.js → chunk-6ZAJ37MR.js} +6 -5
  10. package/dist/chunk-6ZAJ37MR.js.map +1 -0
  11. package/dist/{chunk-V63LKSA3.js → chunk-7TH4FCVQ.js} +24 -24
  12. package/dist/chunk-7TH4FCVQ.js.map +1 -0
  13. package/dist/{chunk-TJFGYXBJ.js → chunk-CXKGPD5D.js} +64 -61
  14. package/dist/chunk-CXKGPD5D.js.map +1 -0
  15. package/dist/{chunk-OMQNGE6T.js → chunk-EE7SK2GV.js} +33 -27
  16. package/dist/chunk-EE7SK2GV.js.map +1 -0
  17. package/dist/{chunk-WAONBJE5.js → chunk-H76SKASU.js} +36 -36
  18. package/dist/chunk-H76SKASU.js.map +1 -0
  19. package/dist/{chunk-TOI6IG3T.js → chunk-HQ42WNKZ.js} +43 -16
  20. package/dist/chunk-HQ42WNKZ.js.map +1 -0
  21. package/dist/{chunk-HA5Y7PKO.js → chunk-LWO6BIAD.js} +36 -35
  22. package/dist/chunk-LWO6BIAD.js.map +1 -0
  23. package/dist/{collections-xN9Gi0TA.d.ts → collections-CJur5Wg-.d.ts} +5 -3
  24. package/dist/collections.d.ts +1 -1
  25. package/dist/collections.js +1 -1
  26. package/dist/{datetime-DRwFAiGV.d.ts → datetime-Bpce8gG2.d.ts} +17 -15
  27. package/dist/datetime.d.ts +1 -1
  28. package/dist/datetime.js +1 -1
  29. package/dist/{functools-St5GqpKG.d.ts → functools-NrsZAqJk.d.ts} +42 -26
  30. package/dist/functools.d.ts +1 -1
  31. package/dist/functools.js +19 -17
  32. package/dist/index.d.ts +56 -158
  33. package/dist/index.js +47 -137
  34. package/dist/index.js.map +1 -1
  35. package/dist/{itertools-Bj8XivI6.d.ts → itertools-Sjl1LB_0.d.ts} +35 -17
  36. package/dist/itertools.d.ts +1 -1
  37. package/dist/itertools.js +15 -11
  38. package/dist/{json-Xpk0kwSd.d.ts → json-DAlvCadU.d.ts} +7 -5
  39. package/dist/json.d.ts +1 -1
  40. package/dist/json.js +1 -1
  41. package/dist/{math-BrT4Aw3E.d.ts → math-DwEGjjQ-.d.ts} +2 -0
  42. package/dist/math.d.ts +1 -1
  43. package/dist/math.js +1 -1
  44. package/dist/{os-FRSJbEUH.d.ts → os-C6Nt7Ijx.d.ts} +45 -42
  45. package/dist/os.d.ts +1 -1
  46. package/dist/os.js +23 -23
  47. package/dist/{random-D5S5iSV3.d.ts → random-BJv_rSpL.d.ts} +24 -22
  48. package/dist/random.d.ts +1 -1
  49. package/dist/random.js +21 -21
  50. package/dist/{re-DSxiURqN.d.ts → re-B1CHCgyr.d.ts} +17 -15
  51. package/dist/re.d.ts +1 -1
  52. package/dist/re.js +7 -7
  53. package/dist/string.d.ts +51 -48
  54. package/dist/string.js +13 -13
  55. package/package.json +30 -11
  56. package/dist/chunk-3CSEXTA7.js.map +0 -1
  57. package/dist/chunk-HA5Y7PKO.js.map +0 -1
  58. package/dist/chunk-IVYYI2VR.js.map +0 -1
  59. package/dist/chunk-OMQNGE6T.js.map +0 -1
  60. package/dist/chunk-P3SGIF72.js.map +0 -1
  61. package/dist/chunk-TJFGYXBJ.js.map +0 -1
  62. package/dist/chunk-TOI6IG3T.js.map +0 -1
  63. package/dist/chunk-UFMTN4T4.js.map +0 -1
  64. package/dist/chunk-V63LKSA3.js.map +0 -1
  65. package/dist/chunk-WAONBJE5.js.map +0 -1
package/dist/functools.js CHANGED
@@ -1,32 +1,34 @@
1
1
  import {
2
- attrgetter,
2
+ attrGetter,
3
3
  cache,
4
- cmp_to_key,
4
+ cmpToKey,
5
5
  identity,
6
- itemgetter,
7
- lru_cache,
8
- methodcaller,
6
+ itemGetter,
7
+ lruCache,
8
+ methodCaller,
9
9
  partial,
10
- partialmethod,
10
+ partialMethod,
11
+ pipe,
11
12
  reduce,
12
- singledispatch,
13
- total_ordering,
13
+ singleDispatch,
14
+ totalOrdering,
14
15
  wraps
15
- } from "./chunk-OMQNGE6T.js";
16
+ } from "./chunk-EE7SK2GV.js";
16
17
  import "./chunk-PZ5AY32C.js";
17
18
  export {
18
- attrgetter,
19
+ attrGetter,
19
20
  cache,
20
- cmp_to_key,
21
+ cmpToKey,
21
22
  identity,
22
- itemgetter,
23
- lru_cache,
24
- methodcaller,
23
+ itemGetter,
24
+ lruCache,
25
+ methodCaller,
25
26
  partial,
26
- partialmethod,
27
+ partialMethod,
28
+ pipe,
27
29
  reduce,
28
- singledispatch,
29
- total_ordering,
30
+ singleDispatch,
31
+ totalOrdering,
30
32
  wraps
31
33
  };
32
34
  //# sourceMappingURL=functools.js.map
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { i as itertoolsModule } from './itertools-Bj8XivI6.js';
2
- import { f as functoolsModule } from './functools-St5GqpKG.js';
3
- import { C as Counter, d as defaultdict, a as deque, c as collectionsModule } from './collections-xN9Gi0TA.js';
4
- import { m as mathModule } from './math-BrT4Aw3E.js';
5
- import { r as randomModule } from './random-D5S5iSV3.js';
6
- import { j as jsonModule } from './json-Xpk0kwSd.js';
7
- import { o as osModule } from './os-FRSJbEUH.js';
8
- import { d as datetimeModule } from './datetime-DRwFAiGV.js';
9
- import { r as reModule } from './re-DSxiURqN.js';
10
- import { Template, capwords } from './string.js';
1
+ import { i as itertoolsModule } from './itertools-Sjl1LB_0.js';
2
+ import { f as functoolsModule } from './functools-NrsZAqJk.js';
3
+ import { c as collectionsModule } from './collections-CJur5Wg-.js';
4
+ import { m as mathModule } from './math-DwEGjjQ-.js';
5
+ import { r as randomModule } from './random-BJv_rSpL.js';
6
+ import { j as jsonModule } from './json-DAlvCadU.js';
7
+ import { o as osModule } from './os-C6Nt7Ijx.js';
8
+ import { d as datetimeModule } from './datetime-Bpce8gG2.js';
9
+ import { r as reModule } from './re-B1CHCgyr.js';
10
+ import { capWords, Template } from './string.js';
11
11
 
12
12
  /**
13
13
  * Core Python operations for TypeScript
@@ -17,7 +17,7 @@ import { Template, capwords } from './string.js';
17
17
  * Floor division (Python //)
18
18
  * Always rounds towards negative infinity, unlike Math.floor for negatives
19
19
  */
20
- declare function floordiv$1(a: number, b: number): number;
20
+ declare function floorDiv$1(a: number, b: number): number;
21
21
  /**
22
22
  * Power operator (Python **)
23
23
  */
@@ -28,9 +28,9 @@ declare function pow(base: number, exp: number): number;
28
28
  */
29
29
  declare function mod$1(a: number, b: number): number;
30
30
  /**
31
- * Python divmod()
31
+ * Python divMod()
32
32
  */
33
- declare function divmod$1(a: number, b: number): [number, number];
33
+ declare function divMod$1(a: number, b: number): [number, number];
34
34
  /**
35
35
  * Python %-style string formatting
36
36
  * Handles %s, %d, %i, %f, %r, %x, %o, etc.
@@ -65,9 +65,11 @@ declare function is$1(a: unknown, b: unknown): boolean;
65
65
 
66
66
  /**
67
67
  * Python built-in functions for TypeScript
68
- * len, range, enumerate, sorted, min, max, etc.
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}
69
72
  */
70
-
71
73
  /**
72
74
  * Python range() function
73
75
  */
@@ -273,17 +275,17 @@ declare const dict$1: {
273
275
  */
274
276
  get<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue?: V): V | undefined;
275
277
  /**
276
- * Python dict.setdefault() - get value or set default
278
+ * Python dict.setDefault() - get value or set default
277
279
  */
278
- setdefault<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue: V): V;
280
+ setDefault<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue: V): V;
279
281
  /**
280
282
  * Python dict.pop() - remove and return value
281
283
  */
282
284
  pop<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue?: V): V | undefined;
283
285
  /**
284
- * Python dict.popitem() - remove and return last item
286
+ * Python dict.popItem() - remove and return last item
285
287
  */
286
- popitem<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V];
288
+ popItem<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V];
287
289
  /**
288
290
  * Python dict.update() - update with another dict
289
291
  */
@@ -309,9 +311,9 @@ declare const dict$1: {
309
311
  */
310
312
  items<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V][];
311
313
  /**
312
- * Python dict.fromkeys() - create dict from keys
314
+ * Python dict.fromKeys() - create dict from keys
313
315
  */
314
- fromkeys<K extends string | number | symbol, V>(keys: K[], value?: V): Record<K, V | undefined>;
316
+ fromKeys<K extends string | number | symbol, V>(keys: K[], value?: V): Record<K, V | undefined>;
315
317
  };
316
318
 
317
319
  /**
@@ -376,17 +378,17 @@ declare const set$1: {
376
378
  */
377
379
  symmetricDifferenceUpdate<T>(a: Set<T>, b: Set<T>): void;
378
380
  /**
379
- * Python set.issubset() - test if all elements are in other
381
+ * Python set.isSubset() - test if all elements are in other
380
382
  */
381
- issubset<T>(a: Set<T>, b: Set<T>): boolean;
383
+ isSubset<T>(a: Set<T>, b: Set<T>): boolean;
382
384
  /**
383
- * Python set.issuperset() - test if all other elements are in this set
385
+ * Python set.isSuperset() - test if all other elements are in this set
384
386
  */
385
- issuperset<T>(a: Set<T>, b: Set<T>): boolean;
387
+ isSuperset<T>(a: Set<T>, b: Set<T>): boolean;
386
388
  /**
387
- * Python set.isdisjoint() - test if no common elements
389
+ * Python set.isDisjoint() - test if no common elements
388
390
  */
389
- isdisjoint<T>(a: Set<T>, b: Set<T>): boolean;
391
+ isDisjoint<T>(a: Set<T>, b: Set<T>): boolean;
390
392
  };
391
393
 
392
394
  /**
@@ -418,48 +420,48 @@ declare const os: typeof osModule;
418
420
  declare const datetime: typeof datetimeModule;
419
421
  declare const re: typeof reModule;
420
422
  declare const string: {
421
- ascii_lowercase: string;
422
- ascii_uppercase: string;
423
- ascii_letters: string;
423
+ asciiLowercase: string;
424
+ asciiUppercase: string;
425
+ asciiLetters: string;
424
426
  digits: string;
425
- hexdigits: string;
426
- octdigits: string;
427
+ hexDigits: string;
428
+ octDigits: string;
427
429
  punctuation: string;
428
430
  whitespace: string;
429
431
  printable: string;
430
- capwords: typeof capwords;
432
+ capWords: typeof capWords;
431
433
  Template: typeof Template;
432
434
  join(sep: string, iterable: Iterable<string>): string;
433
435
  split(s: string, sep?: string, maxsplit?: number): string[];
434
- rsplit(s: string, sep?: string, maxsplit?: number): string[];
436
+ rSplit(s: string, sep?: string, maxsplit?: number): string[];
435
437
  strip(s: string, chars?: string): string;
436
- lstrip(s: string, chars?: string): string;
437
- rstrip(s: string, chars?: string): string;
438
+ lStrip(s: string, chars?: string): string;
439
+ rStrip(s: string, chars?: string): string;
438
440
  upper(s: string): string;
439
441
  lower(s: string): string;
440
442
  capitalize(s: string): string;
441
443
  title(s: string): string;
442
- swapcase(s: string): string;
443
- startswith(s: string, prefix: string, start?: number, end?: number): boolean;
444
- endswith(s: string, suffix: string, start?: number, end?: number): boolean;
444
+ swapCase(s: string): string;
445
+ startsWith(s: string, prefix: string, start?: number, end?: number): boolean;
446
+ endsWith(s: string, suffix: string, start?: number, end?: number): boolean;
445
447
  find(s: string, sub: string, start?: number, end?: number): number;
446
- rfind(s: string, sub: string, start?: number, end?: number): number;
448
+ rFind(s: string, sub: string, start?: number, end?: number): number;
447
449
  index(s: string, sub: string, start?: number, end?: number): number;
448
- rindex(s: string, sub: string, start?: number, end?: number): number;
450
+ rIndex(s: string, sub: string, start?: number, end?: number): number;
449
451
  count(s: string, sub: string, start?: number, end?: number): number;
450
452
  replace(s: string, old: string, newStr: string, count?: number): string;
451
- zfill(s: string, width: number): string;
453
+ zFill(s: string, width: number): string;
452
454
  center(s: string, width: number, fillchar?: string): string;
453
- ljust(s: string, width: number, fillchar?: string): string;
454
- rjust(s: string, width: number, fillchar?: string): string;
455
+ lJust(s: string, width: number, fillchar?: string): string;
456
+ rJust(s: string, width: number, fillchar?: string): string;
455
457
  partition(s: string, sep: string): [string, string, string];
456
- rpartition(s: string, sep: string): [string, string, string];
457
- isalpha(s: string): boolean;
458
- isdigit(s: string): boolean;
459
- isalnum(s: string): boolean;
460
- isspace(s: string): boolean;
461
- isupper(s: string): boolean;
462
- islower(s: string): boolean;
458
+ rPartition(s: string, sep: string): [string, string, string];
459
+ isAlpha(s: string): boolean;
460
+ isDigit(s: string): boolean;
461
+ isAlnum(s: string): boolean;
462
+ isSpace(s: string): boolean;
463
+ isUpper(s: string): boolean;
464
+ isLower(s: string): boolean;
463
465
  format(s: string, ...args: unknown[]): string;
464
466
  };
465
467
  type ListConstructor = {
@@ -474,9 +476,9 @@ type SetConstructor = {
474
476
  declare const list: ListConstructor;
475
477
  declare const dict: DictConstructor;
476
478
  declare const set: SetConstructor;
477
- declare const floordiv: typeof floordiv$1;
479
+ declare const floorDiv: typeof floorDiv$1;
478
480
  declare const mod: typeof mod$1;
479
- declare const divmod: typeof divmod$1;
481
+ declare const divMod: typeof divMod$1;
480
482
  declare const sprintf: typeof sprintf$1;
481
483
  declare const strFormat: typeof strFormat$1;
482
484
  declare const slice: typeof slice$1;
@@ -516,109 +518,5 @@ declare const isinstance: typeof isinstance$1;
516
518
  declare const type: typeof type$1;
517
519
  declare const input: typeof input$1;
518
520
  declare const format: typeof format$1;
519
- declare const py: {
520
- string: {
521
- join(sep: string, iterable: Iterable<string>): string;
522
- split(s: string, sep?: string, maxsplit?: number): string[];
523
- rsplit(s: string, sep?: string, maxsplit?: number): string[];
524
- strip(s: string, chars?: string): string;
525
- lstrip(s: string, chars?: string): string;
526
- rstrip(s: string, chars?: string): string;
527
- upper(s: string): string;
528
- lower(s: string): string;
529
- capitalize(s: string): string;
530
- title(s: string): string;
531
- swapcase(s: string): string;
532
- startswith(s: string, prefix: string, start?: number, end?: number): boolean;
533
- endswith(s: string, suffix: string, start?: number, end?: number): boolean;
534
- find(s: string, sub: string, start?: number, end?: number): number;
535
- rfind(s: string, sub: string, start?: number, end?: number): number;
536
- index(s: string, sub: string, start?: number, end?: number): number;
537
- rindex(s: string, sub: string, start?: number, end?: number): number;
538
- count(s: string, sub: string, start?: number, end?: number): number;
539
- replace(s: string, old: string, newStr: string, count?: number): string;
540
- zfill(s: string, width: number): string;
541
- center(s: string, width: number, fillchar?: string): string;
542
- ljust(s: string, width: number, fillchar?: string): string;
543
- rjust(s: string, width: number, fillchar?: string): string;
544
- partition(s: string, sep: string): [string, string, string];
545
- rpartition(s: string, sep: string): [string, string, string];
546
- isalpha(s: string): boolean;
547
- isdigit(s: string): boolean;
548
- isalnum(s: string): boolean;
549
- isspace(s: string): boolean;
550
- isupper(s: string): boolean;
551
- islower(s: string): boolean;
552
- format(s: string, ...args: unknown[]): string;
553
- };
554
- list: ListConstructor;
555
- dict: DictConstructor;
556
- set: SetConstructor;
557
- floordiv: typeof floordiv$1;
558
- pow: typeof pow;
559
- mod: typeof mod$1;
560
- divmod: typeof divmod$1;
561
- sprintf: typeof sprintf$1;
562
- strFormat: typeof strFormat$1;
563
- slice: typeof slice$1;
564
- at: typeof at$1;
565
- repeat: typeof repeat;
566
- in: typeof contains$1;
567
- is: typeof is$1;
568
- range: typeof range$1;
569
- enumerate: typeof enumerate$1;
570
- zip: typeof zip$1;
571
- iter: typeof iter$1;
572
- reversed: typeof reversed$1;
573
- sorted: typeof sorted$1;
574
- map: typeof map$1;
575
- filter: typeof filter$1;
576
- tuple: typeof tuple$1;
577
- len: typeof len$1;
578
- abs: typeof abs$1;
579
- min: typeof min$1;
580
- max: typeof max$1;
581
- sum: typeof sum$1;
582
- all: typeof all$1;
583
- any: typeof any$1;
584
- round: typeof round$1;
585
- ord: typeof ord$1;
586
- chr: typeof chr$1;
587
- hex: typeof hex$1;
588
- oct: typeof oct$1;
589
- bin: typeof bin$1;
590
- int: typeof int$1;
591
- float: typeof float$1;
592
- str: typeof str$1;
593
- repr: typeof repr$1;
594
- bool: typeof bool$1;
595
- ascii: typeof ascii$1;
596
- isinstance: typeof isinstance$1;
597
- type: typeof type$1;
598
- input: typeof input$1;
599
- format: typeof format$1;
600
- itertools: typeof itertoolsModule;
601
- functools: typeof functoolsModule;
602
- math: typeof mathModule;
603
- random: typeof randomModule;
604
- json: typeof jsonModule;
605
- os: typeof osModule;
606
- datetime: typeof datetimeModule;
607
- re: typeof reModule;
608
- Counter: typeof Counter;
609
- defaultdict: typeof defaultdict;
610
- deque: typeof deque;
611
- Template: typeof Template;
612
- ascii_lowercase: string;
613
- ascii_uppercase: string;
614
- ascii_letters: string;
615
- digits: string;
616
- hexdigits: string;
617
- octdigits: string;
618
- punctuation: string;
619
- whitespace: string;
620
- printable: string;
621
- capwords: typeof capwords;
622
- };
623
521
 
624
- export { abs, all, any, ascii, at, bin, bool, chr, collections, contains, datetime, py as default, dict, divmod, enumerate, filter, float, floordiv, format, functools, hex, input, int, is, isinstance, iter, itertools, json, len, list, map, math, max, min, mod, oct, ord, os, pow, py, random, range, re, repeat as repeatValue, repr, reversed, round, set, slice, sorted, sprintf, str, strFormat, string, sum, tuple, type, zip };
522
+ export { abs, all, any, ascii, at, bin, bool, chr, collections, contains, datetime, dict, divMod, enumerate, filter, float, floorDiv, format, functools, 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, slice, sorted, sprintf, str, strFormat, string, sum, tuple, type, zip };