Manpuku.Edinet.Xbrl 0.0.4

dotnet add package Manpuku.Edinet.Xbrl --version 0.0.4
                    
NuGet\Install-Package Manpuku.Edinet.Xbrl -Version 0.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Manpuku.Edinet.Xbrl" Version="0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Manpuku.Edinet.Xbrl" Version="0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Manpuku.Edinet.Xbrl" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Manpuku.Edinet.Xbrl --version 0.0.4
                    
#r "nuget: Manpuku.Edinet.Xbrl, 0.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Manpuku.Edinet.Xbrl@0.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Manpuku.Edinet.Xbrl&version=0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Manpuku.Edinet.Xbrl&version=0.0.4
                    
Install as a Cake Tool

EDINET XBRL Parser

プロジェクト概要(Overview)

This library is a .NET class library designed to parse XBRL data disclosed via EDINET, Japan’s electronic disclosure system operated by the Financial Services Agency. Its purpose is to extract and transform XBRL files into programmatically accessible structures for further use in applications.

このライブラリは、EDINETにて開示される XBRL データをパースするための .NET クラスライブラリです。 金融庁が提供する電子開示システムから取得した XBRL ファイルを解析し、プログラム上で扱いやすい構造に変換することを目的としています。


主な機能(Features)

このライブラリは、EDINETにて開示される XBRL データを対象に、以下の機能を提供します:

  • DTS(Discoverable Taxonomy Set)の解決
  • インスタンス(InlineXBRLにも対応)、スキーマ、リンクベースの解析
  • 拡張リンクロールの解決
  • 不正な構造や欠損に対する明示的な例外処理
  • 外部依存を最小限に抑えた、責任範囲の明確な設計

インストール方法(How to install)

このライブラリは、NuGetパッケージとして提供されています。プロジェクトに追加するには、以下のコマンドを使用してください:

dotnet add package Manpuku.Edinet.Xbrl

使用例(Usage)

このライブラリは、DI(依存性注入)を前提とした設計になっています。 IXbrlParser インターフェースを通じて、EDINETのXBRLデータを非同期に解析できます。 パーサは2種類あり、それぞれ用途と呼び出し方が異なります。

通常のXBRLパーサ

XBRLインスタンスファイル(.xbrl)またはスキーマファイル(.xsd)をエントリポイントとして解析します。

services.AddSingleton<Manpuku.Edinet.Xbrl.IXbrlParser, Manpuku.Edinet.Xbrl.XbrlParser>();
public interface IXbrlParser
{
    Task<XBRLDiscoverableTaxonomySet> ParseAsync(Uri entryPointUri, Func<Uri, Task<XDocument>> loader);
}

使用例:

var parser = serviceProvider.GetRequiredService<Manpuku.Edinet.Xbrl.IXbrlParser>();

// loader: URIからXDocumentを取得する非同期関数(呼び出し側で定義)
Func<Uri, Task<XDocument>> loader = async uri =>
{
    using var httpClient = new HttpClient();
    var stream = await httpClient.GetStreamAsync(uri);
    return XDocument.Load(stream);
};

var dts = await parser.ParseAsync(new Uri("https://example.com/entrypoint.xbrl"), loader);

Inline XBRLパーサ

Inline XBRLドキュメント(_ixbrl.htm)をエントリポイントとして解析します。

services.AddSingleton<Manpuku.Edinet.Xbrl.InlineXBRL.IXbrlParser, Manpuku.Edinet.Xbrl.InlineXBRL.XbrlParser>();
public interface IXbrlParser
{
    Task<XBRLDiscoverableTaxonomySet> ParseInlineAsync(Uri[] inlineXBRLsURI, Func<Uri, Task<XDocument>> loader);
}

使用例:

var inlineParser = serviceProvider.GetRequiredService<Manpuku.Edinet.Xbrl.InlineXBRL.IXbrlParser>();

Func<Uri, Task<XDocument>> loader = async uri =>
{
    using var httpClient = new HttpClient();
    var stream = await httpClient.GetStreamAsync(uri);
    return XDocument.Load(stream);
};

var dts = await inlineParser.ParseInlineAsync(new[] {
    new Uri("https://example.com/inline1_ixbrl.htm"),
    new Uri("https://example.com/inline2_ixbrl.htm")
}, loader);

loader関数について

loader は呼び出し側が提供する責任を持ち、指定された Uri から XDocument を非同期で取得する関数です。 この設計により、HTTP取得・キャッシュ・ローカルファイル読み込みなど、環境に応じた柔軟な実装が可能です。


ライセンス(License)

このプロジェクトはMITライセンスの下でライセンスされています。


サポート(Support)

このプロジェクトに関する質問や問題は、GitHubのIssuesセクションで受け付けています。

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 241 11/24/2025
0.0.3 254 10/29/2025
0.0.2 218 10/28/2025
0.0.1 211 10/22/2025

Fixed minor bugs and optimized performance for improved stability.
安定性向上のため、軽微なバグ修正と内部処理の調整を行いました。