datamule 1.1.1__tar.gz → 1.1.6__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 (40) hide show
  1. {datamule-1.1.1 → datamule-1.1.6}/PKG-INFO +1 -1
  2. {datamule-1.1.1 → datamule-1.1.6}/datamule/__init__.py +5 -1
  3. datamule-1.1.6/datamule/index.py +62 -0
  4. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/submissions/monitor.py +3 -3
  5. datamule-1.1.1/datamule/book/book.py → datamule-1.1.6/datamule/sheet.py +3 -3
  6. {datamule-1.1.1 → datamule-1.1.6}/datamule.egg-info/PKG-INFO +1 -1
  7. {datamule-1.1.1 → datamule-1.1.6}/datamule.egg-info/SOURCES.txt +2 -2
  8. {datamule-1.1.1 → datamule-1.1.6}/setup.py +1 -1
  9. datamule-1.1.1/datamule/seclibrary/__init__.py +0 -0
  10. {datamule-1.1.1 → datamule-1.1.6}/datamule/config.py +0 -0
  11. {datamule-1.1.1 → datamule-1.1.6}/datamule/document.py +0 -0
  12. {datamule-1.1.1 → datamule-1.1.6}/datamule/helper.py +0 -0
  13. {datamule-1.1.1/datamule/book → datamule-1.1.6/datamule/mapping_dicts}/__init__.py +0 -0
  14. {datamule-1.1.1 → datamule-1.1.6}/datamule/mapping_dicts/txt_mapping_dicts.py +0 -0
  15. {datamule-1.1.1 → datamule-1.1.6}/datamule/mapping_dicts/xml_mapping_dicts.py +0 -0
  16. {datamule-1.1.1 → datamule-1.1.6}/datamule/portfolio.py +0 -0
  17. {datamule-1.1.1/datamule/mapping_dicts → datamule-1.1.6/datamule/sec}/__init__.py +0 -0
  18. {datamule-1.1.1/datamule/sec → datamule-1.1.6/datamule/sec/infrastructure}/__init__.py +0 -0
  19. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/infrastructure/submissions_metadata.py +0 -0
  20. {datamule-1.1.1/datamule/sec/infrastructure → datamule-1.1.6/datamule/sec/rss}/__init__.py +0 -0
  21. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/rss/monitor.py +0 -0
  22. {datamule-1.1.1/datamule/sec/rss → datamule-1.1.6/datamule/sec/submissions}/__init__.py +0 -0
  23. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/submissions/downloader.py +0 -0
  24. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/submissions/eftsquery.py +0 -0
  25. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/submissions/streamer.py +0 -0
  26. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/submissions/textsearch.py +0 -0
  27. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/utils.py +0 -0
  28. {datamule-1.1.1/datamule/sec/submissions → datamule-1.1.6/datamule/sec/xbrl}/__init__.py +0 -0
  29. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/xbrl/downloadcompanyfacts.py +0 -0
  30. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/xbrl/filter_xbrl.py +0 -0
  31. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/xbrl/streamcompanyfacts.py +0 -0
  32. {datamule-1.1.1 → datamule-1.1.6}/datamule/sec/xbrl/xbrlmonitor.py +0 -0
  33. {datamule-1.1.1/datamule/sec/xbrl → datamule-1.1.6/datamule/seclibrary}/__init__.py +0 -0
  34. {datamule-1.1.1 → datamule-1.1.6}/datamule/seclibrary/downloader.py +0 -0
  35. {datamule-1.1.1 → datamule-1.1.6}/datamule/seclibrary/query.py +0 -0
  36. {datamule-1.1.1 → datamule-1.1.6}/datamule/submission.py +0 -0
  37. {datamule-1.1.1 → datamule-1.1.6}/datamule.egg-info/dependency_links.txt +0 -0
  38. {datamule-1.1.1 → datamule-1.1.6}/datamule.egg-info/requires.txt +0 -0
  39. {datamule-1.1.1 → datamule-1.1.6}/datamule.egg-info/top_level.txt +0 -0
  40. {datamule-1.1.1 → datamule-1.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datamule
3
- Version: 1.1.1
3
+ Version: 1.1.6
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
@@ -3,6 +3,8 @@ from .portfolio import Portfolio
3
3
  from .document import Document
4
4
  from .helper import _load_package_csv, load_package_dataset
5
5
  from .config import Config
6
+ from .sheet import Sheet
7
+ from .index import Index
6
8
 
7
9
 
8
10
  # Keep the notebook environment setup
@@ -32,5 +34,7 @@ __all__ = [
32
34
  'Portfolio',
33
35
  'Submission',
34
36
  'Document',
35
- 'Config'
37
+ 'Config',
38
+ 'Sheet',
39
+ 'Index',
36
40
  ]
@@ -0,0 +1,62 @@
1
+ from pathlib import Path
2
+ from .sec.submissions.textsearch import query
3
+ from .helper import _process_cik_and_metadata_filters, load_package_dataset
4
+
5
+ class Index:
6
+ def __init__(self, path=None):
7
+ self.path = Path(path) if path else None
8
+
9
+ def search_submissions(
10
+ self,
11
+ text_query,
12
+ start_date=None,
13
+ end_date=None,
14
+ submission_type=None,
15
+ cik=None,
16
+ ticker=None,
17
+ requests_per_second=5.0,
18
+ quiet=True,
19
+ **kwargs
20
+ ):
21
+ """
22
+ Search SEC filings for the given text query.
23
+
24
+ Args:
25
+ text_query (str): Text to search for in SEC filings.
26
+ start_date (str or date, optional): Start date for filing search.
27
+ end_date (str or date, optional): End date for filing search.
28
+ submission_type (str, optional): Type of SEC submission to search.
29
+ cik (str, int, or list, optional): CIK(s) to filter by.
30
+ ticker (str or list, optional): Ticker(s) to filter by.
31
+ requests_per_second (float, optional): Rate limit for SEC API requests.
32
+ quiet (bool, optional): Whether to suppress output.
33
+ **kwargs: Additional filters to apply.
34
+
35
+ Returns:
36
+ dict: Search results from the query function.
37
+ """
38
+ # Process CIK and ticker filters if provided
39
+ if cik is not None or ticker is not None:
40
+ cik_list = _process_cik_and_metadata_filters(cik, ticker, **kwargs)
41
+ # Add CIK filter to the query if we have results
42
+ if cik_list:
43
+ # Implementation note: Update as needed - this assumes your query function
44
+ # can accept a cik parameter, otherwise you may need additional logic here
45
+ kwargs['cik'] = cik_list
46
+
47
+ # Execute the search query
48
+ results = query(
49
+ f'{text_query}',
50
+ filing_date=(start_date, end_date),
51
+ requests_per_second=requests_per_second,
52
+ quiet=quiet,
53
+ submission_type=submission_type,
54
+ **kwargs
55
+ )
56
+
57
+ # Save results to path if specified
58
+ if self.path:
59
+ self._save_results(results, text_query)
60
+
61
+ return results
62
+
@@ -5,7 +5,7 @@ from ..rss.monitor import start_monitor # Import start_monitor directly
5
5
  import pytz
6
6
 
7
7
 
8
- async def _process_efts_hits(hits, collected_accession_numbers, data_callback=None):
8
+ async def _process_efts_hits(hits, collected_accession_numbers, data_callback=None,rate_limiter=None):
9
9
  """Process EFTS hits, collect accession numbers, and call data callback."""
10
10
  processed_hits = []
11
11
 
@@ -36,7 +36,7 @@ async def _process_efts_hits(hits, collected_accession_numbers, data_callback=No
36
36
 
37
37
  # Call data callback if provided
38
38
  if data_callback and processed_hits:
39
- await data_callback(processed_hits)
39
+ await data_callback(processed_hits, rate_limiter)
40
40
 
41
41
  return processed_hits
42
42
 
@@ -61,7 +61,7 @@ async def _master_monitor_impl(data_callback=None, poll_callback=None, submissio
61
61
 
62
62
  # Prepare a wrapper callback to collect accession numbers
63
63
  async def process_callback(hits):
64
- await _process_efts_hits(hits, collected_accession_numbers, data_callback)
64
+ await _process_efts_hits(hits, collected_accession_numbers, data_callback, efts_query.limiter)
65
65
 
66
66
  # Create an EFTSQuery instance
67
67
  efts_query = EFTSQuery(requests_per_second=requests_per_second)
@@ -1,8 +1,8 @@
1
1
  from pathlib import Path
2
- from ..helper import _process_cik_and_metadata_filters, load_package_dataset
3
- from ..sec.xbrl.downloadcompanyfacts import download_company_facts
2
+ from .helper import _process_cik_and_metadata_filters, load_package_dataset
3
+ from .sec.xbrl.downloadcompanyfacts import download_company_facts
4
4
 
5
- class Book:
5
+ class Sheet:
6
6
  def __init__(self, path):
7
7
  self.path = Path(path)
8
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datamule
3
- Version: 1.1.1
3
+ Version: 1.1.6
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
@@ -3,15 +3,15 @@ datamule/__init__.py
3
3
  datamule/config.py
4
4
  datamule/document.py
5
5
  datamule/helper.py
6
+ datamule/index.py
6
7
  datamule/portfolio.py
8
+ datamule/sheet.py
7
9
  datamule/submission.py
8
10
  datamule.egg-info/PKG-INFO
9
11
  datamule.egg-info/SOURCES.txt
10
12
  datamule.egg-info/dependency_links.txt
11
13
  datamule.egg-info/requires.txt
12
14
  datamule.egg-info/top_level.txt
13
- datamule/book/__init__.py
14
- datamule/book/book.py
15
15
  datamule/mapping_dicts/__init__.py
16
16
  datamule/mapping_dicts/txt_mapping_dicts.py
17
17
  datamule/mapping_dicts/xml_mapping_dicts.py
@@ -29,7 +29,7 @@ if not file_path.exists():
29
29
  setup(
30
30
  name="datamule",
31
31
  author="John Friedman",
32
- version="1.1.1",
32
+ version="1.1.6",
33
33
  description="Making it easier to use SEC filings.",
34
34
  packages=find_packages(include=['datamule', 'datamule.*']),
35
35
  url="https://github.com/john-friedman/datamule-python",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes