SECEdgar/readFile.py
def readIn(file):
	'''this function reads in a list of companies and enters their respective
	SEC name and number into a dictionary which we will use to recurse through '''
	file = open(file, 'r').read() #open file
	companies = {} #create dictionary mapping name:number

	#import file into dictionary
	companyName = ""
	companyCode = ""
	for char in file:
		if char == "\n":
			companies[companyName] = companyCode
			companyName = ""
			companyCode = ""

		elif char.isalpha() and char!= " ": #is letter and not space
			companyName += char
		
		else:
			try: #is number
				int(char)
				companyCode += char		
			
			except ValueError:
				pass

	return companies
this function reads in a list of companies and enters their respective
	SEC name and number into a dictionary which we will use to recurse through 
this function reads in a list of companies and enters their respective
SEC name and number into a dictionary which we will use to recurse through
this function reads in a list of companies and enters their respective SEC name and number into a dictionary which we will use to recurse through
def readIn(file):
	file = open(file, 'r').read() 
	companies = {} 
	companyName = ""
	companyCode = ""
	for char in file:
		if char == "\n":
			companies[companyName] = companyCode
			companyName = ""
			companyCode = ""
		elif char.isalpha() and char!= " ": 
			companyName += char
		else:
			try: 
				int(char)
				companyCode += char		
			except ValueError:
				pass
	return companies
def readIn ( file ) : file = open ( file , 'r' ) . read ( ) companies = { } companyName = "" companyCode = "" for char in file : if char == "\n" : companies [ companyName ] = companyCode companyName = "" companyCode = "" elif char . isalpha ( ) and char != " " : companyName += char else : try : int ( char ) companyCode += char except ValueError : pass return companies
this function reads in a list of companies and enters their respective
SEC name and number into a dictionary which we will use to recurse through
this function reads in a list of companies and enters their respective SEC name and number into a dictionary which we will use to recurse through
'''this function reads in a list of companies and enters their respective
	SEC name and number into a dictionary which we will use to recurse through ''' #open file #create dictionary mapping name:number #import file into dictionary #is letter and not space #is number
file