def test(): start_time = time.time() # file containig company name and corresponding CIK codes seccrawler = SecCrawler() company_code_list = list() # company code list cik_list = list() # CIK code list date_list = list() # pror date list count_list = list() try: crs = open("data.txt", "r") except: print("No input file Found") # get the company quotes and CIK number from the file. for columns in (raw.strip().split() for raw in crs): company_code_list.append(columns[0]) cik_list.append(columns[1]) date_list.append(columns[2]) count_list.append(columns[3]) # call different API from the crawler for i in range(1, len(cik_list)): seccrawler.filing_10Q(str(company_code_list[i]), str(cik_list[i]), str(date_list[i]), str(count_list[i])) seccrawler.filing_10K(str(company_code_list[i]), str(cik_list[i]), str(date_list[i]), str(count_list[i])) seccrawler.filing_8K(str(company_code_list[i]), str(cik_list[i]), str(date_list[i]), str(count_list[i])) end_time = time.time() print("Total Time taken: "), print(end_time - start_time) crs.close()
def test(): t1 = time.time() # file containig company name and corresponding cik codes seccrawler = SecCrawler() companyCodeList = list() # company code list cikList = list() # cik code list dateList = list() # pror date list countList = list() try: crs = open("data.txt", "r") except: print "No input file Found" # get the comapny quotes and cik number from the file. for columns in ( raw.strip().split() for raw in crs ): companyCodeList.append(columns[0]) cikList.append(columns[1]) dateList.append(columns[2]) countList.append(columns[3]) del cikList[0]; del companyCodeList[0]; del dateList[0] for i in range(len(cikList)): seccrawler.filing_10Q(str(companyCodeList[i]), str(cikList[i]), str(dateList[i]), str(countList[i])) seccrawler.filing_10K(str(companyCodeList[i]), str(cikList[i]), str(dateList[i]), str(countList[i])) seccrawler.filing_8K(str(companyCodeList[i]), str(cikList[i]), str(dateList[i]), str(countList[i])) t2 = time.time() print "Total Time taken: ", print (t2-t1) crs.close()
def test(): t1 = time.time() # file containig company name and corresponding cik codes seccrawler = SecCrawler() company_code_list = list() # company code list cik_list = list() # cik code list date_list = list() # pror date list count_list = list() print("Enter the company name?") comp11 = str(input()) cik11 = get_cik(comp11) print("Enter the date in format YYYYMMDD?") date11 = str(input()) company_code_list.append(comp11) cik_list.append(cik11) date_list.append(date11) count_list.append("2") # call different API from the crawler for i in range(len(cik_list)): seccrawler.filing_10Q(str(company_code_list[i]), str(cik_list[i]), str(date_list[i]), str(count_list[i])) seccrawler.filing_10K(str(company_code_list[i]), str(cik_list[i]), str(date_list[i]), str(count_list[i])) # seccrawler.filing_8K(str(company_code_list[i]), str(cik_list[i]), # str(date_list[i]), str(count_list[i])) t2 = time.time() print("Total Time taken: "), print(t2 - t1)
def test(): t1 = time.time() # file containig company name and corresponding cik codes seccrawler = SecCrawler() company_code_list = list() # company code list cik_list = list() # cik code list date_list = list() # pror date list count_list = list() try: with open("data.txt", "r") as f: # get the comapny quotes and cik number from the file. for columns in (raw.strip().split() for raw in f): company_code_list.append(columns[0]) cik_list.append(columns[1]) date_list.append(columns[2]) count_list.append(columns[3]) except: print("No input file Found") # call different API from the crawler for i in range(1, len(cik_list)): seccrawler.filing_SD(company_code_list[i], cik_list[i], date_list[i], count_list[i]) seccrawler.filing_10K(company_code_list[i], cik_list[i], date_list[i], count_list[i]) seccrawler.filing_8K(company_code_list[i], cik_list[i], date_list[i], count_list[i]) seccrawler.filing_10Q(company_code_list[i], cik_list[i], date_list[i], count_list[i]) t2 = time.time() print("Total Time taken: {0}".format(t2 - t1))
def test(): t1 = time.time() # file containig company name and corresponding cik codes seccrawler = SecCrawler() companyCodeList = list() # company code list cikList = list() # cik code list dateList = list() # pror date list countList = list() try: crs = open("file.txt", "r") except: print "No input file Found" # get the comapny quotes and cik number from the file. for columns in ( raw.strip().split() for raw in crs ): companyCodeList.append(columns[0]) cikList.append(columns[1]) dateList.append(columns[2]) countList.append(columns[3]) del cikList[0]; del companyCodeList[0]; del dateList[0] for i in range(len(cikList)): seccrawler.filing_10Q(str(companyCodeList[i]), str(cikList[i]), str(dateList[i]), str(countList[i])) seccrawler.filing_10K(str(companyCodeList[i]), str(cikList[i]), str(dateList[i]), str(countList[i])) seccrawler.filing_8K(str(companyCodeList[i]), str(cikList[i]), str(dateList[i]), str(countList[i])) t2 = time.time() print "Total Time taken: ", print (t2-t1) crs.close()
def find_and_save_10Q_to_folder(ticker, from_date=None, number_of_documents=40, doc_format='xbrl'): if from_date is None: from_date = datetime.today().strftime('%Y%m%d') crawler = SecCrawler() cik, company_name = get_cik_and_name_from_ticker(ticker) crawler.filing_10Q(ticker, cik, company_name, from_date, number_of_documents, doc_format)