cfinterface 1.5.3__tar.gz → 1.6.0__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.
Files changed (94) hide show
  1. {cfinterface-1.5.3 → cfinterface-1.6}/PKG-INFO +3 -1
  2. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/__init__.py +1 -1
  3. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/reading/repository.py +9 -0
  4. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/writing/repository.py +9 -0
  5. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/block.py +2 -0
  6. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/datetimefield.py +2 -0
  7. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/defaultblock.py +2 -0
  8. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/defaultregister.py +2 -0
  9. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/defaultsection.py +2 -0
  10. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/field.py +2 -0
  11. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/floatfield.py +2 -0
  12. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/integerfield.py +2 -0
  13. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/line.py +9 -0
  14. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/literalfield.py +2 -0
  15. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/register.py +2 -0
  16. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/section.py +2 -0
  17. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/data/blockdata.py +2 -0
  18. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/data/registerdata.py +2 -0
  19. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/data/sectiondata.py +2 -0
  20. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/files/blockfile.py +2 -0
  21. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/files/registerfile.py +2 -0
  22. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/files/sectionfile.py +2 -0
  23. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/reading/blockreading.py +9 -0
  24. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/reading/registerreading.py +9 -0
  25. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/reading/sectionreading.py +9 -0
  26. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/writing/blockwriting.py +6 -0
  27. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/writing/registerwriting.py +6 -0
  28. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/writing/sectionwriting.py +6 -0
  29. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface.egg-info/PKG-INFO +3 -1
  30. {cfinterface-1.5.3 → cfinterface-1.6}/LICENSE.md +0 -0
  31. {cfinterface-1.5.3 → cfinterface-1.6}/README.md +0 -0
  32. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/_utils/__init__.py +0 -0
  33. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/__init__.py +0 -0
  34. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/components/__init__.py +0 -0
  35. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/components/line/__init__.py +0 -0
  36. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/components/line/repository.py +0 -0
  37. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/components/repository.py +0 -0
  38. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/reading/__init__.py +0 -0
  39. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/adapters/writing/__init__.py +0 -0
  40. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/components/__init__.py +0 -0
  41. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/data/__init__.py +0 -0
  42. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/files/__init__.py +0 -0
  43. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/py.typed +0 -0
  44. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/reading/__init__.py +0 -0
  45. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface/writing/__init__.py +0 -0
  46. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface.egg-info/SOURCES.txt +0 -0
  47. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface.egg-info/dependency_links.txt +0 -0
  48. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface.egg-info/requires.txt +0 -0
  49. {cfinterface-1.5.3 → cfinterface-1.6}/cfinterface.egg-info/top_level.txt +0 -0
  50. {cfinterface-1.5.3 → cfinterface-1.6}/examples/__init__.py +0 -0
  51. {cfinterface-1.5.3 → cfinterface-1.6}/setup.cfg +0 -0
  52. {cfinterface-1.5.3 → cfinterface-1.6}/setup.py +0 -0
  53. {cfinterface-1.5.3 → cfinterface-1.6}/tests/__init__.py +0 -0
  54. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/__init__.py +0 -0
  55. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/components/__init__.py +0 -0
  56. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/components/test_blockrepository.py +0 -0
  57. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/components/test_linerepository.py +0 -0
  58. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/components/test_registerrepository.py +0 -0
  59. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/components/test_sectionrepository.py +0 -0
  60. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/reading/__init__.py +0 -0
  61. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/reading/test_readingrepository.py +0 -0
  62. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/writing/__init__.py +0 -0
  63. {cfinterface-1.5.3 → cfinterface-1.6}/tests/adapters/writing/test_writingrepository.py +0 -0
  64. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/__init__.py +0 -0
  65. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_block.py +0 -0
  66. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_datetimefield.py +0 -0
  67. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_defaultblock.py +0 -0
  68. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_defaultregister.py +0 -0
  69. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_defaultsection.py +0 -0
  70. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_field.py +0 -0
  71. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_floatfield.py +0 -0
  72. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_integerfield.py +0 -0
  73. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_line.py +0 -0
  74. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_literalfield.py +0 -0
  75. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_register.py +0 -0
  76. {cfinterface-1.5.3 → cfinterface-1.6}/tests/components/test_section.py +0 -0
  77. {cfinterface-1.5.3 → cfinterface-1.6}/tests/data/__init__.py +0 -0
  78. {cfinterface-1.5.3 → cfinterface-1.6}/tests/data/test_blockdata.py +0 -0
  79. {cfinterface-1.5.3 → cfinterface-1.6}/tests/data/test_registerdata.py +0 -0
  80. {cfinterface-1.5.3 → cfinterface-1.6}/tests/data/test_sectiondata.py +0 -0
  81. {cfinterface-1.5.3 → cfinterface-1.6}/tests/files/__init__.py +0 -0
  82. {cfinterface-1.5.3 → cfinterface-1.6}/tests/files/test_blockfile.py +0 -0
  83. {cfinterface-1.5.3 → cfinterface-1.6}/tests/files/test_registerfile.py +0 -0
  84. {cfinterface-1.5.3 → cfinterface-1.6}/tests/files/test_sectionfile.py +0 -0
  85. {cfinterface-1.5.3 → cfinterface-1.6}/tests/mocks/__init__.py +0 -0
  86. {cfinterface-1.5.3 → cfinterface-1.6}/tests/mocks/mock_open.py +0 -0
  87. {cfinterface-1.5.3 → cfinterface-1.6}/tests/reading/__init__.py +0 -0
  88. {cfinterface-1.5.3 → cfinterface-1.6}/tests/reading/test_blockreading.py +0 -0
  89. {cfinterface-1.5.3 → cfinterface-1.6}/tests/reading/test_registerreading.py +0 -0
  90. {cfinterface-1.5.3 → cfinterface-1.6}/tests/reading/test_sectionreading.py +0 -0
  91. {cfinterface-1.5.3 → cfinterface-1.6}/tests/writing/__init__.py +0 -0
  92. {cfinterface-1.5.3 → cfinterface-1.6}/tests/writing/test_blockwriting.py +0 -0
  93. {cfinterface-1.5.3 → cfinterface-1.6}/tests/writing/test_registerwriting.py +0 -0
  94. {cfinterface-1.5.3 → cfinterface-1.6}/tests/writing/test_sectionwriting.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cfinterface
