Git Product home page Git Product logo

xbrr's Introduction

XBRR: eXtensible Business Report Reader

PyPI version Build Status codecov

Features:

  • API: Download the documents from official publication site.
  • Reader: Extract contents from XBRL.

Supported documents:

  • Japan
    • API: EDINET
    • Reader: Mainly supports annual reports disclosed on EDINET.
  • America
    • API: Comming soon
    • Reader: Comming soon

We are welcome the contribution to support other countries API & Documents!

Install

pip install xbrr

How to use

(Examples are Japanese EDINET API and annual report).

1. API

Download the documents from EDINET.

1.1 Get document list of specific day

import xbrr


documents = xbrr.edinet.api.documents.get("2019-01-31")
print(f"Number of documents is {len(documents.list)}")
print(f"Title of first document is {documents.list[0].title}")

1.2 Get document by document id

from pathlib import Path
import xbrr


xbrl_path = xbrr.edinet.api.document.get_xbrl("S100FGR9", save_dir=Path.cwd())
pdf_path = xbrr.edinet.api.document.get_pdf("S100FGR9", save_dir=Path.cwd())

Each XBRL includes taxonomy information. If you want to deal with these files, execute the following.

xbrl_dir = xbrr.edinet.api.document.get_xbrl("S100FGR9", save_dir=Path.cwd(), expand_level="dir")

2. Reader

Extract contents from XBRL.

xbrl = xbrr.edinet.reader.read("path/to/xbrl/file")
content = xbrl.extract(xbrr.edinet.aspects.Business).policy_environment_issue_etc.value

Extract financial statements.

xbrl_dir = xbrr.edinet.reader.read("path/to/xbrl/dir")
xbrl_dir.extract(xbrr.edinet.aspects.Finance).bs.to_csv("bs.csv", index=False)

bs.png

Please refer to the supported aspects from the following links.

xbrr's People

Contributors

icoxfog417 avatar peisuke avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.