[PYTHON] Convert financial information of all listed companies for the past 5 years to CSV file

Introduction

In the previous article, I wrote about how to obtain financial statement information from XBRL format data obtained from the Financial Services Agency's EDINET site.

Get information on the financial statements of listed companies from XBRL.

After that, EDINET released a Web API called ** EDINET API **, and it became possible to automatically download XBRL files.

This time, I downloaded the XBRL files of all listed companies for the past 5 years and made a program to convert them to CSV files.

The CSV file of the processing result is below. http://lkzf.info/xbrl/data/summary-join.csv Financial results information is written for each line as shown below. The figures for the settlement of accounts are the values for the consolidated settlement of accounts. 集計.png

Simple application example

I made a frequency distribution table of gross profit margin (gross profit margin) from a CSV file using spreadsheet software (LibreOffice Calc). I think there are many other ways to use it. hist.png

CSV file creation procedure

The source of the app is on the same GitHub as the previous article. https://github.com/teatime77/xbrl-reader

The processing contents are explained below. http://lkzf.info/xbrl/doc

Financial analysis sample app

I also made a web application that performs financial analysis using CSV file data. You can access the app from the following URL. http://lkzf.info/xbrl/chart/ app.png We have confirmed the operation on Chrome and FireFox. I used Plotly.js to draw the graph. The source is on GitHub. https://github.com/teatime77/xbrl-chart

in conclusion

I just made an app, so I'm currently looking at Yahoo! Finance to see if the numbers match. In the future, I would like to organize the source and documents so that this source code can be used by many people.

If you make a mistake, please write it in the comment section or contact us on Twitter. We will also notify you of updates to the app on Twitter. Twitter_Logo_White_On_Blue20.pngteatime77

** Thank you for reading this far. ** **

Recommended Posts

Convert financial information of all listed companies for the past 5 years to CSV file
Batch convert all xlsx files in the folder to CSV files
After calling the Shell file on Python, convert CSV to Parquet.
How to put a line number at the beginning of a CSV file
Python script that outputs all records of Oracle table to CSV file
[Python] Convert csv file delimiters to tab delimiters
How to save the feature point information of an image in a file and use it for matching
Various ways to read the last line of a csv file in Python
Convert PDF of product list containing effective surfactants for new coronavirus to CSV
[Bash] While read, pass the contents of the file to variables for each column
I want to add silence to the beginning of a wav file for 1 second
[Python] Scan the inside of the folder including subfolders → Export the file list to CSV
Convert XLSX to CSV on the command line
Output the specified table of Oracle database in Python to Excel for each file
How to extract conditions (acquire all elements of Group that satisfy the conditions) for Group by Group
Template of python script to read the contents of the file
I tried to touch the CSV file with Python
How to convert JSON file to CSV file with Python Pandas
I tried to visualize the spacha information of VTuber
How to convert Json file to CSV format or EXCEL format
Output the output result of sklearn.metrics.classification_report as a CSV file