3
- Version: 1.5.3
3
+ Version: 1.6.0
4
4
  Summary: Interface for handling custom formatted files
5
5
  Home-page: https://github.com/rjmalves/cfi
6
6
  Author: Rogerio Alves
@@ -12,6 +12,8 @@ Classifier: Development Status :: 4 - Beta
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.md
15
+ Requires-Dist: numpy
16
+ Requires-Dist: pandas
15
17
 
16
18
  # cfinterface
17
19
 
@@ -6,7 +6,7 @@ cfi is a Python module for handling custom formatted files
6
6
  and provide reading, storing and writing utilities.
7
7
  """
8
8
 
9
- __version__ = "1.5.3"
9
+ __version__ = "1.6.0"
10
10
 
11
11
  from . import components # noqa
12
12
  from . import data # noqa
@@ -4,6 +4,9 @@ from io import BytesIO, StringIO
4
4
 
5
5
 
6
6
  class Repository(ABC):
7
+
8
+ __slots__ = ["_content", "_wrap_io"]
9
+
7
10
  def __init__(
8
11
  self, content: Union[str, bytes], wrap_io: bool = False, *args
9
12
  ) -> None:
@@ -36,6 +39,9 @@ class Repository(ABC):
36
39
 
37
40
 
38
41
  class BinaryRepository(Repository):
42
+
43
+ __slots__ = ["_filepointer"]
44
+
39
45
  def __init__(
40
46
  self, content: Union[str, bytes], wrap_io: bool = False, *args
41
47
  ) -> None:
@@ -72,6 +78,9 @@ class BinaryRepository(Repository):
72
78
 
73
79
 
74
80
  class TextualRepository(Repository):
81
+
82
+ __slots__ = ["_filepointer", "_encoding"]
83
+
75
84
  def __init__(
76
85
  self,
77
86
  content: str,
@@ -3,6 +3,9 @@ from abc import ABC, abstractmethod
3
3
 
4
4
 
5
5
  class Repository(ABC):
6
+
7
+ __slots__ = ["_to", "_wrap_io"]
8
+
6
9
  def __init__(self, to: Union[str, IO], *args) -> None:
7
10
  self._to = to
8
11
  self._wrap_io = isinstance(to, str)
@@ -30,6 +33,9 @@ class Repository(ABC):
30
33
 
31
34
 
32
35
  class BinaryRepository(Repository):
36
+
37
+ __slots__ = ["_filepointer"]
38
+
33
39
  def __init__(self, path: str, *args) -> None:
34
40
  super().__init__(path)
35
41
  self._filepointer: BinaryIO = None # type: ignore
@@ -59,6 +65,9 @@ class BinaryRepository(Repository):
59
65
 
60
66
 
61
67
  class TextualRepository(Repository):
68
+
69
+ __slots__ = ["_filepointer", "_encoding"]
70
+
62
71
  def __init__(self, path: str, encoding: str) -> None:
63
72
  super().__init__(path)
64
73
  self._filepointer: TextIO = None # type: ignore
@@ -9,6 +9,8 @@ class Block:
9
9
  for beginning and end and reading states.
10
10
  """
