funcnodes-basic 0.1.0__tar.gz → 0.1.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: funcnodes-basic
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Basic functionalities for funcnodes
5
5
  Author: Julian Kimmig
6
6
  Author-email: julian.kimmig@gmx.net
@@ -4,7 +4,7 @@ from .math import NODE_SHELF as math_shelf
4
4
  from .lists import NODE_SHELF as lists_shelf
5
5
  from .strings import NODE_SHELF as strings_shelf
6
6
 
7
- __version__ = "0.1.0"
7
+ __version__ = "0.1.2"
8
8
 
9
9
  NODE_SHELF = Shelf(
10
10
  nodes=[],
@@ -549,8 +549,19 @@ def string_isascii(s: str) -> bool:
549
549
  {"name": "encoded"},
550
550
  ],
551
551
  )
552
- def string_encode(s: str, encoding: POSSIBLE_DECODINGS_TYPE = "utf-8") -> bytes:
553
- return s.encode(encoding)
552
+ def string_encode(
553
+ s: str,
554
+ encoding: POSSIBLE_DECODINGS_TYPE = "utf-8",
555
+ errors: Literal[
556
+ "strict",
557
+ "replace",
558
+ "ignore",
559
+ "xmlcharrefreplace",
560
+ "backslashreplace",
561
+ "namereplace",
562
+ ] = "replace",
563
+ ) -> bytes:
564
+ return s.encode(encoding, errors)
554
565
 
555
566
 
556
567
  @fn.NodeDecorator(
@@ -561,8 +572,19 @@ def string_encode(s: str, encoding: POSSIBLE_DECODINGS_TYPE = "utf-8") -> bytes:
561
572
  {"name": "decoded"},
562
573
  ],
563
574
  )
564
- def string_decode(b: bytes, encoding: POSSIBLE_DECODINGS_TYPE = "utf-8") -> str:
565
- return b.decode(encoding)
575
+ def string_decode(
576
+ b: bytes,
577
+ encoding: POSSIBLE_DECODINGS_TYPE = "utf-8",
578
+ errors: Literal[
579
+ "strict",
580
+ "replace",
581
+ "ignore",
582
+ "xmlcharrefreplace",
583
+ "backslashreplace",
584
+ "namereplace",
585
+ ] = "replace",
586
+ ) -> str:
587
+ return b.decode(encoding, errors)
566
588
 
567
589
 
568
590
  @fn.NodeDecorator(
@@ -691,6 +713,7 @@ regex_shelf = fn.Shelf(
691
713
  re_escape,
692
714
  re_split,
693
715
  ],
716
+ subshelves=[],
694
717
  name="Regular Expressions",
695
718
  description="Basic regular expression operations.",
696
719
  )
@@ -701,6 +724,8 @@ NODE_SHELF = fn.Shelf(
701
724
  string_concat,
702
725
  string_split,
703
726
  string_join,
727
+ string_encode,
728
+ string_decode,
704
729
  string_upper,
705
730
  string_lower,
706
731
  string_replace,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "funcnodes-basic"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "Basic functionalities for funcnodes"
5
5
  authors = ["Julian Kimmig <julian.kimmig@gmx.net>"]
6
6
  readme = "README.md"