-
-
Notifications
You must be signed in to change notification settings - Fork 478
WorkingWithFilings
# Get filings for the current year and quarter filings = get_filings() # Get filings for 2022 filings = get_filings(2022) # OR filings = get_filings(year=2022) # Get filings for 2022 quarter 4 filings = get_filings(2022, 4) # OR filings = get_filings(year=2022, quarter=4) # Get filings for 2020, 2021 and 2022 filings = get_filings([2020, 2021, 2022]) # OR filings = get_filings(year=range(2020, 2023)) # Get filings for 2020 quarters 1 and 2 filings = get_filings(2020, quarter=[1,2])
Get filings
# Filter for form D filings.filter(form="D") # Filter for form 10-K and 10-Q filings.filter(form=["10-K", "10-Q"]) # When you filter by form e.g. "D" it includes amendments e.g. "D\A". You can omit amendments filings.filter(form="D", amendments=False) # Filter by filing_date. date and filing_date mean the same thing # Get all filings on 2023年02月23日 filings.filter(date="2023-02-23") # OR filings.filter(filing_date="2023-02-23") # Filter to get all filings between 2023年01月23日 and 2023年02月23日 filings.filter(date="2023-01-23:2023年02月23日") # Filter to get all filings since 2023年01月23日 filings.filter(date="2023-01-23") # Filter to get all filings before 2023年02月23日 filings.filter(date=":2023年02月23日")
get_filings(2022, form="D")
The filings data is stored in the Filings class as a pyarrow.Table. You can get the data as a pandas dataframe using
to_pandas
df = filings.to_pandas()
The Filings object allows you to navigate through filings using filings.next() and filings.prev().
This shows you pages of the data - the page size is about 50.
# To see the next page of data filings.next() # To see the previous page filings.prev() # To see the current page filings.current()
Get next filings
You can get the latest n filings by filing_date from a filings using filings.latest().
If you provide the parameter n it will return the latest n filings.
filing = filings.latest(n=5) filing
Latest filings
If you omit this parameter, or set n=1 it will return a single `Filings object.
filing = filings.latest() filing
Latest filing
You can filter the filings object using te filter() function. This allows you to filter
by filing date, or by form.
To filter by filing date specify the filing date in YYYY-MM-DD format e.g. 2022年01月24日
(Note the parameters date and filing_date are equivalent aliases for each other)
filings.filter(date="2021-01-24") # or filings.filter(filing_date="2021-01-24")
You can specify a filing date range using the colon
filings.filter(date="2021-01-12:2021年02月28日")
To filter by dates before a specified date use `:YYYY-MM-DD'
filings.filter(date=":2021年02月28日")
To filter by dates after a specified date use `YYYY-MM-DD:'
filings.filter(date="2021-02-28:")
You can filter filings by form using the form parameter.
filings.filter(form="10-K")
To filter by form e.g. 10-K and include form amendments use amendments = True.
filings.filter(form="10-K", amendments=True)
Filter with amendments
You can get a single filing from the filings using the bracket operator [],
specifying the index of the filing. The index is the value displayed in the leftmost
position in the filings table. For example, to get the 10-Q for Costco in the table above
use filings[3]
filing = filings[3]
Costco 10Q filing
You can view the filing homepage in the terminal using filing.homepage
This gives you access to the FilingHomepage class that you can use to list all the documents
and datafiles on the filing.
filing.homepage
Filing homepage
You can open the filing in your browser using filing.open(). This will work on environments with access to the browser,
will probably not work on a remote server.
filing.open()
You can open the filing homepage in the browser using filing.homepage.open().
filing.homepage.open()
You can view the filing's HTML content as markdown in the console using view(). It works for all filing types
but can be a little slow for filings with large HTML files
filing.view()
You can get the html content of the filing using.html()
filing.html()
You can get the html content as markdown using.markdown()
filing.markdown()