11
11
 
12
+ __slots__ = ["__previous", "__next", "__data"]
13
+
12
14
  BEGIN_PATTERN: Union[str, bytes] = ""
13
15
  END_PATTERN: Union[str, bytes] = ""
14
16
  MAX_LINES = 10000
@@ -12,6 +12,8 @@ class DatetimeField(Field):
12
12
  by an optional argument.
13
13
  """
14
14
 
15
+ __slots__ = ["__format"]
16
+
15
17
  def __init__(
16
18
  self,
17
19
  size: int = 16,
@@ -8,6 +8,8 @@ class DefaultBlock(Block):
8
8
  the data from the read line. Mainly used for comments.
9
9
  """
10
10
 
11
+ __slots__ = []
12
+
11
13
  def __eq__(self, o: object) -> bool:
12
14
  if not isinstance(o, DefaultBlock):
13
15
  return False
@@ -8,6 +8,8 @@ class DefaultRegister(Register):
8
8
  the data from the read line. Mainly used for comments.
9
9
  """
10
10
 
11
+ __slots__ = []
12
+
11
13
  def __init__(self, previous=None, next=None, data=None) -> None:
12
14
  super().__init__(previous, next, data)
13
15
 
@@ -8,6 +8,8 @@ class DefaultSection(Section):
8
8
  and is used for representing empty data.
9
9
  """
10
10
 
11
+ __slots__ = []
12
+
11
13
  def __eq__(self, o: object) -> bool:
12
14
  if not isinstance(o, DefaultSection):
13
15
  return False
@@ -8,6 +8,8 @@ class Field:
8
8
  in a file.
9
9
  """
10
10
 
11
+ __slots__ = ["_size", "_starting_position", "_ending_position", "_value"]
12
+
11
13
  T = TypeVar("T", str, bytes)
12
14
 
13
15
  def __init__(
@@ -12,6 +12,8 @@ class FloatField(Field):
12
12
  by 'F' for fixed point notation and 'E' for scientific notation.
13
13
  """
14
14
 
