-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
examples/download.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#! /usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
from ingestor import Ingestor, Edgar, Sedar | ||
import os | ||
|
||
ingestor = Ingestor() | ||
|
||
# xbrl or html? | ||
edgar = Edgar("xbrl") | ||
|
||
docs_directory = "test" | ||
|
||
# if the directory we will download files does not exist, create it | ||
if not os.path.exists(docs_directory): | ||
os.mkdir(docs_directory) | ||
|
||
# for every ticker in our input file, download all the relevant documents | ||
with open('data.txt', 'r') as reader: | ||
for line in reader: | ||
ingestor.file_downloader(edgar.ingest_stock(line.rstrip()), docs_directory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters