datamule 0.422__cp38-cp38-win_amd64.whl → 0.423__cp38-cp38-win_amd64.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
@@ -17,10 +17,10 @@ Requires-Dist: pytz
17
17
  Requires-Dist: zstandard
18
18
  Provides-Extra: all
19
19
  Requires-Dist: pandas; extra == "all"
20
- Requires-Dist: flask; extra == "all"
21
20
  Requires-Dist: psutil; extra == "all"
22
- Requires-Dist: google-generativeai; extra == "all"
21
+ Requires-Dist: flask; extra == "all"
23
22
  Requires-Dist: openai; extra == "all"
23
+ Requires-Dist: google-generativeai; extra == "all"
24
24
  Provides-Extra: dataset_builder
25
25
  Requires-Dist: pandas; extra == "dataset-builder"
26
26
  Requires-Dist: google-generativeai; extra == "dataset-builder"
@@ -3,7 +3,7 @@ datamule/document.py,sha256=6xEaI-32AQiBxX3gZcX4Qr49bgvcvLviFAwUGpTwtr0,5273
3
3
  datamule/helper.py,sha256=8HOjB3Y7svw_zjEY-AY5JKOJ-LrBiuQMPyok3MH6CCg,4716
4
4
  datamule/monitor.py,sha256=WVds1HGV_ojYgWmo0b4Dsiv9mzZ85HHnCucH-7XoUw8,9350
5
5
  datamule/packageupdater.py,sha256=qVabK4YwSd62OjIvNY59hcQNgZCi4R2PRgCenq7THgE,9790
6
- datamule/portfolio.py,sha256=T6V04T0WmN4Wy7cudiv3c2BbSxpUTt3mI3jZOsM6kUM,730
6
+ datamule/portfolio.py,sha256=OOlu_05S88uwg5Me_EpY3C7BQ93Yq9eE0_tMY_Gqyrw,1117
7
7
  datamule/submission.py,sha256=sB6tidsAdaqP5VIQEFPq6PjLTgmD-crgdNviaOpiqlU,2558
8
8
  datamule/data/company_former_names.csv,sha256=zTBWdV12_JE3aROFOMrFNTHLPW_M4TDruxtl15-XfA0,714528
9
9
  datamule/data/company_metadata.csv,sha256=X7uSIwConqC0sz-moIhXIISg6FI7GLGSlvAfDDf8Sd0,3078648
@@ -47,8 +47,8 @@ datamule/parser/document_parsing/n_port_p_parser.py,sha256=T6GliMm-TETPsFM-hDKt1
47
47
  datamule/parser/document_parsing/sec_parser.py,sha256=YewOdOsi0P25teQuxS5DNEND9ZCyxE2ewK1DoP9mPto,2788
48
48
  datamule/parser/document_parsing/sgml_parser.py,sha256=ASpe1SzgPj4qk0VOmmuMiEQeatjcwZzsuO3MvsYCHhc,3410
49
49
  datamule/parser/sgml_parsing/sgml_parser_cy.c,sha256=vxLnjpUgZ5LLvBvzYI_CZVxjpgRpulnzj3EFQG5eB8g,797203
50
- datamule/parser/sgml_parsing/sgml_parser_cy.cp38-win_amd64.pyd,sha256=zakIaOlJUDt2pUmrGAg_JTTFDtCCb9ZoFoX6oHF7jXA,123392
51
- datamule-0.422.dist-info/METADATA,sha256=U6YU546iCwEwA5bdiYAGoSBLUW4TphJB3XMzQV4XvEo,1039
52
- datamule-0.422.dist-info/WHEEL,sha256=rTcqimtzpX3smAWAhGmiRSWAxTY4PqYPNE-p4kscHDQ,99
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.cp38-win_amd64.pyd,sha256=-1gwfyFujXcfxE7PRJ3wu6r5noK4Bi9RjnmuQ-T5oFY,123392
51
+ datamule-0.423.dist-info/METADATA,sha256=xybE0NZPgkbdUS4iiLZed_xBPSbZkYGRaFfCuGHwfxM,1039
52
+ datamule-0.423.dist-info/WHEEL,sha256=rTcqimtzpX3smAWAhGmiRSWAxTY4PqYPNE-p4kscHDQ,99
53
+ datamule-0.423.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
54
+ datamule-0.423.dist-info/RECORD,,