15
+ __slots__ = ["__decimal_digits", "__format", "__sep", "__type"]
16
+
15
17
  TYPES = {
16
18
  2: np.float16,
17
19
  4: np.float32,
@@ -12,6 +12,8 @@ class IntegerField(Field):
12
12
  written to a file.
13
13
  """
14
14
 
15
+ __slots__ = ["__type"]
16
+
15
17
  TYPES = {
16
18
  2: np.int16,
17
19
  4: np.int32,
@@ -13,6 +13,15 @@ class Line:
13
13
  of fields and can be read from or written to a file.
14
14
  """
15
15
 
16
+ __slots__ = [
17
+ "_delimiter",
18
+ "_fields",
19
+ "_values",
20
+ "_storage",
21
+ "_repository",
22
+ "_size",
23
+ ]
24
+
16
25
  def __init__(
17
26
  self,
18
27
  fields: List[Field],
@@ -9,6 +9,8 @@ class LiteralField(Field):
9
9
  written to a file.
10
10
  """
11
11
 
12
+ __slots__ = []
13
+
12
14
  def __init__(
13
15
  self,
14
16
  size: int = 80,
@@ -14,6 +14,8 @@ class Register:
14
14
  which is located at the beginning of the line.
15
15
  """
16
16
 
17
+ __slots__ = ["__previous", "__next", "__data", "__identifier_field"]
18
+
17
19
  IDENTIFIER: Union[str, bytes] = ""
18
20
  IDENTIFIER_DIGITS = 0
19
21
  LINE = Line([])
@@ -7,6 +7,8 @@ class Section:
7
7
  a given order
8
8
  """
9
9
 
10
+ __slots__ = ["__previous", "__next", "__data"]
11
+
10
12
  STORAGE: str = "TEXT"
11
13
 
12
14
  def __init__(
@@ -8,6 +8,8 @@ class BlockData:
8
8
  Class for a storing, managing and accessing data for a block file.
9
9
  """
10
10
 
11
+ __slots__ = ["__root", "__head"]
12
+
11
13
  T = TypeVar("T")
12
14
 
13
15
  def __init__(self, root: Block) -> None:
@@ -8,6 +8,8 @@ class RegisterData:
8
8
  Class for a storing, managing and accessing data for a register file.
9
9
  """
10
10
 
11
+ __slots__ = ["__root", "__head"]
12
+
11
13
  T = TypeVar("T")
12
14
 
13
15
  def __init__(self, root: Register) -> None:
@@ -8,6 +8,8 @@ class SectionData:
8
8
  Class for a storing, managing and accessing data for a section file.
9
9
  """
10
10
 
11
+ __slots__ = ["__root", "__head"]
12
+
11
13
  T = TypeVar("T")
12
14
 
13
15
  def __init__(self, root: Section) -> None:
@@ -13,6 +13,8 @@ class BlockFile:
13
13
  and writing are given by a series of blocks.
14
14
  """
15
15
 
16
+ __slots__ = ["__data", "__storage", "__encoding"]
17
+
16
18
  VERSIONS: Dict[str, List[Type[Block]]] = {}
17
19
  BLOCKS: List[Type[Block]] = []
18
20
  ENCODING = "utf-8"
@@ -13,6 +13,8 @@ class RegisterFile:
13
13
  and writing are given by a series of registers.
14
14
  """
15
15
 
16
+ __slots__ = ["__data", "__storage", "__encoding"]
17
+
16
18
  VERSIONS: Dict[str, List[Type[Register]]] = {}
17
19
  REGISTERS: List[Type[Register]] = []
18
20
  ENCODING = "utf-8"
@@ -13,6 +13,8 @@ class SectionFile:
13
13
  and writing are given by a series of registers.
14
14
  """
15
15
 
16
+ __slots__ = ["__data", "__storage", "__encoding"]
17
+
16
18
  VERSIONS: Dict[str, List[Type[Section]]] = {}
17
19
  SECTIONS: List[Type[Section]] = []
18
20
  ENCODING = "utf-8"
@@ -13,6 +13,15 @@ class BlockReading:
13
13
  Class for reading custom files based on a BlockData structure.
14
14
  """
15
15
 
16
+ __slots__ = [
17
+ "__allowed_blocks",
18
+ "__data",
19
+ "__last_position_filepointer",
20
+ "__storage",
21
+ "__linesize",
22
+ "__repository",
23
+ ]
24
+
16
25
  def __init__(
17
26
  self,
18
27
  allowed_blocks: List[Type[Block]],
@@ -13,6 +13,15 @@ class RegisterReading:
13
13
  Class for reading custom files based on a RegisterData structure.
14
14
  """
15
15
 
16
+ __slots__ = [
17
+ "__allowed_registers",
18
+ "__data",
19
+ "__last_position_filepointer",
20
+ "__storage",
21
+ "__linesize",
22
+ "__repository",
23
+ ]
24
+
16
25
  def __init__(
17
26
  self,
18
27
  allowed_registers: List[Type[Register]],
@@ -13,6 +13,15 @@ class SectionReading:
13
13
  Class for reading custom files based on a SectionData structure.
14
14
  """
15
15
 
16
+ __slots__ = [
17
+ "__sections",
18
+ "__data",
19
+ "__last_position_filepointer",
20
+ "__storage",
21
+ "__linesize",
22
+ "__repository",
23
+ ]
24
+
16
25
  def __init__(
17
26
  self,
18
27
  sections: List[Type[Section]],
@@ -11,6 +11,12 @@ class BlockWriting:
11
11
  Class for writing custom files based on a BlockData structure.
12
12
  """
13
13
 
14
+ __slots__ = [
15
+ "__data",
16
+ "__storage",
17
+ "__repository",
18
+ ]
19
+
14
20
  def __init__(self, data: BlockData, storage: str = "") -> None:
15
21
  self.__data = data
16
22
  self.__storage = storage
@@ -12,6 +12,12 @@ class RegisterWriting:
12
12
  Class for writing custom files based on a RegisterData structure.
13
13
  """
14
14
 
15
+ __slots__ = [
16
+ "__data",
17
+ "__storage",
18
+ "__repository",
19
+ ]
20
+
15
21
  def __init__(self, data: RegisterData, storage: str = "") -> None:
16
22
  self.__data = data
17
23
  self.__storage = storage
@@ -12,6 +12,12 @@ class SectionWriting:
12
12
  Class for writing custom files based on a SectionData structure.
13
13
  """
14
14
 
15
+ __slots__ = [
16
+ "__data",
17
+ "__storage",
18
+ "__repository",
19
+ ]
20
+
15
21
  def __init__(self, data: SectionData, storage: str = "") -> None:
16
22
  self.__data = data
17
23
  self.__storage = storage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cfinterface
3
- Version: 1.5.3
3
+ Version: 1.6.0
4
4
  Summary: Interface for handling custom formatted files
5
5
  Home-page: https://github.com/rjmalves/cfi
6
6
  Author: Rogerio Alves
@@ -12,6 +12,8 @@ Classifier: Development Status :: 4 - Beta
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.md
15
+ Requires-Dist: numpy
16
+ Requires-Dist: pandas
15
17
 
16
18
  # cfinterface
17
19
 
File without changes
File without changes
File without changes
File without changes
File without changes