markdowndata 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl

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.
markdowndata/__init__.py CHANGED
@@ -1,6 +1,10 @@
1
1
  from .process_markdown import MarkDataParser
2
2
 
3
- def load(file):
3
+
4
+ def loads(text):
4
5
  parser = MarkDataParser()
5
- parser.load(file.name)
6
- return parser.data
6
+ return parser.loads(text)
7
+
8
+
9
+ def load(file):
10
+ return loads(file.read())
@@ -11,17 +11,11 @@ class MarkDataParser:
11
11
  def __init__(self):
12
12
  self.data = {}
13
13
 
14
- def load(self, file: Union[str, IO]) -> dict:
14
+ def loads(self, text: str) -> dict:
15
15
  """
16
16
  Loads markdown content from a file path or file-like object, parses it,
17
17
  and builds a nested dictionary of structured data.
18
18
  """
19
- if isinstance(file, str):
20
- with open(file, 'r') as f:
21
- text = f.read()
22
- else:
23
- text = file.read()
24
-
25
19
  # Split the text into Section objects based on markdown headers
26
20
  sections = split_sections(text)
27
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: markdowndata
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Tool to convert markdown tables into json objects
5
5
  License: MIT
6
6
  Author: Gordon Bean
@@ -0,0 +1,9 @@
1
+ markdowndata/__init__.py,sha256=YWWuimxElvXp_jFOYzSAQ7zhtaGU2-jFmKYJq9Mtqp4,171
2
+ markdowndata/content_parser.py,sha256=FdapNfkvCj71K5lUSGQh0H1jS5vF36-l1EImsX28J2o,5387
3
+ markdowndata/process_markdown.py,sha256=cJ-E6t8-3VXQ2Pb1wmBej1H3XqXrugZRytwLsX-vi1E,2005
4
+ markdowndata/section_tree.py,sha256=X4kPqHCa_2hkiq6roOHUc22G3pNIQjpUv_ni_J14XXQ,2060
5
+ markdowndata/utils.py,sha256=jVTKEGZiLCKdv1cS-73iMf_GaXT6cBc3cl9tp_fjKOw,2040
6
+ markdowndata-0.0.4.dist-info/LICENSE,sha256=K-k1T7XcwAVVmLsHhfWMye6r7p45xz3xwv5S5FBSyZE,1074
7
+ markdowndata-0.0.4.dist-info/METADATA,sha256=4U4oGRdC4LwBqBA32pqs89AFeMzCHK8PBUG4l-VT1jU,633
8
+ markdowndata-0.0.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
9
+ markdowndata-0.0.4.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- markdowndata/__init__.py,sha256=TBg-b5wXBdEfdUCOOOc7goTBgJVYPgH-dTb7U2D3n7Y,141
2
- markdowndata/content_parser.py,sha256=FdapNfkvCj71K5lUSGQh0H1jS5vF36-l1EImsX28J2o,5387
3
- markdowndata/process_markdown.py,sha256=cQJ0yQZpCzFC6AbXpZGWZWLN5XODLS9OqfkXWLL_usU,2166
4
- markdowndata/section_tree.py,sha256=X4kPqHCa_2hkiq6roOHUc22G3pNIQjpUv_ni_J14XXQ,2060
5
- markdowndata/utils.py,sha256=jVTKEGZiLCKdv1cS-73iMf_GaXT6cBc3cl9tp_fjKOw,2040
6
- markdowndata-0.0.3.dist-info/LICENSE,sha256=K-k1T7XcwAVVmLsHhfWMye6r7p45xz3xwv5S5FBSyZE,1074
7
- markdowndata-0.0.3.dist-info/METADATA,sha256=W5askwPGg46BYTkOH7OX_7j_z1ndqpnN4OiZK-w7kCE,633
8
- markdowndata-0.0.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
9
- markdowndata-0.0.3.dist-info/RECORD,,