datamule 0.422__cp38-cp38-macosx_11_0_universal2.whl → 0.423__cp38-cp38-macosx_11_0_universal2.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.
datamule/portfolio.py CHANGED
@@ -4,13 +4,23 @@ from concurrent.futures import ProcessPoolExecutor
4
4
  from .submission import Submission
5
5
 
6
6
  class Portfolio:
7
- def __init__(self, path):
7
+ @classmethod
8
+ def create(cls, path):
9
+ # This method handles the process pool lifecycle
10
+ with ProcessPoolExecutor() as executor:
11
+ portfolio = cls(path, executor)
12
+ return portfolio
13
+
14
+ def __init__(self, path, executor=None):
8
15
  self.path = Path(path)
9
16
  folders = [f for f in self.path.iterdir() if f.is_dir()]
10
17
  print(f"Loading {len(folders)} submissions")
11
- # Load submissions in parallel
12
- with ProcessPoolExecutor() as executor:
13
- # Show progress while loading
18
+
19
+ if executor is None:
20
+ # Fall back to sequential loading if no executor
21
+ self.submissions = [Submission(f) for f in tqdm(folders, desc="Loading submissions")]
22
+ else:
23
+ # Use provided executor for parallel loading
14
24
  self.submissions = list(tqdm(
15
25
  executor.map(Submission, folders),
16
26
  total=len(folders),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datamule
3
- Version: 0.422
3
+ Version: 0.423
4
4
  Summary: Making it easier to use SEC filings.
5
5
  Home-page: https://github.com/john-friedman/datamule-python
6
6
  Author: John Friedman
@@ -16,10 +16,10 @@ Requires-Dist: selectolax
16
16
  Requires-Dist: pytz
17
17
  Requires-Dist: zstandard
18
18
  Provides-Extra: all
19
- Requires-Dist: google-generativeai; extra == "all"
19
+ Requires-Dist: flask; extra == "all"
20
20
  Requires-Dist: psutil; extra == "all"
21
21
  Requires-Dist: pandas; extra == "all"
22
- Requires-Dist: flask; extra == "all"
22
+ Requires-Dist: google-generativeai; extra == "all"
23
23
  Requires-Dist: openai; extra == "all"
24
24
  Provides-Extra: dataset_builder
25
25
  Requires-Dist: pandas; extra == "dataset-builder"
@@ -3,7 +3,7 @@ datamule/document.py,sha256=Yn8UqUjKwYPE29MrMjreHK_HY9eTqOSjPyM5B1VBrHQ,5144
3
3
  datamule/helper.py,sha256=tr3AQWus9dHNZFKpLSglWjcb8zmm5qDXjOWACMhvMxQ,4594
4
4
  datamule/monitor.py,sha256=mRaM8v5NgcMF9DJ1s_YBzucjrbr-3yFwW422MVml-_Q,9114
5
5
  datamule/packageupdater.py,sha256=rw4hTnQGjZttee8QmTadg9vlhEjVp_dwdSFv8uQNvss,9584
6
- datamule/portfolio.py,sha256=Qd_j3gGUi95Ad0g-PpjfJ3ozg-92VohMvCOvcEb0Kbw,710
6
+ datamule/portfolio.py,sha256=uj6-NhFKUufepvywsBjhx783UiMeIagEKX4zoq8P8yU,1087
7
7
  datamule/submission.py,sha256=LlwHJL3CIMHOlaHqCfDH7UBiKCFu0tPYV-g92uPvfcY,2492
8
8
  datamule/data/company_former_names.csv,sha256=HE9cAv-_QKFX6jT-_-D0rHmaDyQuAzL4MJwank5O1U8,706380
9
9
  datamule/data/company_metadata.csv,sha256=yPovrCVjYwLWTU_hBUFJymp8iNO0NBYuq_QwOkRLoN8,3068599
@@ -47,8 +47,8 @@ datamule/parser/document_parsing/n_port_p_parser.py,sha256=GmmQFkCZt57WikUZ5Daht
47
47
  datamule/parser/document_parsing/sec_parser.py,sha256=AS8H4h1sfUAdWP2gotULcjbylsYN_nHgTfkeVRyENPo,2716
48
48
  datamule/parser/document_parsing/sgml_parser.py,sha256=tC1cL3cdVQPWbc9QtoRUYSo2wRuYNaglFaCmP57oEfA,3317
49
49
  datamule/parser/sgml_parsing/sgml_parser_cy.c,sha256=UwXSuLGSBLKfO5bM7xTzjFLnGDV3-NNnCjgUCPAY1gk,796689
50
- datamule/parser/sgml_parsing/sgml_parser_cy.cpython-38-darwin.so,sha256=EOCtRdbEFXMChjL4hQVT7kM7YkFwv3YV8D4PtjDw1wk,362472
51
- datamule-0.422.dist-info/METADATA,sha256=QzV-giNirMwJicC3-60hbn_-g7u-Q75loN1EXQEINrk,1007
52
- datamule-0.422.dist-info/WHEEL,sha256=WUTEZpu92ja32G8K3yBxnUzq89QHiMkgfjPFN9CAw50,112
53
- datamule-0.422.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
54
- datamule-0.422.dist-info/RECORD,,
50
+ datamule/parser/sgml_parsing/sgml_parser_cy.cpython-38-darwin.so,sha256=4GgW3mRbK5qu63M5_a-640zUYviI2hrRPMOxSHn-Eck,362472
51
+ datamule-0.423.dist-info/METADATA,sha256=z1hqA6XVBxhuOyqWu_8hFO4fiPDijfE6xgwS0KACjlE,1007
52
+ datamule-0.423.dist-info/WHEEL,sha256=WUTEZpu92ja32G8K3yBxnUzq89QHiMkgfjPFN9CAw50,112
53
+ datamule-0.423.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
54
+ datamule-0.423.dist-info/RECORD,,