Useful extensions for sec-edgar-downloader.
Project description
sec-downloader
Useful extensions for sec-edgar-downloader.
Install
pip install sec_downloader
Features
- Instead of being saved to disk, files are directly downloaded into memory.
- Use “glob” pattern to select which files are read to memory.
How to use
Downloading multiple documents:
from sec_edgar_downloader import Downloader
from sec_downloader import DownloadStorage
storage = DownloadStorage()
with storage as path:
dl = Downloader("MyCompanyName", "email@example.com", path)
dl.get("10-K", "GOOG", limit=2)
# all files are now deleted and only stored in memory
for path, content in storage.get_file_contents():
print(f"Path: {path}\nContent [len={len(content)}]: {content[:30]}...\n")
Path: sec-edgar-filings/GOOG/10-K/0001652044-22-000019/full-submission.txt
Content [len=15044932]: <SEC-DOCUMENT>0001652044-22-00...
Path: sec-edgar-filings/GOOG/10-K/0001652044-23-000016/full-submission.txt
Content [len=15264470]: <SEC-DOCUMENT>0001652044-23-00...
Let’s demonstrate how to download a single file (latest 10-Q filing details in HTML format) to memory.
ONLY_HTML = "**/*.htm*"
storage = DownloadStorage(filter_pattern=ONLY_HTML)
with storage as path:
dl = Downloader("MyCompanyName", "email@example.com", path)
dl.get("10-Q", "AAPL", limit=1, download_details=True)
# all files are now deleted and only stored in memory
content = storage.get_file_contents()[0].content
print(f"{content[:50]}...")
<?xml version="1.0" ?><!--XBRL Document Created wi...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sec-downloader-0.1.1.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for sec_downloader-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf019dfcdcf3063d9e5c6b50e0804d0e69c9c931463045adcb97c622e500c645 |
|
MD5 | 686ed84ef2e867880e3098e93a090b46 |
|
BLAKE2b-256 | 5ae6a6992a26334daded92cd15f350f2f9a9a51ef76a7d76d7a85742747251b5 |