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.
- package/LICENSE +21 -0
- package/README.md +41 -138
- package/dist/{chunk-P3SGIF72.js → chunk-4KYJT3DR.js} +8 -6
- package/dist/chunk-4KYJT3DR.js.map +1 -0
- package/dist/{chunk-3CSEXTA7.js → chunk-4QG3772L.js} +53 -53
- package/dist/chunk-4QG3772L.js.map +1 -0
- package/dist/{chunk-IVYYI2VR.js → chunk-6POEDI34.js} +1 -1
- package/dist/chunk-6POEDI34.js.map +1 -0
- package/dist/{chunk-UFMTN4T4.js → chunk-6ZAJ37MR.js} +6 -5
- package/dist/chunk-6ZAJ37MR.js.map +1 -0
- package/dist/{chunk-V63LKSA3.js → chunk-7TH4FCVQ.js} +24 -24
- package/dist/chunk-7TH4FCVQ.js.map +1 -0
- package/dist/{chunk-TJFGYXBJ.js → chunk-CXKGPD5D.js} +64 -61
- package/dist/chunk-CXKGPD5D.js.map +1 -0
- package/dist/{chunk-OMQNGE6T.js → chunk-EE7SK2GV.js} +33 -27
- package/dist/chunk-EE7SK2GV.js.map +1 -0
- package/dist/{chunk-WAONBJE5.js → chunk-H76SKASU.js} +36 -36
- package/dist/chunk-H76SKASU.js.map +1 -0
- package/dist/{chunk-TOI6IG3T.js → chunk-HQ42WNKZ.js} +43 -16
- package/dist/chunk-HQ42WNKZ.js.map +1 -0
- package/dist/{chunk-HA5Y7PKO.js → chunk-LWO6BIAD.js} +36 -35
- package/dist/chunk-LWO6BIAD.js.map +1 -0
- package/dist/{collections-xN9Gi0TA.d.ts → collections-CJur5Wg-.d.ts} +5 -3
- package/dist/collections.d.ts +1 -1
- package/dist/collections.js +1 -1
- package/dist/{datetime-DRwFAiGV.d.ts → datetime-Bpce8gG2.d.ts} +17 -15
- package/dist/datetime.d.ts +1 -1
- package/dist/datetime.js +1 -1
- package/dist/{functools-St5GqpKG.d.ts → functools-NrsZAqJk.d.ts} +42 -26
- package/dist/functools.d.ts +1 -1
- package/dist/functools.js +19 -17
- package/dist/index.d.ts +56 -158
- package/dist/index.js +47 -137
- package/dist/index.js.map +1 -1
- package/dist/{itertools-Bj8XivI6.d.ts → itertools-Sjl1LB_0.d.ts} +35 -17
- package/dist/itertools.d.ts +1 -1
- package/dist/itertools.js +15 -11
- package/dist/{json-Xpk0kwSd.d.ts → json-DAlvCadU.d.ts} +7 -5
- package/dist/json.d.ts +1 -1
- package/dist/json.js +1 -1
- package/dist/{math-BrT4Aw3E.d.ts → math-DwEGjjQ-.d.ts} +2 -0
- package/dist/math.d.ts +1 -1
- package/dist/math.js +1 -1
- package/dist/{os-FRSJbEUH.d.ts → os-C6Nt7Ijx.d.ts} +45 -42
- package/dist/os.d.ts +1 -1
- package/dist/os.js +23 -23
- package/dist/{random-D5S5iSV3.d.ts → random-BJv_rSpL.d.ts} +24 -22
- package/dist/random.d.ts +1 -1
- package/dist/random.js +21 -21
- package/dist/{re-DSxiURqN.d.ts → re-B1CHCgyr.d.ts} +17 -15
- package/dist/re.d.ts +1 -1
- package/dist/re.js +7 -7
- package/dist/string.d.ts +51 -48
- package/dist/string.js +13 -13
- package/package.json +30 -11
- package/dist/chunk-3CSEXTA7.js.map +0 -1
- package/dist/chunk-HA5Y7PKO.js.map +0 -1
- package/dist/chunk-IVYYI2VR.js.map +0 -1
- package/dist/chunk-OMQNGE6T.js.map +0 -1
- package/dist/chunk-P3SGIF72.js.map +0 -1
- package/dist/chunk-TJFGYXBJ.js.map +0 -1
- package/dist/chunk-TOI6IG3T.js.map +0 -1
- package/dist/chunk-UFMTN4T4.js.map +0 -1
- package/dist/chunk-V63LKSA3.js.map +0 -1
- package/dist/chunk-WAONBJE5.js.map +0 -1
package/dist/functools.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
attrGetter,
|
|
3
3
|
cache,
|
|
4
|
-
|
|
4
|
+
cmpToKey,
|
|
5
5
|
identity,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
itemGetter,
|
|
7
|
+
lruCache,
|
|
8
|
+
methodCaller,
|
|
9
9
|
partial,
|
|
10
|
-
|
|
10
|
+
partialMethod,
|
|
11
|
+
pipe,
|
|
11
12
|
reduce,
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
singleDispatch,
|
|
14
|
+
totalOrdering,
|
|
14
15
|
wraps
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EE7SK2GV.js";
|
|
16
17
|
import "./chunk-PZ5AY32C.js";
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
attrGetter,
|
|
19
20
|
cache,
|
|
20
|
-
|
|
21
|
+
cmpToKey,
|
|
21
22
|
identity,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
itemGetter,
|
|
24
|
+
lruCache,
|
|
25
|
+
methodCaller,
|
|
25
26
|
partial,
|
|
26
|
-
|
|
27
|
+
partialMethod,
|
|
28
|
+
pipe,
|
|
27
29
|
reduce,
|
|
28
|
-
|
|
29
|
-
|
|
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-
|
|
2
|
-
import { f as functoolsModule } from './functools-
|
|
3
|
-
import {
|
|
4
|
-
import { m as mathModule } from './math-
|
|
5
|
-
import { r as randomModule } from './random-
|
|
6
|
-
import { j as jsonModule } from './json-
|
|
7
|
-
import { o as osModule } from './os-
|
|
8
|
-
import { d as datetimeModule } from './datetime-
|
|
9
|
-
import { r as reModule } from './re-
|
|
10
|
-
import {
|
|
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
|
|
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
|
|
31
|
+
* Python divMod()
|
|
32
32
|
*/
|
|
33
|
-
declare function
|
|
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
|
-
*
|
|
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.
|
|
278
|
+
* Python dict.setDefault() - get value or set default
|
|
277
279
|
*/
|
|
278
|
-
|
|
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.
|
|
286
|
+
* Python dict.popItem() - remove and return last item
|
|
285
287
|
*/
|
|
286
|
-
|
|
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.
|
|
314
|
+
* Python dict.fromKeys() - create dict from keys
|
|
313
315
|
*/
|
|
314
|
-
|
|
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.
|
|
381
|
+
* Python set.isSubset() - test if all elements are in other
|
|
380
382
|
*/
|
|
381
|
-
|
|
383
|
+
isSubset<T>(a: Set<T>, b: Set<T>): boolean;
|
|
382
384
|
/**
|
|
383
|
-
* Python set.
|
|
385
|
+
* Python set.isSuperset() - test if all other elements are in this set
|
|
384
386
|
*/
|
|
385
|
-
|
|
387
|
+
isSuperset<T>(a: Set<T>, b: Set<T>): boolean;
|
|
386
388
|
/**
|
|
387
|
-
* Python set.
|
|
389
|
+
* Python set.isDisjoint() - test if no common elements
|
|
388
390
|
*/
|
|
389
|
-
|
|
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
|
-
|
|
422
|
-
|
|
423
|
-
|
|
423
|
+
asciiLowercase: string;
|
|
424
|
+
asciiUppercase: string;
|
|
425
|
+
asciiLetters: string;
|
|
424
426
|
digits: string;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
+
hexDigits: string;
|
|
428
|
+
octDigits: string;
|
|
427
429
|
punctuation: string;
|
|
428
430
|
whitespace: string;
|
|
429
431
|
printable: string;
|
|
430
|
-
|
|
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
|
-
|
|
436
|
+
rSplit(s: string, sep?: string, maxsplit?: number): string[];
|
|
435
437
|
strip(s: string, chars?: string): string;
|
|
436
|
-
|
|
437
|
-
|
|
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
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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
|
-
|
|
448
|
+
rFind(s: string, sub: string, start?: number, end?: number): number;
|
|
447
449
|
index(s: string, sub: string, start?: number, end?: number): number;
|
|
448
|
-
|
|
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
|
-
|
|
453
|
+
zFill(s: string, width: number): string;
|
|
452
454
|
center(s: string, width: number, fillchar?: string): string;
|
|
453
|
-
|
|
454
|
-
|
|
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
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
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
|
|
479
|
+
declare const floorDiv: typeof floorDiv$1;
|
|
478
480
|
declare const mod: typeof mod$1;
|
|
479
|
-
declare const
|
|
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,
|
|
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 };
|